Baseband signal for transmission/reception.
Type | Name and description |
---|---|
int |
carrierFrequency |
int |
channels |
float |
fc |
float |
fs |
int |
preamble |
int |
preambleID |
int |
samplingRate |
float[] |
signal |
float[] |
signal |
Constructor and description |
---|
BasebandSignal
(Performative perf) |
BasebandSignal
(AgentID aid, Performative perf) |
BasebandSignal
(Message inReplyTo, Performative perf) |
Type Params | Return Type | Name and description |
---|---|---|
|
int |
getCarrierFrequency() Gets the carrier frequency for the passband signal represented by this baseband signal. |
|
int |
getChannels() Gets the number of channels. |
|
float |
getFc() Gets the carrier frequency for the passband signal represented by this baseband signal. |
|
float |
getFs() Gets the sampling rate of the signal. |
|
int |
getPreamble() Gets the preamble identifier. |
|
int |
getPreambleID() Gets the preamble identifier. |
|
int |
getSamplingRate() Gets the sampling rate of the signal. |
|
float[] |
getSignal() Gets the signal contents as an array of floats. |
|
float[] |
getSignal(int ch) Gets the signal for a given channel. |
|
String |
getSignalAsBase64() Gets a base64 representation of the baseband signal. |
|
int |
getSignalLength() Gets the signal length per channel in samples. |
|
boolean |
isComplex() Checks if the signal is complex or real. |
|
void |
setCarrierFrequency(int fc) Sets the carrier frequency for the passband signal represented by this baseband signal. |
|
void |
setChannels(int ch) Sets the number of channels. |
|
void |
setFc(float fc) Sets the carrier frequency for the passband signal represented by this baseband signal. |
|
void |
setFs(float fs) Sets the sampling rate of the signal. |
|
void |
setPreamble(int n) Sets the preamble identifier (default is 0). |
|
void |
setPreambleID(int n) Sets the preamble identifier (default is 0). |
|
void |
setSamplingRate(int fs) Sets the sampling rate of the signal. |
|
void |
setSignal(float[] signal) Sets the signal contents from an array of floats. |
|
void |
setSignalFromBase64(String s) Sets the signal from a base64 representation of the baseband signal. |
|
String |
toString() |
Methods inherited from class | Name |
---|---|
class Message |
setPerformative, toString, getSender, setMessageID, getSentAt, setRecipient, getInReplyTo, setSentAt, setSender, getPerformative, getRecipient, getMessageID, setInReplyTo, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll |
Number of channels.
Sampling frequency (Hz), -1 if unknown.
Preamble identifier.
Signal time series. For complex signals, real and imaginary parts are in consecutive floats. Multi-channel signals are interleaved.
Gets the carrier frequency for the passband signal represented by this baseband signal. If the carrier frequency is 0, then the signal represented here is passband real.
Gets the number of channels.
Gets the carrier frequency for the passband signal represented by this baseband signal. If the carrier frequency is 0, then the signal represented here is passband real.
Gets the sampling rate of the signal.
Gets the preamble identifier. For a transmission request, this is the detection preamble to add to the signal before transmission. A preamble id of 0 causes no preamble to be added. For a reception request, this is the id of the preamble that was detected.
Gets the preamble identifier. For a transmission request, this is the detection preamble to add to the signal before transmission. A preamble id of 0 causes no preamble to be added. For a reception request, this is the id of the preamble that was detected.
Gets the sampling rate of the signal.
Gets the signal contents as an array of floats. If the signal is complex, alternate entries as real and imaginary. If the signal has multiple channels, the channel data is interleaved.
Gets the signal for a given channel. If the signal is complex, alternate entries as real and imaginary.
ch
- channel number (base 1)Gets a base64 representation of the baseband signal.
Gets the signal length per channel in samples.
Checks if the signal is complex or real. Baseband signals are complex, while passband signals (carrierFrequency of 0) are real.
Sets the carrier frequency for the passband signal represented by this baseband signal. If the carrier frequency is 0, then the signal represented here is passband real.
fc
- carrier frequency in HzSets the number of channels.
ch
- number of channelsSets the carrier frequency for the passband signal represented by this baseband signal. If the carrier frequency is 0, then the signal represented here is passband real.
fc
- carrier frequency in HzSets the sampling rate of the signal.
fs
- sampling rate in HzSets the preamble identifier (default is 0). For a transmission request, this is the detection preamble to add to the signal before transmission. A preamble id of 0 causes no preamble to be added. For a reception request, this is the id of the preamble that was detected.
n
- preamble identifierSets the preamble identifier (default is 0). For a transmission request, this is the detection preamble to add to the signal before transmission. A preamble id of 0 causes no preamble to be added. For a reception request, this is the id of the preamble that was detected.
n
- preamble identifierSets the sampling rate of the signal.
fs
- sampling rate in HzSets the signal contents from an array of floats. If the signal is complex, the array must have an even number of floats with alternate entries as real and imaginary. If the signal has multiple channels, the array length must be an integer multiple of the number of channels, and the channel data is interleaved.
signal
- array of floatsSets the signal from a base64 representation of the baseband signal.
s
- base64 stringCopyright 2013-21, Acoustic Research Laboratory, National University of Singapore, and Subnero Pte Ltd