## Documentation Center |

Equalize linearly modulated signal using Viterbi algorithm

`y = mlseeq(x,chcffs,const,tblen,opmode)y = mlseeq(x,chcffs,const,tblen,opmode,nsamp)y = mlseeq(...,'rst',nsamp,preamble,postamble)y = mlseeq(...,'cont',nsamp,...init_metric,init_states,init_inputs)[y,final_metric,final_states,final_inputs]
= ...mlseeq(...,'cont',...)`

`y = mlseeq(x,chcffs,const,tblen,opmode)` equalizes
the baseband signal vector

Value of opmode | Typical Usage |
---|---|

'rst' | Enables you to specify a
preamble and postamble that accompany your data. The function processes x independently
of data from any other invocations of this function. This mode incurs
no output delay. |

'cont' | Enables you to save the
equalizer's internal state information for use in a subsequent invocation
of this function. Repeated calls to this function are useful if your
data is partitioned into a series of smaller vectors that you process
within a loop, for example. This mode incurs an output delay of tblen symbols. |

`y = mlseeq(x,chcffs,const,tblen,opmode,nsamp)` specifies
the number of samples per symbol in

`y = mlseeq(...,'rst',nsamp,preamble,postamble)` specifies
the preamble and postamble that you expect to precede and follow,
respectively, the data in the input signal. The vectors

When the function applies the Viterbi algorithm, it initializes state metrics in a way that depends on whether you specify a preamble and/or postamble:

If the preamble is nonempty, the function decodes the preamble and assigns a metric of 0 to the decoded state. If the preamble does not decode to a unique state (that is, if the length of the preamble is less than the channel memory), the decoder assigns a metric of 0 to all states that can be represented by the preamble. The traceback path ends at one of the states represented by the preamble.

If the preamble is unspecified or empty, the decoder initializes the metrics of all states to 0.

If the postamble is nonempty, the traceback path begins at the smallest of all possible decoded states that are represented by the postamble.

If the postamble is unspecified or empty, the traceback path starts at the state with the smallest metric.

`y = mlseeq(...,'cont',nsamp,...init_metric,init_states,init_inputs)` causes
the equalizer to start with its state metrics, traceback states, and
traceback inputs specified by

Input Argument | Meaning | Matrix Size | Range of Values |
---|---|---|---|

init_metric | State metrics | 1 row, numStates columns | Real numbers |

init_states | Traceback states | numStates rows, tblen columns | Integers between 0 and numStates-1 |

init_inputs | Traceback inputs | numStates rows, tblen columns | Integers between 0 and M-1 |

`[y,final_metric,final_states,final_inputs]
= ...mlseeq(...,'cont',...)`
returns the normalized state metrics, traceback states, and traceback
inputs, respectively, at the end of the traceback decoding process.

The example below illustrates how to use reset operation mode on an upsampled signal.

% Use 2-PAM. M = 2; hMod = comm.PAMModulator(M); hDemod = comm.PAMDemodulator(M); hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)', ... 'SNR',5); const = step(hMod,(0:M-1)'); % PAM constellation tblen = 10; % Traceback depth for equalizer nsamp = 2; % Number of samples per symbol msgIdx = randi([0 M-1],1000,1); % Random bits msg = upsample(step(hMod,msgIdx),nsamp); % Modulated message chcoeffs = [.986; .845; .237; .12345+.31i]; % Channel coefficients chanest = chcoeffs; % Channel estimate hMLSEE = comm.MLSEEqualizer('TracebackDepth',tblen,... 'Channel',chanest, 'Constellation',const, 'SamplesPerSymbol', nsamp); filtmsg = filter(chcoeffs,1,msg); % Introduce channel distortion. msgRx = step(hChan,filtmsg); % Add Gaussian noise. msgEq = step(hMLSEE,msgRx); % Equalize. msgEqIdx = step(hDemod,msgEq); % Demodulate. %Calculate BER hErrorCalc = comm.ErrorRate; berVec = step(hErrorCalc, msgIdx, msgEqIdx); ber = berVec(1) nerrs = berVec(2)

The output is shown below. Your results might vary because this example uses random numbers.

nerrs = 1 ber = 0.0010

The example in Example: Continuous Operation Mode illustrates how
to use the final state and initial state arguments when invoking `mlseeq` repeatedly.

The example in Use a Preamble in MATLAB illustrates how to use a preamble.

[1] Proakis, John G., *Digital
Communications*, Fourth Edition, New York, McGraw-Hill,
2001.

[2] Steele, Raymond, Ed., *Mobile
Radio Communications*, Chichester, England, John Wiley
& Sons, 1996.

Was this topic helpful?