Main Content

Digital Video Broadcasting - Cable (DVB-C)

This example shows part of the ETSI (European Telecommunications Standards Institute) EN 300 429 standard for cable system transmission of digital television signals [ 1 ]. The example uses communications System objects to simulate the Digital Video Broadcasting - Cable (DVB-C) transmitter-receiver chain.

Introduction

The DVB-C standard describes transmission of digital television signals over cable lines using the MPEG-2 or MPEG-4 family of digital audio and video streams. In this example, we model a portion of that standard. The stream of data is transmitted using Reed-Solomon codes and single carrier QAM modulation. The standard prescribes the transmitter design and sets minimum performance requirements for the receiver.

The purpose of this example is to:

  • Model the main portions of a possible transmit/receive design (operating in 64-QAM mode with MPEG-2 Transport Packet data)

  • Illustrate the use of key Communications Toolbox™ System objects for DVB-C (or similar) system design

  • Illustrate creation of higher level System objects that contain other System objects in order to model large components of the system under test

  • Generate error statistics that will help to determine whether the model satisfies system performance requirements

  • Illustrate creation of test harness that can support variable numbers of test runs. In this case, we use that support to support one mode where only a single EbNo is specified, and we observe spectra and scatterplots. We also support a mode where multiple EbNo are specified, in order to generate a BER curve.

Initialization

The commdvbc_init.m script initializes simulation parameters and generates a structure, prmDVBC. The fields of this structure are the parameters of the DVB-C system at hand.

commdvbc_init
% The fields of this structure are the parameters of the DVB-C system at
% hand.
prmDVBC
prmDVBC = 

  struct with fields:

             bitsPerByte: 8
             bitsPerMTpl: 6
     MPEG2DatRateBitPerS: 9600000
     rawMPEG2DataPcktLen: 184
     MPEG2TrnsprtPcktLen: 188
    MPEG2TrnsprtFramePer: 1.5667e-04
     MPEG2PcktsPerSprFrm: 8
     MPEG2TrnsSuperFrame: 1504
      PRBSSeqPeriodBytes: 1503
       PRBSSeqPeriodBits: 12024
        RSCodewordLength: 204
       CableChanFrameLen: 272
      CableChanFrmPeriod: 1.5667e-04
      RCosineSampsPerSym: 8
       CableSymbolPeriod: 7.1998e-08
       RCosineFilterSpan: 16
     TxRxSymbolSampDelay: 288
     DeintrlvrAlignDelay: 192
        QAMSymbolMapping: [44 45 41 40 52 54 62 60 46 47 43 ... ] (1x64 double)
     ConvIntlNumBranches: 12
       ConvIntlCellDepth: 17

Run System under Test

The main loop in the system under test processes the data packet-by-packet, where eight packets form a superframe. Set useCodegen=true in order to use the generated code instead of the MATLAB® code. Set the MATLAB variable compileIt to true in order to create the generated code.

Code Architecture for the System under Test

This example models the link from the cable operator to a customer's set top box. The model for that link is contained in a function named runDVBCSystemUnderTest. The data processing loop is divided into five main parts. A System object™ was used to model each of those five components in that link. Those objects are:

1) DVBCSource: generates the bitstream
2) DVBCTransmitter: contains the transmitter (encoding, modulation, filtering, etc.)
3) DVBCReceiver: contains the receiver
4) DVBCBER: calculates error rates
5) DVBCScopes: optional object that provides visualization

The inner loop of runDVBCSystemUnderTest makes use of these objects:

You can use a for-loop around the system under test to process a fixed number of super frames. Alternatively, you can use a while-loop to control the simulation length based on the number of simulated errors and transmitted bits. We have done the latter, targeting the number of errors to 100, and maximum number of transmissions to 1e6.

while (berEnd2End(2) < totalErrors) && (berEnd2End(3) < totalBits)
    txBytes = dvbcSource();                          % Source
    [txPckt, modTxPckt] = dvbcTX(txBytes);           % Transmitter
    chPckt = awgn(txPckt,SNR(n),sigPower);           % Channel
    [rxBytes, modRxPckt, rxPcakt] = dvbcRX(chPckt);  % Receiver
    [berEnd2End, berDemod] = ...
      dvbBER(txBytes,rxBytes,modTxPckt,modRxPckt);   % BER
    if useScopes
        runDVBCScopes(dvbcScope,txPckt,chPckt,rxPckt);
    end
end

Descriptions of the Individual Components

MPEG-2 Baseband Physical Interface - Data source

This section generates random data and header bits and appends a header synchronization byte. The first packet of each superframe uses the bit-complement of the header synchronization byte. The code for this component is contained in DVBCSource.m.

