Products & Services Solutions Academia Support User Community Company

Learn more about Communications Toolbox   

Using MLSE Equalizers

Section Overview

The mlseeq function uses the Viterbi algorithm to equalize a signal through a dispersive channel. The function receives a baseband linearly modulated input signal and outputs the maximum likelihood sequence estimate of the signal, using an estimate of the channel modeled as a finite input response (FIR) filter.

The function decodes the received signal using these steps:

  1. Applies the FIR filter, corresponding to the channel estimate, to the symbols in the input signal.

  2. Uses the Viterbi algorithm to compute the traceback paths and the state metric, which are the numbers assigned to the symbols at each step of the Viterbi algorithm. The metrics are based on Euclidean distance.

  3. Outputs the maximum likelihood sequence estimate of the signal, as a sequence of complex numbers corresponding to the constellation points of the modulated signal.

An MLSE equalizer yields the best possible performance, in theory, but is computationally intensive.

For background material about MLSE equalizers, see the works listed in Selected Bibliography for Equalizers.

Equalizing a Vector Signal

In its simplest form, the mlseeq function equalizes a vector of modulated data when you specify the estimated coefficients of the channel (modeled as an FIR filter), the signal constellation for the modulation type, and the traceback depth that you want the Viterbi algorithm to use. Larger values for the traceback depth can improve the results from the equalizer but increase the computation time.

An example of the basic syntax for mlseeq is below.

