Main Content

capture

Capture signal of interest from the air upon detection

Description

example

[data,timestamp,droppedSamples,status] = capture(pd,length,timeout) captures a signal of interest of length length from the air using the preamble detector pd with the detection timeout timeout. The function returns captured signal data, capture request timestamp timestamp, dropped samples status droppedSamples, and capture outcome status status.

Examples

collapse all

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));

Input Arguments

collapse all

Preamble detector, specified as a preambleDetector object.

Note

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.

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 DeviceMemory Buffer SizeMaximum Data Samples

USRP™ N310

2 GB229

USRP N320

2 GB229

USRP N321

2 GB229

USRP X310

1 GB228

Note

  • 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 transmit object function with the pd input.

  • 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.

Example: seconds(5)

Data Types: double | duration

Preamble signal detection timeout, specified as a duration value in time units.

Example: seconds(5)

Data Types: duration

Output Arguments

collapse all

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 single or double, the function scales the captured data sample values to the range [–1, 1].

Data Types: int16 | single | double
Complex Number Support: Yes

Capture request timestamp, returned as a datetime value. The function creates this timestamp just before requesting data capture from the hardware.

Data Types: datetime

Status of dropped samples, returned as one of these logical values.

  • 1 — Samples are dropped during capture.

  • 0 — Samples are not dropped during capture.

Use the DroppedSamplesAction property of the pd input to specify the behavior of the capture function upon dropped samples.

Data Types: logical

Capture outcome status, returned as one of these logical values.

  • 1 — Capture operation was successful and the captured signal of interest is returned in data.

  • 0 — Detect and capture operation timed out.

Data Types: logical

Version History

Introduced in R2022a

See Also

Functions