Transmitter Baseband Processing

This section randomizes the data using a pseudo-noise sequence. The transmitter applies RS encoding and convolutional interleaving. The function convertBytesToMTuplesDVBCDemo.m converts 8-bit bytes into 6-bit chunks for the 64-QAM modulator. It applies a square root raised cosine filter with 8x oversampling to the data stream after modulation. The code for this component is contained in DVBCTransmitter.m.

Channel

The signal is transmitted through an AWGN channel by using the awgn function.

Receiver Baseband Processing

This section demodulates received symbols and converts 6-bit chunks into bytes using the convertMTuplesToBytesDVBCDemo.m function. Since the filtering operation introduces a delay, the example synchronizes the received bytes to the packet edge using the delay System object, hPacketSync. Note that, the interleaver delay is a multiple of the packet size, so synchronizing to the packet edge is enough. The receiver deinterleaves the packet-synchronized bytes and decodes using the RS decoder System object. Because the example uses a single PN sequence generator, it synchronizes the decoded data to the superframe edge before derandomization. The example shows the transmitted and received channel signal spectrum. Finally, it compares transmitted bits and received bits as well as the modulator input and the demodulator output to obtain bit error rates. The code for this component is contained in DVBCReceiver.m.

BER Computations

This component compares the received, decoded bits and compares those to the transmitted bits in order to compute a bit error rate. The code for this component is contained in DVBCBER.m.

Visualization

Optional instrumentation provides visualization. The code for this component is contained in DVBCScopes.m.

Running the System under Test

We first run the system under test with a single EbNo and visualization turned on in order to verify that it is working properly.

totalErrors = 100;
totalBits = 1e6;
EbNo = 16.5;
useScopes = true;
useCodegen = false;
compileIt = false;
if compileIt
    % Make EbNo input var-size row vector (max length = 100)
    codegen runDVBCSystemUnderTest -report -args {coder.Constant(useScopes),coder.Constant(prmDVBC), coder.Constant(num), 1, coder.typeof(EbNo,[1 100],[false true]), 1, 1}
end
if useCodegen
    % Constant inputs do not appear in call to generated code version
    [berEnd2End, berDemod] = runDVBCSystemUnderTest_mex(useScopes, prmDVBC, num, sigPower, EbNo, totalErrors, totalBits);
else
    [berEnd2End, berDemod] = runDVBCSystemUnderTest(useScopes, prmDVBC, num, sigPower, EbNo, totalErrors, totalBits);
end

BER Curves

Next, we rerun the system under test with a vector of EbNo's and visualization turned off to generate a BER curve.

Calling the error rate measurement objects, berEnd2End and berDemod, output a 3-by-1 vector containing updates of the measured BER value, the number of errors, and the total number of bit transmissions. Display the BER at the output of the demodulator together with the end-to-end BER.

EbNo = 11.5:0.5:14.5;
useScopes = false;
useCodegen = false;
compileIt = false;
if compileIt
    % Make EbNo input var-size row vector (max length = 100)
    codegen runDVBCSystemUnderTest -report -args {coder.Constant(useScopes),coder.Constant(prmDVBC), coder.Constant(num), 1, coder.typeof(EbNo,[1 100],[false true]), 1, 1}
end
if useCodegen
    % Constant inputs do not appear in call to generated code version
    [berEnd2End, berDemod] = runDVBCSystemUnderTest_mex(useScopes, prmDVBC, num, sigPower, EbNo, totalErrors, totalBits)
else
    [berEnd2End, berDemod] = runDVBCSystemUnderTest(useScopes, prmDVBC, num, sigPower, EbNo, totalErrors, totalBits)
end
%
plotDVBCResults(EbNo, berEnd2End, berDemod);
berEnd2End =

    0.0148
    0.0170
    0.0075
    0.0069
    0.0011
    0.0001
    0.0000


berDemod =

    0.0149
    0.0135
    0.0088
    0.0072
    0.0043
    0.0028
    0.0017

Summary

This example utilized several System objects to simulate part of the DVB-C communication system over an AWGN channel. It showed how to model several parts of the DVB-C system such as the randomization, coding, and interleaving. The example also used the delay System objects to synchronize the transmitter and the receiver. System performance was measured using the BER curves obtained with error rate measurement System objects.

Appendix

This example uses the following scripts and helper functions:

Selected Bibliography

  1. ETSI Standard EN 300 429 V1.2.1: Digital Video Broadcasting (DVB); Framing structure, channel coding and modulation for cable systems, European Telecommunications Standards Institute, Valbonne, France, 1998.