capture
Description
[
captures a signal of interest of length data
,timestamp
,droppedSamples
,status
] = capture(pd
,length
,timeout
)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
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));
Input Arguments
pd
— Preamble detector
preambleDetector
object
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.
length
— Capture length
integer number of samples | duration
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 |
---|---|---|
USRP™ N310 | 2 GB | 229 |
USRP N320 | 2 GB | 229 |
USRP N321 | 2 GB | 229 |
USRP X310 | 1 GB | 228 |
USRP X410 | 4 GB | 230 |
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 thepd
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
timeout
— Preamble signal detection timeout
duration
Preamble signal detection timeout on the radio, specified as a duration
value in time units. If the
property specifies a periodic signal, set the
detection timeout to a value that is equal to or greater than the preamble signal
period. Setting the detection timeout to a value less than the preamble signal period
can end the detection operation prematurely.pd
.Preamble
Example: milliseconds(100)
Data Types: duration
Output Arguments
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
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
timestamp
— Capture request timestamp
datetime
value
Capture request timestamp, returned as a datetime
value. The
function creates this timestamp just before requesting data capture from the
hardware.
Data Types: datetime
droppedSamples
— Status of dropped samples
1
| 0
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
status
— Capture outcome status
1
| 0
Capture outcome status, returned as one of these logical values.
1
— Capture operation was successful and the captured signal of interest is returned indata
.0
— Detect and capture operation timed out.
Data Types: logical
Version History
Introduced in R2022a
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)