dvbs2xBitRecover
Syntax
Description
recovers user packets (UPs) or a continuous bit stream, bits
= dvbs2xBitRecover(rxdata
,nvar
)bits
. Input
rxdata
is the received complex in-phase quadrature (IQ) symbols in
the form of physical layer (PL) frames of a Digital Video Broadcasting Satellite Second
Generation extended (DVB-S2X) single or multi-input stream transmission. Input
nvar
is the noise variance estimate, which the function uses to
calculate soft bits.
[
also returns the number of frames lost bits
,numFramesLost
,pktCRCStatus
,decodedParams
] = dvbs2xBitRecover(rxdata
,nvar
)numFramesLost
UP cyclic
redundancy check (CRC) status pktCRCStatus
and a
structure decodedParams
in which the fields indicate
the parameters of the processed PL frames.
[___] = dvbs2xBitRecover(
specifies one or more optional name-value arguments. For example,
rxdata
,nvar
,Name=Value
)Mode="wideband"
sets the mode of operation for the bit recovery to the
wideband frame processing mode.
Examples
Recover Data Bits from Transport Stream DVB-S2X Transmission in Regular Mode
Recover UPs for a given PL frame in a single transport stream (TS) DVB-S2X transmission in regular mode.
This example uses MAT files with LDPC parity matrices. If the MAT files are not available on the path, download and unzip the MAT files by entering this code at the MATLAB® command line.
if ~exist("dvbs2xLDPCParityMatrices.mat","file") if ~exist("s2xLDPCParityMatrices.zip","file") url = "https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip"; websave("s2xLDPCParityMatrices.zip",url); unzip("s2xLDPCParityMatrices.zip"); end addpath("s2xLDPCParityMatrices"); end
Specify the number of PL frames per stream and set the baseband filtering at 4 samples per symbol.
nFrames = 1; s2xWaveGen = dvbs2xWaveformGenerator; sps = 4;
Create a bit vector of information bits, data
, of concatenated TS UPs.
syncBits = [0 1 0 0 0 1 1 1]'; % Sync byte for TS packet is 47 Hex pktLen = 1496; % UP length without sync bits is 1496 numPkts = s2xWaveGen.MinNumPackets*nFrames; txRawPkts = randi([0 1],pktLen,numPkts); txPkts = [repmat(syncBits,1,numPkts); txRawPkts]; data = txPkts(:);
Generate the DVB-S2X time-domain waveform using the input information bits. Flush the transmit filter to handle the filter delay and recover the complete last frame.
txWaveform = [s2xWaveGen(data); flushFilter(s2xWaveGen)];
Add additive white Gaussian noise (AWGN) to the generated waveform.
EsNodB = 5;
snrdB = EsNodB - 10*log10(sps);
rxWaveform = awgn(txWaveform,snrdB,"measured");
Create a raised cosine receiver filter.
rxFilter = comm.RaisedCosineReceiveFilter( ... "RolloffFactor",s2xWaveGen.RolloffFactor, ... "InputSamplesPerSymbol",sps,"DecimationFactor",sps);
Apply matched filtering and remove the filter delay.
filtOut = rxFilter(rxWaveform); rxSymb = filtOut(rxFilter.FilterSpanInSymbols+1:end);
Recover UPs.
[rxOut,numFramesLost] = dvbs2xBitRecover(rxSymb,10^(-EsNodB/10));
Display the number of frames lost and the UP cyclic redundancy check (CRC) status.
fprintf("numFramesLost = %d\n",numFramesLost)
numFramesLost = 0
fprintf("Number of bit errors = %d\n",sum(data~=rxOut{1}))
Number of bit errors = 0
Recover Data Bits from Generic Stream DVB-S2X Transmission in Wideband Mode
Recover user bits in a multi-input generic stream (GS) DVB-S2X transmission, with variable modulation and coding scheme, in wideband mode.
This example uses MAT files with LDPC parity matrices. If the MAT files are not available on the path, download and unzip the MAT files by entering this code at the MATLAB command prompt.
if ~exist("dvbs2xLDPCParityMatrices.mat","file") if ~exist("s2xLDPCParityMatrices.zip","file") url = "https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip"; websave("s2xLDPCParityMatrices.zip",url); unzip("s2xLDPCParityMatrices.zip"); end addpath("s2xLDPCParityMatrices"); end
Specify the number of PL frames per stream and set the baseband filtering at 4 samples per symbol.
nFramesPerStream = 2; sps = 4;
Create a DVB-S2X System object™ with variable coding and modulation configuration for a multi-input GS and set its properties.
s2xWaveGen = dvbs2xWaveformGenerator;
s2xWaveGen.NumInputStreams = 5;
s2xWaveGen.PLSDecimalCode = [140 132 133 141 132];
s2xWaveGen.DFL = [37168 18448 18448 37168 18448];
s2xWaveGen.StreamFormat = "GS";
s2xWaveGen.HasTimeSlicing = true;
Create a bit vector of input information bits for each input stream.
data = cell(s2xWaveGen.NumInputStreams,1); for i = 1:s2xWaveGen.NumInputStreams data{i} = randi([0 1],s2xWaveGen.DFL(i)*nFramesPerStream,1); end
Generate the DVB-S2X time-domain waveform using the input information bits. Flush the transmit filter to handle the filter delay and recover the complete last frame.
txWaveform = [s2xWaveGen(data); flushFilter(s2xWaveGen)];
Add additive white Gaussian noise (AWGN) to the generated waveform.
EsNodB = 4;
snrdB = EsNodB - 10*log10(sps);
rxWaveform = awgn(txWaveform,snrdB,"measured");
Create a raised cosine receiver filter.
rxFilter = comm.RaisedCosineReceiveFilter( ... "RolloffFactor",s2xWaveGen.RolloffFactor, ... "InputSamplesPerSymbol",sps,"DecimationFactor",sps);
Apply matched filtering and remove the filter delay.
filtOut = rxFilter(rxWaveform); rxSymb = filtOut(rxFilter.FilterSpanInSymbols+1:end);
Set the time slicing number to the required PL frame value to be recovered. Recover the user bits.
tsn = 3; [rxOut,numFramesLost,pktCRCStat] = dvbs2xBitRecover(rxSymb,10^(-EsNodB/10), ... Mode="wideband", ... TimeSlicingNumber=tsn);
Display the number of frames lost and the UP CRC status.
fprintf("numFramesLost = %d\n",numFramesLost)
numFramesLost = 0
fprintf("Number of bit errors = %d\n",sum(data{tsn}~=rxOut{1}))
Number of bit errors = 0
Recover Data Bits from Transport Stream DVB-S2X Transmission in VL-SNR Mode
Recover UPs for a given PL frame in a single TS DVB-S2X transmission in VL-SNR mode.
This example uses MAT files with LDPC parity matrices. If the MAT files are not available on the path, download and unzip the MAT files by entering this code at the MATLAB command prompt.
if ~exist("dvbs2xLDPCParityMatrices.mat","file") if ~exist("s2xLDPCParityMatrices.zip","file") url = "https://ssd.mathworks.com/supportfiles/spc/satcom/DVB/s2xLDPCParityMatrices.zip"; websave("s2xLDPCParityMatrices.zip",url); unzip("s2xLDPCParityMatrices.zip"); end addpath("s2xLDPCParityMatrices"); end
Specify the number of PL frames per stream and set the baseband filtering at 4 samples per symbol.
nFrames = 1; sps = 4;
Create a DVB-S2X System object™ for TS and set its properties.
s2xWaveGen = dvbs2xWaveformGenerator; s2xWaveGen.PLSDecimalCode = 129; s2xWaveGen.NumInputStreams = 1; s2xWaveGen.DFL = 14128; s2xWaveGen.PLScramblingIndex =4;
Create a bit vector of information bits, data
, of concatenated TS UPs.
syncBits = [0 1 0 0 0 1 1 1]'; % Sync byte for TS packet is 47 Hex pktLen = 1496; % UP length without sync bits is 1496 numPkts = s2xWaveGen.MinNumPackets*nFrames; txRawPkts = randi([0 1],pktLen,numPkts); txPkts = [repmat(syncBits,1,numPkts); txRawPkts]; data = txPkts(:);
Generate the DVB-S2X time-domain waveform using the input information bits. Flush the transmit filter to handle the filter delay and recover the complete last frame.
txWaveform = [s2xWaveGen(data); flushFilter(s2xWaveGen)];
Add additive white Gaussian noise (AWGN) to the generated waveform.
EsNodB = -2;
snrdB = EsNodB - 10*log10(sps);
rxWaveform = awgn(txWaveform,snrdB,"measured");
Create a raised cosine receiver filter.
rxFilter = comm.RaisedCosineReceiveFilter( ... "RolloffFactor",s2xWaveGen.RolloffFactor, ... "InputSamplesPerSymbol",sps,"DecimationFactor",sps);
Apply matched filtering and remove the filter delay.
filtOut = rxFilter(rxWaveform); rxSymb = filtOut(rxFilter.FilterSpanInSymbols+1:end);
Recover UPs.
[rxOut,numFramesLost,pktCRCStat,decodedParams] = dvbs2xBitRecover(rxSymb,10^(-EsNodB/10), ... Mode="vl-snr",PLScramblingIndex=4);
Display the number of frames lost and parameters of the processed PL frame.
fprintf("numFramesLost = %d\n",numFramesLost)
numFramesLost = 0
disp(decodedParams)
PLSDecimalCode: 129 IsDummyFrame: 0 BBHeaderStatus: 1 ModulationOrder: 4 FECFrameLength: 64800 CanonicalMODCODName: {'QPSK 2/9'} HasPilots: 1
Input Arguments
rxdata
— Received IQ symbols from PL frames of DVB-S2X transmission
column vector
Received IQ symbols from the PL frames of a DVB-S2X single-input or multi-input
transmission, specified as a column vector. rxdata
can contain one
or more PL frames.
The length of rxdata
depends on the forward error correction
(FEC) frame length, modulation order, mode (regular, VL-SNR, or wideband), and presence
or absence of pilots specified for the PL frame.
Data Types: double
Complex Number Support: Yes
nvar
— Noise variance estimate
nonnegative scalar
Noise variance estimate that the function adds to the input IQ symbols, specified as
a nonnegative scalar. The function uses nvar
as a scaling factor to
calculate the soft bits from the IQ symbols.
When you specify nvar
as 0
, the function
uses a value of 1e–5, which corresponds to a signal-to-noise ratio (SNR) of 50
dB.
Data Types: double
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: Mode="wideband"
sets the mode of operation for the bit
recovery to wideband frame processing mode.
PLScramblingIndex
— PL scrambling sequence index
0
(default) | integer in range [0, 7] | vector of integers in range [0, 7]
PL scrambling sequence index, specified as a integer in the range [0, 7] or as a vector of integers in the range [0, 7].
The function uses a gold sequence index of
PLScramblingIndex
*10949
, as defined in ETSI
EN 302 307-2 section 5.5.4 table 19e [1].
When you specify Mode
as "wideband"
, the
PLScramblingIndex
value must be equal to the scrambling
sequence index value of the sequence used to scramble the required wideband PL
frames.
Data Types: double
EarlyTermination
— Flag for early termination of LDPC decoder
0
or false
(default) | 1
or true
Flag for early termination of the LDPC decoder when all parity-checks are
satisfied, specified as a numeric or logical value of 1
(true
) or 0
(false
). When
set to 1
, the LDPC decoder is terminated when all parity checks are
satisfied.
When you set this value to 0
, the maximum decoding iteration
limit is 50.
If the modulation order of the PL frame is 2, the maximum decoding iteration limit is 75.
Data Types: logical
Mode
— Mode of operation for bit recovery
"regular
(default) | "vl-snr"
| "wideband"
Mode of operation for the bit recovery, specified as one of these values.
"regular
— Use this option to set the mode to regular frame processing."vl-snr"
— Use this option to set the mode to very low signal-to-noise ratio (VL-SNR) frame processing."wideband"
— Use this option to set the mode to wideband frame processing.
Note
For this function, wideband mode does not support VL-SNR frame processing.
Data Types: char
| string
TimeSlicingNumber
— Time slicing number
1
(default) | scalar in range [0, 253]
Time slicing number encoded into the PL header of the required wideband frames, specified as a scalar in the range [0, 253].
If the time slicing number decoded from a PL header is not equal to the required time slicing number value, the function discards the PL frame and decodes the next wideband frame PL header.
To use this argument, you must specify Mode
as
"wideband"
.
Note
In wideband mode, the number of streams is considered as number of services,
where each stream is considered to be an individual service. The receiver recovers
only the service specified by the TimeSlicingNumber
argument.
Data Types: double
Output Arguments
bits
— Recovered data bits
cell array of column vectors
Recovered data bits, returned as a cell array of column vectors. Each element of the
cell array is of data type int8
. This output can be either UPs or a
generic data stream, depending of the StreamFormat property of the dvbs2xWaveformGenerator
System object.
For a multi-input stream transmission, each element of the cell array corresponds to an individual input stream.
Data Types: cell
numFramesLost
— Number of lost baseband frames
nonnegative integer
Number of lost baseband frames, returned as a nonnegative integer. If the baseband header CRC fails, the function considers the frame as lost.
Data Types: double
pktCRCStatus
— UP CRC status
cell array of column vectors
UP CRC status, returned as a cell array of column vectors. Each element of the cell
array is of data type logical
. For a multi-input stream transmission,
each element of the cell array corresponds to an individual input stream.
pktCRCStatus
applies for only the input streams where the value
of the UPL property of dvbs2xWaveformGenerator
System object is
nonzero. When UPL is set to zero, pktCRCStatus
returns an empty
output.
Data Types: cell
decodedParams
— Parameters of the processed PL frames
structure
Parameters of the processed PL frames, returned as a structure with these fields.
Structure Field | Value | Description |
---|---|---|
PLSDecimalCode | 0 or integer in the range [4, 249] | PL signaling code information derived from the PL header recovery. |
IsDummyFrame | 0 (false ) or 1
(true ) | Flag to indicate whether the decoded PL frame is a dummy frame. A
value of |
BBHeaderCRCStatus | 0 (false ) or 1
(true ) | Flag to indicate whether the baseband (BB) header CRC check passed.
A value of This field is returned as
|
ModulationOrder | Integer from the set {0, 2, 4, 8, 16, 32, 64, 128, 256} | Modulation order of the FEC frame symbols. This field
is returned as |
FECFrameLength | 16200 , 32400 , or
64800 | FEC frame length is the output length (in bits) specified to the FEC encoder. This field is returned as |
CanonicalMODCODName | cell array | Canonical modulation scheme and code rate name for VL-SNR frame transmissions. This field is present only if you pass a VL-SNR frame to this ideal receiver. Valid
If the frame passed to the receiver is not a VL-SNR frame, the output of this field is an empty string. |
HasPilots | 0 (false ) or 1
(true ) | Flag to indicate the pilot block. A value of This field is returned as |
In the case of a single-input stream, all structure fields except
CanonicalMODCODName
are returned as integers and as vectors in the
case of a multi-input stream. For a multi-input stream, each element of a vector
corresponds to an individual input stream.
Whether for a single-input stream or a multi-input stream, the function returns
CanonicalMODCODName
as a cell array, where each element of the cell
array is of data type char
or string
.
Data Types: struct
References
[1] ETSI Standard EN 302 307-2 V1.1.1(2015-11). Digital Video Broadcasting (DVB); Second Generation Framing Structure, Channel Coding and Modulation Systems for Broadcasting, Interactive Services, News Gathering and Other Broadband Satellite Applications; Part 2: DVB-S2 Extensions (DVB-S2X)
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Version History
Introduced in R2022b
See Also
Objects
Functions
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)