Capture signal of interest from the air upon detection
captures a signal of interest of length
status] = capture(
length from the air using the
pd with the detection timeout
timeout. The function returns captured signal
data, capture request timestamp
dropped samples status
droppedSamples, and capture outcome status
Configure Preamble Detector and Capture Data
Define a preamble sequence with good correlation properties. For example, generate and normalize a Zadoff-Chu sequence of length 137.
seq = zadoffChuSeq(38,137); preamble = seq/norm(seq,2);
Create and configure a preamble detector object, specifying a radio setup configuration previously saved in the Radio Setup wizard.
pd = preambleDetector("MyRadio")
pd = preambleDetector with properties: CenterFrequency: 2.4000e+09 RadioGain: 10 Antennas: "RF0:RX2" SampleRate: 250000000 CaptureDataType: "int16" DroppedSamplesAction: "error" Preamble: 0 ThresholdMethod: "adaptive" FixedThreshold: 0 AdaptiveThresholdOffset: 0 AdaptiveThresholdGain: 0 TriggerOffset: 0
pd.SampleRate = 10.24e6; pd.CenterFrequency = 2.2e9; pd.CaptureDataType = "double";
Specify the preamble.
pd.Preamble = preamble;
Set the trigger offset to a negative value to capture 500 samples before the trigger point.
pd.TriggerOffset = -500;
Capture 10 ms of data with a timeout of 1 second.
[data,timestamp,droppedSamples,status] = capture(pd,milliseconds(10),seconds(1));
pd — Preamble detector
Preamble detector, specified as a
The first object function call in which you specify this object as an input requires a few extra seconds to load the application onto the hardware.
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
pd input and captures
ceil(N) number of data samples.
Specify the capture length relative to the onboard radio memory buffer size.
|Radio Device||Memory Buffer Size||Maximum Data Samples|
Capture and transmit data samples are buffered in the onboard radio memory. Therefore, when specifying the capture length, 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
column vector of complex values
Captured signal, returned as a column vector of complex values. Use the
CaptureDataType property of the
pd input to specify
the output data type of the captured data. If you specify the return data type as
double, the function scales the
captured data sample values to the range [–1, 1].
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 — Capture outcome status
Capture outcome status, returned as one of these logical values.
1— Capture operation was successful and the captured signal of interest is returned in
0— Detect and capture operation timed out.
Introduced in R2022a