Detect preamble in data
The Preamble Detector block detects a preamble in a data sequence. A preamble is a set of symbols or bits used in packet-based communication systems to indicate the start of a packet. The block finds the location corresponding to the end of the preamble.
Port_1— Input data
This port accepts real or complex input data sequences. The input data can be either symbols or bits. This port accepts variable-size arrays.
Complex Number Support: Yes
Idx— Index of last preamble symbol
This port outputs the index corresponding to the last element of each detected preamble. This port outputs variable-size arrays.
DtMt— Detection metric
This port outputs the detection metric. The detection metric
has the same size and data type as the input data. This port is available
when the Input parameter is
the Output detection metric is selected.
If either the preamble or input data is complex, the detection metric is the absolute value of the cross-correlation of the preamble and the input signal.
If both the preamble and input data are real, the detection metric is the cross-correlation of the preamble and the input signal.
Input— Input signal type
Specify the input signal type as
For binary inputs, set this parameter to
For all other inputs, set this parameter to
Preamble— Preamble sequence
[1 + 1i; 1 - 1i](default) | column vector
Specify the preamble sequence as a column vector. If Input is
the preamble must be binary. If Input is
the preamble can be any real or complex sequence.
Detection threshold— Detection threshold
3(default) | nonnegative real scalar
Specify the detection threshold as a nonnegative real scalar. When the detection metric is greater than or equal to the threshold, the block detects the preamble and updates the index. Tunable.
Output detection metric— Enable output detection metric port
Select this check box to create the DtMt port, from which the detection metric data is output.
When the input data is composed of bits, the preamble detector uses an exact pattern match.
When the input data is composed of symbols, the preamble detector uses a cross-correlation algorithm. An FIR filter, in which the coefficients are specified from the preamble, computes the cross-correlation between the input data and the preamble. When a sequence of input samples matches the preamble, the filter output reaches its peak. The index of the peak corresponds to the end of the preamble sequence in the input data. See Discrete FIR Filter for further information on the FIR filter algorithm.
The cross-correlation values that are greater than or equal to the specified threshold are reported as peaks. As a result, there may be no detected peaks or there may be as many detected peaks as there are input samples. Consequently, the selection of the detection threshold is very important.