signlms

(To be removed) Construct signed least mean square (LMS) adaptive algorithm object

signlms will be removed in a future release. Consider using comm.LinearEqualizer or comm.DecisionFeedback instead.

Syntax

alg = signlms(stepsize)
alg = signlms(stepsize,algtype)

Description

The signlms function creates an adaptive algorithm object that you can use with the lineareq function or dfe function to create an equalizer object. You can then use the equalizer object with the equalize function to equalize a signal. To learn more about the process for equalizing a signal, see Equalization.

alg = signlms(stepsize) constructs an adaptive algorithm object based on the signed least mean square (LMS) algorithm with a step size of stepsize.

alg = signlms(stepsize,algtype) constructs an adaptive algorithm object of type algtype from the family of signed LMS algorithms. The table below lists the possible values of algtype.

Value of algtypeType of Signed LMS Algorithm
'Sign LMS'Sign LMS (default)
'Signed Regressor LMS'Signed regressor LMS
'Sign Sign LMS'Sign-sign LMS

Properties

The table below describes the properties of the signed LMS adaptive algorithm object. To learn how to view or change the values of an adaptive algorithm object, see Equalization.

PropertyDescription
AlgTypeType of signed LMS algorithm, corresponding to the algtype input argument. You cannot change the value of this property after creating the object.
StepSizeLMS step size parameter, a nonnegative real number
LeakageFactorLMS leakage factor, a real number between 0 and 1. A value of 1 corresponds to a conventional weight update algorithm, while a value of 0 corresponds to a memoryless update algorithm.

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);
'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
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
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
InitialWeightsSource: 'Auto'
WeightUpdatePeriod: 1

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

Algorithms

Referring to the schematics presented in Equalization, define w as the vector of all weights wi and define u as the vector of all inputs ui. Based on the current set of weights, w, this adaptive algorithm creates the new set of weights given by

• (LeakageFactor) w + (StepSize) u*sgn(Re(e)), for sign LMS

• (LeakageFactor) w + (StepSize) sgn(Re(u)) Re(e), for signed regressor LMS

• (LeakageFactor) w + (StepSize) sgn(Re(u)) sgn(Re(e)), for sign-sign LMS

where the * operator denotes the complex conjugate and sgn denotes the signum function (sign in MATLAB® technical computing software).

Compatibility Considerations

expand all

Warns starting in R2020a

References

 Farhang-Boroujeny, B., Adaptive Filters: Theory and Applications, Chichester, England, John Wiley & Sons, 1998.

 Kurzweil, J., An Introduction to Digital Communications, New York, John Wiley & Sons, 2000.