Main Content

equalize

(To be removed) Equalize signal using equalizer object

equalize will be removed in a future release. Use comm.LinearEqualizer or comm.DecisionFeedback instead.

Syntax

y = equalize(eqobj,x)
y = equalize(eqobj,x,trainsig)
[y,yd] = equalize(...)
[y,yd,e] = equalize(...)

Description

y = equalize(eqobj,x) processes the baseband signal vector x with equalizer object eqobj and returns the equalized signal vector y. At the end of the process, eqobj contains updated state information such as equalizer weight values and input buffer values. To construct eqobj, use the lineareq or dfe function. The equalize function assumes that the signal x is sampled at nsamp samples per symbol, where nsamp is the value of the nSampPerSym property of eqobj. For adaptive algorithms other than CMA, the equalizer adapts in decision-directed mode using a detector specified by the SigConst property of eqobj. The delay of the equalizer is (eqobj.RefTap-1)/eqobj.nSampPerSym.

Note that (eqobj.RefTap-1) must be an integer multiple of nSampPerSym. For a fractionally-spaced equalizer, the taps are spaced at fractions of a symbol period. The reference tap pertains to training symbols, and thus, must coincide with a whole number of symbols (i.e., an integer number of samples per symbol). eqobj.RefTap=1 corresponds to the first symbol, eqobj.RefTap=nSampPerSym+1 to the second, and so on. Therefore (eqobj.RefTap-1) must be an integer multiple of nSampPerSym.

If eqobj.ResetBeforeFiltering is 0, equalize uses the existing state information in eqobj when starting the equalization operation. As a result, equalize(eqobj,[x1 x2]) is equivalent to [equalize(eqobj,x1) equalize(eqobj,x2)]. To reset eqobj manually, apply the reset function to eqobj.

If eqobj.ResetBeforeFiltering is 1, equalize resets eqobj before starting the equalization operation, overwriting any previous state information in eqobj.

y = equalize(eqobj,x,trainsig) initially uses a training sequence to adapt the equalizer. After processing the training sequence, the equalizer adapts in decision-directed mode. The vector length of trainsig must be less than or equal to length(x)-(eqobj.RefTap-1)/eqobj.nSampPerSym.

[y,yd] = equalize(...) returns the vector yd of detected data symbols.

[y,yd,e] = equalize(...) returns the result of the error calculation. For adaptive algorithms other than CMA, e is the vector of errors between y and the reference signal, where the reference signal consists of the training sequence or detected symbols.

Examples

collapse all

This example configures the recommended comm.LinearEqualizer System object™ and the legacy lineareq feature with comparable settings.

Initialize Variables and Supporting Objects

d = randi([0 3],1000,1);
x = pskmod(d,4,pi/4);
r = awgn(x,25);
sps = 2; %samples per symbol for oversampled cases
nTaps = 6;
txFilter = comm.RaisedCosineTransmitFilter('FilterSpanInSymbols',nTaps, ...
    'OutputSamplesPerSymbol',4);
rxFilter = comm.RaisedCosineReceiveFilter('FilterSpanInSymbols',nTaps, ...
    'InputSamplesPerSymbol',4,'DecimationFactor',2);
x2 = txFilter(x);
r2 = rxFilter(awgn(x2,25,0.5));
filterDelay = txFilter.FilterSpanInSymbols/2 + ...
    rxFilter.FilterSpanInSymbols/2; % Total filter delay in symbols

To compare the equalized output, plot the constellations using code such as:

% plot(yNew,'*')
% hold on
% plot(yOld,'o')
% hold off; legend('New Eq','Old Eq'); grid on

Use LMS Algorithm with Linear Equalizer

Configure lineareq and comm.LinearEqualizer objects with comparable settings. The LeakageFactor property has been removed from LMS algorithm. The comm.LinearEqualizer System object™ assumes that leakage factor is always 1.

eqOld = lineareq(5,lms(0.05),pskmod(0:3,4,pi/4))
eqOld =
  EqType: 'Linear Equalizer'
  AlgType: 'LMS'
  nWeights: 5
  nSampPerSym: 1
  RefTap: 1
  SigConst: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  StepSize: 0.0500
  LeakageFactor: 1
  Weights: [0 0 0 0 0]
  WeightInputs: [0 0 0 0 0]
  ResetBeforeFiltering: 1
  NumSamplesProcessed: 0
eqNew = comm.LinearEqualizer('NumTaps',5,'Algorithm','LMS','StepSize',0.05, ...
    'Constellation',pskmod(0:3,4,pi/4),'ReferenceTap',1)
