# Adaptive Notch Filter - LMS Algorithm

Started by February 14, 2007
```Hi everyone,

I am working on a simple adaptive notch filter that will be used to cancel
one sinusoid.  Additionally, the filter coefficient is complex (I am
looking after the error envelope).  So what I have is one zero and one
pole.  The zero is fixed to the unit circle and the pole is very close to
the unit circle at the same angle as the zero.  The transfer function is:

H(z) = (1 - (1<w)*z^-1) / (1 - (p<w)*z^-1)

(1<w) can be read as 1 at an angle of w.  p is less than 1 and greater
than 0 and is used to keep the pole inside of the unit circle.

I want to use an adaptive algorithm to adjust only the angle of the zero
and pole (w).  Currently I am trying LMS and am not having any success.
Am I barking up the wrong tree trying to use LMS?  If not, could someone
describe how I should be adjusting w?

Zach

```
```
zrimkunas wrote:

> I am working on a simple adaptive notch filter that will be used to cancel
> one sinusoid.  Additionally, the filter coefficient is complex (I am
> looking after the error envelope).  So what I have is one zero and one
> pole.  The zero is fixed to the unit circle and the pole is very close to
> the unit circle at the same angle as the zero.  The transfer function is:
>
> H(z) = (1 - (1<w)*z^-1) / (1 - (p<w)*z^-1)
>
> (1<w) can be read as 1 at an angle of w.  p is less than 1 and greater
> than 0 and is used to keep the pole inside of the unit circle.
>
> I want to use an adaptive algorithm to adjust only the angle of the zero
> and pole (w).  Currently I am trying LMS and am not having any success.
> Am I barking up the wrong tree trying to use LMS?  If not, could someone
> describe how I should be adjusting w?
>

It converges to the single solution if the error surface is quadratic.
What is your criteria for convergence? I.e. what parameter are you
trying to minimize?

DSP and Mixed Signal Design Consultant

http://www.abvolt.com

```
```>
>
>zrimkunas wrote:
>
>> I am working on a simple adaptive notch filter that will be used to
cancel
>> one sinusoid.  Additionally, the filter coefficient is complex (I am
>> looking after the error envelope).  So what I have is one zero and one
>> pole.  The zero is fixed to the unit circle and the pole is very close
to
>> the unit circle at the same angle as the zero.  The transfer function
is:
>>
>> H(z) = (1 - (1<w)*z^-1) / (1 - (p<w)*z^-1)
>>
>> (1<w) can be read as 1 at an angle of w.  p is less than 1 and greater
>> than 0 and is used to keep the pole inside of the unit circle.
>>
>> I want to use an adaptive algorithm to adjust only the angle of the
zero
>> and pole (w).  Currently I am trying LMS and am not having any success.

>> Am I barking up the wrong tree trying to use LMS?  If not, could
someone
>> describe how I should be adjusting w?
>>
>
>It converges to the single solution if the error surface is quadratic.
>What is your criteria for convergence? I.e. what parameter are you
>trying to minimize?
>
>
>DSP and Mixed Signal Design Consultant
>
>http://www.abvolt.com
>
>
>
>
>

pure sine, I want the output of my system to be zero (or as close as
possible).  So if H(z) = y(z)/x(z) I am trying to minimize y(z).

The major problem that I am having is that I am trying to minimize y(z) by
adjusting only the angle of the pole and zero.  My initial attempt to
adjust the angle (w) was as follows:

w(n) = w(n-1) + step_size*x(n)*y(n)

This didn't work.  The pole and zero just move around the unit circle
without ever converging.

I suspect that my problem lies in step_size*x(n)*y(n).  However, I'm not
sure what is wrong with it.  Do you think that it is possible to adjust
only the angle using LMS, leaving the modulus fixed?

```
```On Feb 14, 10:57 pm, "zrimkunas" <zachary.rimku...@gmail.com> wrote:
> >zrimkunas wrote:
>
> >> I am working on a simple adaptive notch filter that will be used to
> cancel
> >> one sinusoid.  Additionally, the filter coefficient is complex (I am
> >> looking after the error envelope).  So what I have is one zero and one
> >> pole.  The zero is fixed to the unit circle and the pole is very close
> to
> >> the unit circle at the same angle as the zero.  The transfer function
> is:
>
> >> H(z) = (1 - (1<w)*z^-1) / (1 - (p<w)*z^-1)
>
> >> (1<w) can be read as 1 at an angle of w.  p is less than 1 and greater
> >> than 0 and is used to keep the pole inside of the unit circle.
>
> >> I want to use an adaptive algorithm to adjust only the angle of the
> zero
> >> and pole (w).  Currently I am trying LMS and am not having any success.
> >> Am I barking up the wrong tree trying to use LMS?  If not, could
> someone
> >> describe how I should be adjusting w?
>
> >It converges to the single solution if the error surface is quadratic.
> >What is your criteria for convergence? I.e. what parameter are you
> >trying to minimize?
>
>
> >DSP and Mixed Signal Design Consultant
>
> >http://www.abvolt.com
>
> pure sine, I want the output of my system to be zero (or as close as
> possible).  So if H(z) = y(z)/x(z) I am trying to minimize y(z).
>
> The major problem that I am having is that I am trying to minimize y(z) by
> adjusting only the angle of the pole and zero.  My initial attempt to
> adjust the angle (w) was as follows:
>
> w(n) = w(n-1) + step_size*x(n)*y(n)
>
> This didn't work.  The pole and zero just move around the unit circle
> without ever converging.
>
> I suspect that my problem lies in step_size*x(n)*y(n).  However, I'm not
> sure what is wrong with it.  Do you think that it is possible to adjust
> only the angle using LMS, leaving the modulus fixed?

Stearns, there is an example in Chapter 12 (p. 316) that describes
what you want. It gives the analysis of an adaptive notch filter that
can track the interfering sinusoid even if its frequency and phase
vary. You must provide the sinusoid to cancel as the filter's
reference input, but you can get zeros exactly where they need to be
to get zero gain at the sinusoid frequency with two adaptive taps.

Jason

```
```On Feb 15, 9:45 am, cincy...@gmail.com wrote:
> On Feb 14, 10:57 pm, "zrimkunas" <zachary.rimku...@gmail.com> wrote:
>
>
>
>
>
> > >zrimkunas wrote:
>
> > >> I am working on a simple adaptive notch filter that will be used to
> > cancel
> > >> one sinusoid.  Additionally, the filter coefficient is complex (I am
> > >> looking after the error envelope).  So what I have is one zero and one
> > >> pole.  The zero is fixed to the unit circle and the pole is very close
> > to
> > >> the unit circle at the same angle as the zero.  The transfer function
> > is:
>
> > >> H(z) = (1 - (1<w)*z^-1) / (1 - (p<w)*z^-1)
>
> > >> (1<w) can be read as 1 at an angle of w.  p is less than 1 and greater
> > >> than 0 and is used to keep the pole inside of the unit circle.
>
> > >> I want to use an adaptive algorithm to adjust only the angle of the
> > zero
> > >> and pole (w).  Currently I am trying LMS and am not having any success.
> > >> Am I barking up the wrong tree trying to use LMS?  If not, could
> > someone
> > >> describe how I should be adjusting w?
>
> > >You are adapting the filter by the stochastic gradient, right?
> > >It converges to the single solution if the error surface is quadratic.
> > >What is your criteria for convergence? I.e. what parameter are you
> > >trying to minimize?
>
>
> > >DSP and Mixed Signal Design Consultant
>
> > >http://www.abvolt.com
>
> > pure sine, I want the output of my system to be zero (or as close as
> > possible).  So if H(z) = y(z)/x(z) I am trying to minimize y(z).
>
> > The major problem that I am having is that I am trying to minimize y(z) by
> > adjusting only the angle of the pole and zero.  My initial attempt to
> > adjust the angle (w) was as follows:
>
> > w(n) = w(n-1) + step_size*x(n)*y(n)
>
> > This didn't work.  The pole and zero just move around the unit circle
> > without ever converging.
>
> > I suspect that my problem lies in step_size*x(n)*y(n).  However, I'm not
> > sure what is wrong with it.  Do you think that it is possible to adjust
> > only the angle using LMS, leaving the modulus fixed?
>
> Stearns, there is an example in Chapter 12 (p. 316) that describes
> what you want. It gives the analysis of an adaptive notch filter that
> can track the interfering sinusoid even if its frequency and phase
> vary. You must provide the sinusoid to cancel as the filter's
> reference input, but you can get zeros exactly where they need to be
> to get zero gain at the sinusoid frequency with two adaptive taps.
>
> Jason- Hide quoted text -
>
> - Show quoted text -

If it were me, I would use the adaptive line enhancer (ALE, page 354)
with no reference needed instead of the notch filter quoted here.
Then I would look a paper by Peter Clarkson describing the behavior of
the LMS algorithm with deterinistic signals.  That's if it were me.

Maurice Givens

```