M = 4; const = pskmod([0:M-1],M); % 4-PSK constellation
msg = pskmod([1 2 2 0 3 1 3 3 2 1 0 2 3 0 1]',M); % Modulated message
chcoeffs = [.986; .845; .237; .12345+.31i]; % Channel coefficients
filtmsg = filter(chcoeffs,1,msg); % Introduce channel distortion.
tblen =  10; % Traceback depth for equalizer
chanest = chcoeffs; % Assume the channel is known exactly.
msgEq = mlseeq(filtmsg,chanest,const,tblen,'rst'); % Equalize.

The mlseeq function has two operation modes:

If you are not processing a series of vectors and do not need to specify a preamble or postamble, the operation modes are nearly identical. However, they differ in that continuous operation mode incurs a delay, while reset operation mode does not. The example above could have used either mode, except that substituting continuous operation mode would have produced a delay in the equalized output. To learn more about the delay in continuous operation mode, see Delays in Continuous Operation Mode.

Equalizing in Continuous Operation Mode

If your data is partitioned into a series of vectors (that you process within a loop, for example), continuous operation mode is an appropriate way to use the mlseeq function. In continuous operation mode, mlseeq can save its internal state information for use in a subsequent invocation and can initialize using previously stored state information. To choose continuous operation mode, use 'cont' as an input argument when invoking mlseeq.

Procedure for Continuous Operation Mode

The typical procedure for using continuous mode within a loop is as follows:

  1. Before the loop starts, create three empty matrix variables (for example, sm, ts, ti) that eventually store the state metrics, traceback states, and traceback inputs for the equalizer.

  2. Inside the loop, invoke mlseeq using a syntax like

    [y,sm,ts,ti] = mlseeq(x,chcoeffs,const,tblen,'cont',nsamp,sm,ts,ti);
    

    Using sm, ts, and ti as input arguments causes mlseeq to continue from where it finished in the previous iteration. Using sm, ts, and ti as output arguments causes mlseeq to update the state information at the end of the current iteration. In the first iteration, sm, ts, and ti start as empty matrices, so the first invocation of the mlseeq function initializes the metrics of all states to 0.

Delays in Continuous Operation Mode

Continuous operation mode with a traceback depth of tblen incurs an output delay of tblen symbols. This means that the first tblen output symbols are unrelated to the input signal, while the last tblen input symbols are unrelated to the output signal. For example, the command below uses a traceback depth of 3, and the first 3 output symbols are unrelated to the input signal of ones(1,10).

y = mlseeq(ones(1,10),1,[-7:2:7],3,'cont')
y =

    -7   -7   -7    1    1    1    1    1    1    1

Keeping track of delays from different portions of a communication system is important, especially if you compare signals to compute error rates. The example in Example: Continuous Operation Mode illustrates how to take the delay into account when computing an error rate.

Example: Continuous Operation Mode

The example below illustrates the procedure for using continuous operation mode within a loop. Because the example is long, this discussion presents it in multiple steps:

Initializing Variables.   The beginning of the example defines parameters, initializes the state variables sm, ts, and ti, and initializes variables that accumulate results from each iteration of the loop.

n = 200; % Number of symbols in each iteration
numiter = 25; % Number of iterations
M = 4; % Use 4-PSK modulation.
const = pskmod(0:M-1,M); % PSK constellation
chcoeffs = [1 ; 0.25]; % Channel coefficients
chanest = chcoeffs; % Channel estimate
tblen = 10; % Traceback depth for equalizer
nsamp = 1; % Number of input samples per symbol
sm = []; ts = []; ti = []; % Initialize equalizer data.
% Initialize cumulative results.
fullmodmsg = []; fullfiltmsg = []; fullrx = [];

Simulating the System Using a Loop.   The middle portion of the example is a loop that generates random data, modulates it using baseband PSK modulation, and filters it. Finally, mlseeq equalizes the filtered data. The loop also updates the variables that accumulate results from each iteration of the loop.

for jj = 1:numiter
   msg = randint(n,1,M); % Random signal vector
   modmsg = pskmod(msg,M); % PSK-modulated signal
   filtmsg = filter(chcoeffs,1,modmsg); % Filtered signal

   % Equalize, initializing from where the last iteration
   % finished, and remembering final data for the next iteration.
   [rx sm ts ti] = mlseeq(filtmsg,chanest,const,tblen,...
      'cont',nsamp,sm,ts,ti);

   % Update vectors with cumulative results.
   fullmodmsg = [fullmodmsg; modmsg];
   fullfiltmsg = [fullfiltmsg; filtmsg];
   fullrx = [fullrx; rx];
end

Computing an Error Rate and Plotting Results.  

The last portion of the example computes the symbol error rate from all iterations of the loop. The symerr function compares selected portions of the received and transmitted signals, not the entire signals. Because continuous operation mode incurs a delay whose length in samples is the traceback depth (tblen) of the equalizer, it is necessary to exclude the first tblen samples from the received signal and the last tblen samples from the transmitted signal. Excluding samples that represent the delay of the equalizer ensures that the symbol error rate calculation compares samples from the received and transmitted signals that are meaningful and that truly correspond to each other.

The example also plots the signal before and after equalization in a scatter plot. The points in the equalized signal coincide with the points of the ideal signal constellation for 4-PSK.

% Compute total number of symbol errors. Take the delay into account.
numsymerrs = symerr(fullrx(tblen+1:end),fullmodmsg(1:end-tblen))

% Plot signal before and after equalization.
h = scatterplot(fullfiltmsg); hold on;
scatterplot(fullrx,1,0,'r*',h);
legend('Filtered signal before equalization','Equalized signal',...
   'Location','NorthOutside');
hold off;

The output and plot follow.

numsymerrs =

     0

Using a Preamble or Postamble

Some systems include a sequence of known symbols at the beginning or end of a set of data. The known sequence at the beginning or end is called a preamble or postamble, respectively. The mlseeq function can accommodate a preamble and postamble that are already incorporated into its input signal. When you invoke the function, you specify the preamble and postamble as integer vectors that represent the sequence of known symbols by indexing into the signal constellation vector. For example, a preamble vector of [1 4 4] and a 4-PSK signal constellation of [1 j -1 -j] indicate that the modulated signal begins with [1 -j -j].

If your system uses a preamble without a postamble, use a postamble vector of [] when invoking mlseeq. Similarly, if your system uses a postamble without a preamble, use a preamble vector of [].

Example: Using a Preamble

The example below illustrates how to accommodate a preamble when using mlseeq. The same preamble symbols appear at the beginning of the message vector and in the syntax for mlseeq. If you want to use a postamble, you can append it to the message vector and also include it as the last input argument for mlseeq. In this example, however, the postamble input in the mlseeq syntax is an empty vector because the system uses no postamble.

M = 4; % Use 4-PSK modulation.
const = pskmod(0:3,4); % PSK constellation
tblen = 16; % Traceback depth for equalizer

preamble = [3; 1]; % Expected preamble, as integers
msgIdx = randint(98,1,M); % Random symbols
msgIdx = [preamble; msgIdx]; % Include preamble at the beginning.
msg = pskmod(msgIdx,M); % Modulated message
chcoeffs = [.623; .489+.234i; .398i; .21]; % Channel coefficients
chanest = chcoeffs; % Channel estimate
filtmsg = filter(chcoeffs,1,msg); % Introduce channel distortion.
d = mlseeq(filtmsg,chanest,const,tblen,'rst',1,preamble,[]);

[nsymerrs ser] = symerr(msg,d) % Symbol error rate

The output is below.

nsymerrs =

     0


ser =

     0
  


Free Early Verification Kit

Learn how to apply early verification to your development process through these technical resources.

How much time do you spend on testing to ensure implementation meets system-level requirements?

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS