Capture IQ data using baseband receiver or transceiver
Configure Baseband Receiver and Capture Data
Create a baseband receiver object, specifying a radio setup configuration previously saved in the Radio Setup wizard.
bbrx = basebandReceiver("MyRadio")
bbrx = basebandReceiver with properties: RadioGain: 10 CenterFrequency: 2.4000e+09 SampleRate: 250000000 Antennas: "RF0:RX2" DroppedSamplesAction: "error" CaptureDataType: "int16"
Set the baseband sample rate and center frequency.
bbrx.SampleRate = 122.88e6; bbrx.CenterFrequency = 2.2e9;
Capture 3 ms of IQ data with the radio associated with the baseband receiver object using the default antenna.
[data,~] = capture(bbrx,milliseconds(3));
Configure Baseband Transceiver to Transmit and Capture Data
Create a baseband transceiver object, specifying a radio setup configuration previously saved in the Radio Setup wizard.
bbtrx = basebandTransceiver("MyRadio")
bbtrx = basebandTransceiver with properties: TransmitRadioGain: 10 TransmitCenterFrequency: 2.4000e+09 TransmitAntennas: "RF0:TX/RX" CaptureRadioGain: 10 CaptureCenterFrequency: 2.4000e+09 CaptureAntennas: "RF0:RX2" CaptureDataType: "int16" DroppedSamplesAction: "error" SampleRate: 250000000
Set the baseband sample rate.
bbtrx.SampleRate = 122.88e6;
Set the transmit and capture center frequencies.
bbtrx.TransmitCenterFrequency = 2.2e9; bbtrx.CaptureCenterFrequency = 2.2e9;
Generate random transmit waveform.
txWaveform = complex(randn(1000,1),randn(1000,1));
Transmit the generated waveform continuously with the radio associated with the baseband transceiver object using the default transmit antenna.
Capture IQ data with the radio associated with the baseband transceiver object using the default capture antenna.
[data,~] = capture(bbtrx,milliseconds(3));
Stop the continuous transmission after data capture is complete.
bba — Baseband application
basebandReceiver object |
length — Capture length
integer number of samples |
Capture length, specified as an integer number of samples or a
duration value in time units. The function converts
length into N samples based on the
SampleRate property of the
bba input and
ceil(N) number of data samples.
Specify the capture length relative to the onboard radio memory buffer size. The buffer has a capacity of 2 GB, which amounts to a total of 229 data samples.
Transmit and capture data samples on the baseband transceiver are buffered in the onboard radio memory. Therefore, if the
bbainput is a baseband transceiver, you must also take into account the length of the transmit waveform of any continuous transmission that you specify when calling the
transmitobject function with the
If your host computer does not have enough free memory to receive the captured data from the radio buffer, the function call can hang or error out. To free up memory space on your host computer, try closing other software or reduce the capture length.
data — Captured signal
complex-valued column vector | complex-valued matrix
Captured signal, returned as one of these options.
Complex-valued column vector — The vector contains data that is captured on a single capture antenna.
Complex-valued matrix — The matrix contains data that is captured on multiple capture antennas. This option applies only when
bbais a baseband receiver. The number of antennas specified by the
Antennasproperty of the
bbainput determines the number of matrix columns.
CaptureDataType property to
specify the data type of the returned data. If you specify the return data type as
double, the function scales the
captured data sample values to the range [–1, 1].
The first data samples of the captured signal can contain transient values from the radio data path.
Complex Number Support: Yes
timestamp — Capture request timestamp
Capture request timestamp, returned as a
datetime value. The
function creates this timestamp just before requesting data capture from the
droppedSamples — Status of dropped samples
Status of dropped samples, returned as one of these logical values.
1— Samples are dropped during capture.
0— Samples are not dropped during capture.
DroppedSamplesAction property of the
bba input to specify the behavior of the function upon dropped