Plot preamble detection signals for triggering
plots preamble detection signals while detecting a preamble in live data of length
length from the air using the preamble detector
pd. The plot shows the correlator output power, threshold, and
trigger points of the detection. Use the displayed information to calibrate the threshold in
the preamble detector for triggering.
Configure Preamble Detector and Plot Detection Threshold
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 = 30.72e6; pd.CenterFrequency = 2.45e9; pd.RadioGain = 45;
Specify the preamble.
pd.Preamble = preamble;
Specify a fixed threshold.
pd.ThresholdMethod = "Fixed"; pd.FixedThreshold = 5;
Generate test waveform for detection.
prePadLen = 2501; postPadLen = 2500; headSignal = complex(zeros(prePadLen,1),zeros(prePadLen,1)); rearSignal = complex(zeros(postPadLen,1),zeros(postPadLen,1)); testWaveform = [headSignal; preamble; rearSignal];
Send the test waveform continuously.
transmit(pd,testWaveform,"continuous", ... TransmitGain=45, ... TransmitCenterFrequency=2.45e9, ... TransmitAntennas="RF0:TX/RX");
Plot the specified number of samples of the correlator output power. Use the displayed information to calibrate thresholding parameters.
Stop test waveform transmission.
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 — Plotted data length
integer number of samples |
Plotted data 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 and plots
ceil(N) number of data samples.
Specify the plotted data 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.
Plotted and transmit data samples are buffered in the onboard radio memory.
Therefore, when specifying the plotted data length, you must also take into account
the length of the transmit waveform of any continuous transmission that you specify
when calling the
object function with the
droppedSamples — Status of dropped samples
Status of dropped samples, returned as one of these logical values.
1— Samples are dropped while plotting the signals.
0— Samples are not dropped while plotting the signals.