eqNew = comm.LinearEqualizer with properties:
  Algorithm: 'LMS'
  NumTaps: 5
  StepSize: 0.0500
  Constellation: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  ReferenceTap: 1
  InputDelay: 0
  InputSamplesPerSymbol: 1
  TrainingFlagInputPort: false
  AdaptAfterTraining: true
  InitialWeightsSource: 'Auto'
  WeightUpdatePeriod: 1

Call the equalizers.

yOld = equalize(eqOld,r,x(1:100));
yNew = eqNew(r,x(1:100));

Use RLS Algorithm with Linear Equalizer

Configure lineareq and comm.LinearEqualizer objects with comparable settings.

eqOld = lineareq(5,rls(0.95),pskmod(0:3,4,pi/4))
eqOld =
  EqType: 'Linear Equalizer'
  AlgType: 'RLS'
  nWeights: 5
  nSampPerSym: 1
  RefTap: 1
  SigConst: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  InvCorrInit: 0.1000
  InvCorrMatrix: [5×5 double]
  Weights: [0 0 0 0 0]
  WeightInputs: [0 0 0 0 0]
  ResetBeforeFiltering: 1
  NumSamplesProcessed: 0
eqNew = comm.LinearEqualizer('NumTaps',5,'Algorithm','RLS', ...
    'ForgettingFactor',0.95,'Constellation',pskmod(0:3,4,pi/4),'ReferenceTap',1)
eqNew = comm.LinearEqualizer with properties:
  Algorithm: 'RLS'
  NumTaps: 5
  ForgettingFactor: 0.9500
  InitialInverseCorrelationMatrix: 0.1000
  Constellation: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  ReferenceTap: 1
  InputDelay: 0
  InputSamplesPerSymbol: 1
  TrainingFlagInputPort: false
  AdaptAfterTraining: true
  InitialWeightsSource: 'Auto'
  WeightUpdatePeriod: 1

Call the equalizers. When ResetBeforeFiltering is set to true, each call of the equalize object resets the equalizer. To get the equivalent behavior call reset after each call of the comm.LinearEqualizer object.

yOld1 = equalize(eqOld,r,x(1:100));
yOld2 = equalize(eqOld,r,x(1:100));

yNew1 = eqNew(r,x(1:100));
reset(eqNew)
yNew2 = eqNew(r,x(1:100));

Configure lineareq and comm.LinearEqualizer objects with comparable settings. For the comm.LinearEqualizer object, set the initial inverse correlation matrix to eye(5)*0.2.

eqOld = lineareq(5,rls(0.95),pskmod(0:3,4,pi/4))
eqOld =
  EqType: 'Linear Equalizer'
  AlgType: 'RLS'
  nWeights: 5
  nSampPerSym: 1
  RefTap: 1
  SigConst: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  InvCorrInit: 0.1000
  InvCorrMatrix: [5×5 double]
  Weights: [0 0 0 0 0]
  WeightInputs: [0 0 0 0 0]
  ResetBeforeFiltering: 1
  NumSamplesProcessed: 0
eqNew = comm.LinearEqualizer('NumTaps',5,'Algorithm','RLS', ...
    'ForgettingFactor',0.95,'Constellation',pskmod(0:3,4,pi/4),'ReferenceTap',1, ...
    'InitialInverseCorrelationMatrix',eye(5)*0.2)
eqNew = comm.LinearEqualizer with properties:
  Algorithm: 'RLS'
  NumTaps: 5
  ForgettingFactor: 0.9500
  InitialInverseCorrelationMatrix: [5×5 double]
  Constellation: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  ReferenceTap: 1
  InputDelay: 0
  InputSamplesPerSymbol: 1
  TrainingFlagInputPort: false
  AdaptAfterTraining: true
  InitialWeightsSource: 'Auto'
  WeightUpdatePeriod: 1

Call the equalizers. When ResetBeforeFiltering is set to true, each call of the equalize object resets the equalizer. To get the equivalent behavior call reset after each call of the comm.LinearEqualizer object.

yOld1 = equalize(eqOld,r,x(1:100));
yOld2 = equalize(eqOld,r,x(1:100));

yNew1 = eqNew(r,x(1:100));
reset(eqNew)
yNew2 = eqNew(r,x(1:100));

Use CMA Algorithm with Linear Equalizer

Configure lineareq and comm.LinearEqualizer objects with comparable settings. The LeakageFactor property has been removed from LMS algorithm. The comm.LinearEqualizer System object™ assumes that leakage factor is always 1.

