# Using Least Mean Squares equalizer

Started by August 15, 2014
```Hi all,

I am new to signal processing; In my application, I need to use an adaptive
LMS equalizer.
I have some doubts regarding that.

I can model my scenario as a signal x[n] passing through a channel with a
transfer function H(z) and output Y(z)=H(z)X(z)+N(z), where N(z) is an
additive noise (which can be filtered). Now I need to design an equalizer
so that the effect of H(z) can be nullified and I expect an output
Y1(z)=X(z)+N1(z), where N1(z) is a noise which can be filtered. Is it
possible to design an adaptive equalizer that could do the above said
function?

Also, when I tried some basic MATLAB simulations for an LMS filter, if the
channel response I assume is an IIR response, the filter coefficients seem
to diverge even with a very small step size 0.0001and a very long training
period 2^15. So does adaptive equalization work only for FIR channel
respones?

_____________________________
Posted through www.DSPRelated.com
```
```On Saturday, August 16, 2014 7:55:42 AM UTC+12, rsashwinkumar wrote:
> Hi all,
>
>
>
> I am new to signal processing; In my application, I need to use an adaptive
>
> LMS equalizer.
>
> I have some doubts regarding that.
>
>
>
> I can model my scenario as a signal x[n] passing through a channel with a
>
> transfer function H(z) and output Y(z)=H(z)X(z)+N(z), where N(z) is an
>
> additive noise (which can be filtered). Now I need to design an equalizer
>
> so that the effect of H(z) can be nullified and I expect an output
>
> Y1(z)=X(z)+N1(z), where N1(z) is a noise which can be filtered. Is it
>
> possible to design an adaptive equalizer that could do the above said
>
> function?
>
>
>
> Also, when I tried some basic MATLAB simulations for an LMS filter, if the
>
> channel response I assume is an IIR response, the filter coefficients seem
>
> to diverge even with a very small step size 0.0001and a very long training
>
> period 2^15. So does adaptive equalization work only for FIR channel
>
> respones?
>
>
>
>
>
>
>
> _____________________________
>
> Posted through www.DSPRelated.com

Ok just try it first on a known FIR system ex coefficients 1, -0.5 and see if it converges. Remember if you are equalizing that the inverse of the filter must be stable! So don't pick a non-min phase IIR filter or it won't work. There are way around this by introducing a delay in one of the paths but first things first.
```
```Try a trivial channel, h = [1 0 0 0].';
Then play around with eq length and target delay. Then change the channel a bit to h = [1 0.2 0 0].';

So small steps, man.
```
```On Saturday, August 16, 2014 11:49:14 AM UTC+12, julius wrote:
> Try a trivial channel, h = [1 0 0 0].';
>
> Then play around with eq length and target delay. Then change the channel a bit to h = [1 0.2 0 0].';
>
>
>
> So small steps, man.

The second example is unstable when inverted since its polynomial is z^2-2=0 or z=+/jsqrt(2).
```
```On Saturday, August 16, 2014 11:49:14 AM UTC+12, julius wrote:
> Try a trivial channel, h = [1 0 0 0].';
>
> Then play around with eq length and target delay. Then change the channel a bit to h = [1 0.2 0 0].';
>
>
>
> So small steps, man.

Oh - sorry, didn't see the decimal point - thats z^2-0.2 ok
```
```Hi,

it may be a good idea to look into John G. Proakis, "Digital
communications", chapter 11 "Adaptive equalization". The book is IMHO worth
buying as paper copy even in the electronic age.

As a rule of thumb, the equalizer is the inverse of the channel. An IIR
channel gives an FIR equalizer, because numerator becomes denominator and
vice versa.

For a first step, I'd build a non-adaptive equalizer. You can do this
quickly by putting delayed replicas of the received signal (corresponding
to the eq's FIR taps) into a matrix M as column vectors:

Then, solve least-squares against the training sequence b (also column
vector) for

: M*c ~ b:

: c = pinv(M)*b

c is then the vector of FIR filter coefficients. Plug it into 's "M*c"
to apply it to the signal.
Use this as sanity check for delays and number of taps. It's pure
zero-forcing so it may misbehave for channel nulls. You can add or
concatenate a noise term to the signals, also to manage the equalizer's
unwanted out-of-channel gain boost.

_____________________________
Posted through www.DSPRelated.com
```
```On Saturday, August 16, 2014 6:23:18 PM UTC+12, mnentwig wrote:
> Hi,
>
>
>
> it may be a good idea to look into John G. Proakis, "Digital
>
> communications", chapter 11 "Adaptive equalization". The book is IMHO worth
>
> buying as paper copy even in the electronic age.
>
>
>
> As a rule of thumb, the equalizer is the inverse of the channel. An IIR
>
> channel gives an FIR equalizer, because numerator becomes denominator and
>
> vice versa.
>
>
>
> For a first step, I'd build a non-adaptive equalizer. You can do this
>
> quickly by putting delayed replicas of the received signal (corresponding
>
> to the eq's FIR taps) into a matrix M as column vectors:
>
>
>
> Then, solve least-squares against the training sequence b (also column
>
> vector) for
>
>
>
> : M*c ~ b:
>
>
>
> : c = pinv(M)*b
>
>
>
> c is then the vector of FIR filter coefficients. Plug it into 's "M*c"
>
> to apply it to the signal.
>
> Use this as sanity check for delays and number of taps. It's pure
>
> zero-forcing so it may misbehave for channel nulls. You can add or
>
> concatenate a noise term to the signals, also to manage the equalizer's
>
Easier way is to pick a first order example

1-0.5z^-1

It's inverse is a convergent series

1,0.5,0.25.0.125...etc

```
```Thanks all!!

I found the mistake. The IIR response I assumed turned out to be
non-minimum phase.

_____________________________
Posted through www.DSPRelated.com
```
```On 8/18/14 8:15 AM, rsashwinkumar wrote:
> Thanks all!!
>
> I found the mistake. The IIR response I assumed turned out to be
> non-minimum phase.
>

i actually have to disagree with Hardy that LMS won't work to match a
non-min phase system.  it doesn't really matter.

for example, LMS are used to do loudspeaker feedback cancellation for
speaker phones.  that ain't no minimum-phase system.

i would suggest modifying it a little and use the Normalized LMS (NLMS)
adaptive filter so that the neither the adaptation speed nor the step
size are dependent on the loudness of the excitation signal.

--

r b-j                  rbj@audioimagination.com

"Imagination is more important than knowledge."

```
```On Tuesday, August 19, 2014 6:24:43 AM UTC+12, robert bristow-johnson wrote:
> On 8/18/14 8:15 AM, rsashwinkumar wrote:
>
> > Thanks all!!
>
> >
>
> > I found the mistake. The IIR response I assumed turned out to be
>
> > non-minimum phase.
>
> >
>
>
>
> i actually have to disagree with Hardy that LMS won't work to match a
>
> non-min phase system.  it doesn't really matter.
>
>
>
> for example, LMS are used to do loudspeaker feedback cancellation for
>
> speaker phones.  that ain't no minimum-phase system.
>
>
>
> i would suggest modifying it a little and use the Normalized LMS (NLMS)
>
> adaptive filter so that the neither the adaptation speed nor the step
>
> size are dependent on the loudness of the excitation signal.
>
>
>
>
>
> --
>
>
>
> r b-j                  rbj@audioimagination.com
>
>
>
> "Imagination is more important than knowledge."

It will only work if you introduce a time-delay in the primary path. What he is doing is inverting a transfer function which is impossible (divergent) if NMP. However, with a delay you are using the uncausal part going backwards in time (hard to explain with out maths) which is convergent. The delay makes it causal.
```