Main Content


Retrieve outputs from capture run in background using baseband receiver

Since R2024a



[data,timestamp,droppedSamples] = captureOutputs(bbrx) retrieves the outputs of a capture run in the background using the specified baseband receiver. The function returns the path to the file containing the captured data data, capture request timestamp timestamp, and dropped samples status droppedSamples.


collapse all

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"

Capture 1 s of IQ data in the background and save it to a file in the basebandData folder called capture1.mat.

[dataPath,~] = capture(bbrx,seconds(1),SaveLocation='basebandData/capture1.mat',Background=true);

Check if the capture is in progress.

ans = logical

Wait for the capture to complete.

while isCapturing(bbrx)

Check that the capture is no longer in progress.

ans = logical

Retrieve the outputs of the capture operation and load the captured IQ data into the workspace.

[dataPath, timestamp, droppedSamples] = captureOutputs(bbrx);

Input Arguments

collapse all

Baseband receiver, specified as a basebandReceiver object.

Output Arguments

collapse all

Path to the MAT-file where the captured data is saved, returned as a character vector. The full path is returned, including the filename and extension.


The first data samples of the captured signal can contain transient values from the radio data path.

Example: 'H:/user/matlab/capture1.mat'

Data Types: char

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 bbrx input to specify the behavior of the function upon dropped samples.

Data Types: logical


When you call the captureOutputs function, the captured data is moved into the MAT-file specified by the SaveLocation name-value argument of the capture function. This operation can take several seconds and the time depends on the size of the file.


Check the status of the capture by using the isCapturing function before using the captureOutputs function:

This function returns 1 (true) if a capture is in progress in the background.

Version History

Introduced in R2024a

See Also