eqOld = lineareq(5,cma(0.05),pskmod(0:3,4,pi/4))
eqOld =
  EqType: 'Linear Equalizer'
  AlgType: 'Constant Modulus'
  nWeights: 5
  nSampPerSym: 1
  SigConst: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  StepSize: 0.0500
  LeakageFactor: 1
  Weights: [1 0 0 0 0]
  WeightInputs: [0 0 0 0 0]
  ResetBeforeFiltering: 1
  NumSamplesProcessed: 0
eqNew = comm.LinearEqualizer('NumTaps',5,'Algorithm','CMA','StepSize',0.05, ...
    'Constellation',pskmod(0:3,4,pi/4),'ReferenceTap',1)
eqNew = comm.LinearEqualizer with properties:
  Algorithm: 'CMA'
  NumTaps: 5
  StepSize: 0.0500
  Constellation: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  ReferenceTap: 1
  InputSamplesPerSymbol: 1
  AdaptWeightsSource: 'Property'
  AdaptWeights: true
  InitialWeightsSource: 'Auto'
  WeightUpdatePeriod: 1

Call the equalizers.

yOld = equalize(eqOld,r);
yNew = eqNew(r);

Use Linear Equalizers Considering Signal Delays

Configure lineareq and comm.LinearEqualizer objects with comparable settings. The transmit and receive filters result in a signal delay between the transit and receive signals. Account for this delay by setting the RefTap property of the lineareq to a value close to the delay value in samples. Additionally, nWeights must be set to a value greater than RefTap.

eqOld = lineareq(filterDelay*sps+4,lms(0.01),pskmod(0:3,4,pi/4),sps);
eqOld.RefTap = filterDelay*sps+1 % Adjust to synchronize with delayed signal 
eqOld =
  EqType: 'Linear Equalizer'
  AlgType: 'LMS'
  nWeights: 16
  nSampPerSym: 2
  RefTap: 13
  SigConst: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  StepSize: 0.0100
  LeakageFactor: 1
  Weights: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
  WeightInputs: [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
  ResetBeforeFiltering: 1
  NumSamplesProcessed: 0

eqNew = comm.LinearEqualizer('NumTaps',16,'Algorithm','LMS','StepSize',0.01, ...
    'Constellation',pskmod(0:3,4,pi/4),'InputSamplesPerSymbol',sps, ...
    'ReferenceTap',filterDelay*sps+1,'InputDelay',0)
eqNew = comm.LinearEqualizer with properties:
  Algorithm: 'LMS'
  NumTaps: 16
  StepSize: 0.0100
  Constellation: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  ReferenceTap: 13
  InputDelay: 0
  InputSamplesPerSymbol: 2
  TrainingFlagInputPort: false
  AdaptAfterTraining: true
  InitialWeightsSource: 'Auto'
  WeightUpdatePeriod: 1

Call the equalizers. When ResetBeforeFiltering is set to true, each call of the equalize object resets the equalizer. To get the equivalent behavior call reset after each call of the comm.LinearEqualizer object.

yOld1 = equalize(eqOld,r,x(1:100));
yOld2 = equalize(eqOld,r,x(1:100));

yNew1 = eqNew(r,x(1:100));
reset(eqNew)
yNew2 = eqNew(r,x(1:100));

In the comm.LinearEqualizer object, InputDelay is used to synchronize with the delayed signal. NumTaps and ReferenceTap are independent of delay value. We can reduce the number of taps by utilizing the InputDelay to synchronize instead of reference tap. Reducing the number of taps also reduces equalizer self noise.

eqNew = comm.LinearEqualizer('NumTaps',11,'Algorithm','LMS','StepSize',0.01, ...
    'Constellation',pskmod(0:3,4,pi/4),'InputSamplesPerSymbol',sps, ...
    'ReferenceTap',6,'InputDelay',filterDelay*sps)
eqNew = comm.LinearEqualizer with properties:
  Algorithm: 'LMS'
  NumTaps: 11
  StepSize: 0.0100
  Constellation: [0.7071 + 0.7071i -0.7071 + 0.7071i -0.7071 - 0.7071i 0.7071 - 0.7071i]
  ReferenceTap: 6
  InputDelay: 12
  InputSamplesPerSymbol: 2
  TrainingFlagInputPort: false
  AdaptAfterTraining: true
  InitialWeightsSource: 'Auto'
  WeightUpdatePeriod: 1

yNew1 = eqNew(r2,x(1:100));
reset(eqNew)
yNew2 = eqNew(r2,x(1:100));

Compatibility Considerations

expand all

Warns starting in R2020a

Introduced before R2006a