Forums

DSP Riddle: Infinitely Narrow Notch Filter

Started by Andor May 19, 2006
"Tim Wescott" <tim@seemywebsite.com> wrote in message 
news:8KSdnUsGjuGof_DZnZ2dnUVZ_t6dnZ2d@web-ster.com...
> Andor wrote: > >> Folks, >> >> is it possible to construct a causal and realizable n-th order IIR >> filter, where n > 1 is an integer, which acts as an infinitely narrow >> notch filter? This filter must have frequency response >> >> H(w) = 1, for w =/= w0 >> = 0, for w == w0, >> >> for some arbitrary 0 < w0 < pi. >> >> Assume for the moment that the filter can be computed with infinite >> precision. >> >> Have a nice weekend! >> >> Regards, >> Andor >> > Yes, but it would take an infinite amount of time to verify that it worked > correctly.
..................................................> --
> > Tim Wescott
I agree with Tim and Jerry. For infinitely sharp edges you need infinitely long impulse / unit sample response. Here is a constructive method for thinking about it: I am speaking of discrete time / discrete frequency here. Start with an all-pass frequency domain sequence of all 1's. For ease of discussion, normalize as follows: Assume the sample interval is 1 second and the length of the filter is N samples/coefficients. The frequency interval between samples is 1/N. Now, set a pair of frequency domain samples to zero as follows: choose f0 per your specification choose fs for the sampling radian frequency find the index "k" of the frequency sequence that corresponds to f0<fs/2: the unnormalized frequency interval is fs/N f0 corresponds closest to the index k=ROUND[N*f0/fs] Set F(k)=0 and F(N-k+2)=0 ... (and you worry about whether this is OK for your index scheme starting at 1 or at zero).. Compute the IFFT of the new sequence. Notice that you can only define the filter response on a discrete set of frequencies spaced at fs/N. So, an infinitely narrow notch done this way must have infinite N. Or, if your "infinity" is sufficient with N=10,000 so be it. Also notice that the time domain filter that results has a spike or sample of amplitude 1.0 at time=0 *minus* a cosine at w0 of amplitude 2/N. It's that simple. So a perfect notch filter has an impulse response that is an impulse at time=0 minus a cosine at w0 of amplitude 2/(infinity). If your "infinity" is sufficient with N=10,000 then it would have amplitude 2/10,000. Clearly infinitely narrow notches take away infinitesimal energy! Interesting, eh? Fred
Al Clark wrote:

> Tim Wescott <tim@seemywebsite.com> wrote in > news:8KSdnUsGjuGof_DZnZ2dnUVZ_t6dnZ2d@web-ster.com: > > >>Andor wrote: >> >> >>>Folks, >>> >>>is it possible to construct a causal and realizable n-th order IIR >>>filter, where n > 1 is an integer, which acts as an infinitely narrow >>>notch filter? This filter must have frequency response >>> >>>H(w) = 1, for w =/= w0 >>> = 0, for w == w0, >>> >>>for some arbitrary 0 < w0 < pi. >>> >>>Assume for the moment that the filter can be computed with infinite >>>precision. >>> >>>Have a nice weekend! >>> >>>Regards, >>>Andor >>> >> >>Yes, but it would take an infinite amount of time to verify that it >>worked correctly. > > > Since BT >= 1, I agree with Tim that it would take an infinite amount of > time since as B=>0, T=>infinity, > > however, > > You make a notch filter by placing a zero on the unit circuit. To narrow > the bandwidth you place a pole at the same angle but with a radius less > than 1. As the pole gets closer to the unit circle, the bandwidth becomes > increasingly narrower, but not zero. If the pole was placed exactly on > the unit circle (which is sort of causal) , you would get perfect pole > zero cancellation, which doesn't yield the desired notch. > > I don't think a using higher order filter will change the result. > > So from a purely heuristic point of view, I don't think you can create > Andor's filter.
Depending on how you pass to the limit, the notch is either there or it isn't. This is an instance of the Generalized Duality Principle (Babinet's, not Heisenberg's), and it serves to prove that an infinitely narrow notch and no notch are one and the same. This observation isn't limited to notches; an infinitely thin hamburger is no hamburger at all. (Fortunate diners will at least get some sustenance from the roll.) Here's another way to look at it: as the notch gets narrower, the impulse response gets longer (the Q goes up). By the time the notch is infinitesimally wide, it would take forever to notice its effect. Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
So an infinitely-narrow spectrum is the same as no spectrum at all?
I.e.,
a sine wave has no energy? ...

--RY

Randy Yates wrote:

> So an infinitely-narrow spectrum is the same as no spectrum at all? > I.e., > a sine wave has no energy? ...
Did I say that? Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
I think you did.

--Randy

Jerry Avins <jya@ieee.org> wrote in news:-bmdnb3C7cUcofPZRVn-uQ@rcn.net:

> Al Clark wrote: > >> Tim Wescott <tim@seemywebsite.com> wrote in >> news:8KSdnUsGjuGof_DZnZ2dnUVZ_t6dnZ2d@web-ster.com: >> >> >>>Andor wrote: >>> >>> >>>>Folks, >>>> >>>>is it possible to construct a causal and realizable n-th order IIR >>>>filter, where n > 1 is an integer, which acts as an infinitely >>>>narrow notch filter? This filter must have frequency response >>>> >>>>H(w) = 1, for w =/= w0 >>>> = 0, for w == w0, >>>> >>>>for some arbitrary 0 < w0 < pi. >>>> >>>>Assume for the moment that the filter can be computed with infinite >>>>precision. >>>> >>>>Have a nice weekend! >>>> >>>>Regards, >>>>Andor >>>> >>> >>>Yes, but it would take an infinite amount of time to verify that it >>>worked correctly. >> >> >> Since BT >= 1, I agree with Tim that it would take an infinite amount >> of time since as B=>0, T=>infinity, >> >> however, >> >> You make a notch filter by placing a zero on the unit circuit. To >> narrow the bandwidth you place a pole at the same angle but with a >> radius less than 1. As the pole gets closer to the unit circle, the >> bandwidth becomes increasingly narrower, but not zero. If the pole >> was placed exactly on the unit circle (which is sort of causal) , you >> would get perfect pole zero cancellation, which doesn't yield the >> desired notch. >> >> I don't think a using higher order filter will change the result. >> >> So from a purely heuristic point of view, I don't think you can >> create Andor's filter. > > Depending on how you pass to the limit, the notch is either there or > it isn't. This is an instance of the Generalized Duality Principle > (Babinet's, not Heisenberg's), and it serves to prove that an > infinitely narrow notch and no notch are one and the same.
OK, I agree, but I'm not going to wait forever for a filter that doesn't even get rid of anything. I have enough of a problem waiting for my coffee each morning. -- Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com
Tim Wescott wrote:

> Andor wrote: > >> Folks, >> >> is it possible to construct a causal and realizable n-th order IIR >> filter, where n > 1 is an integer, which acts as an infinitely narrow >> notch filter? This filter must have frequency response >> >> H(w) = 1, for w =/= w0 >> = 0, for w == w0, >> >> for some arbitrary 0 < w0 < pi. >> >> Assume for the moment that the filter can be computed with infinite >> precision. >> >> Have a nice weekend! >> >> Regards, >> Andor >> > Yes, but it would take an infinite amount of time to verify that it > worked correctly. > > Practically, you could make a Kalman filter to detect your tone and > subtract it out -- that would be an IIR filter (just time varying), and > it would notch out the tone to the best of it's ability for any given time. > > But then practically you wouldn't have infinite precision. >
Actually you wouldn't have to make a real live Kalman filter -- just make a filter that narrows up at a speed known to be slower than a Kalman. So it wouldn't be as fast to settle as a Kalman. It would be half fast. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html
for a notch filter,

H(ejw) = 0
H(e-jw) = 0

zero at z = e+-jw

pole infinitely close to the zero
at z = a * e+-jw

where a -> 1, but a =/= 1

the filter transfer function would be

H(z) = (z - e^jw) * (z - e^-jw)
	-------------------------
       (z - a*e^jw) * (z - a*e^-jw)

	= z^2 - z * (2 cos w) + 1
	  --------------------------
	  z^2 - z * (2*a cos w) + a

This is a causal filter and can be realized using a direct form
realization if a -> 1 can be realized

As the filter can be computed with infinte precision, assuming that the
gainterm a -> 1 can be realized,
the filter is causal as well as realizable

but, a -> 1 can't be realized in reality, which is an altogether
different question

----------------------------------------------------------------------------------------

Q: Why didnt i join this group before?

Randy Yates wrote:

> I think you did. > > --Randy
I second that. By the analogy, infinitely thin but infinitely wide hamburger should indeed exist (at least in theory ;)) as well as there should exist a DC level or a sine wave. Although this has little to do with the riddle at hand. -- Jani Huhtanen Tampere University of Technology, Pori
Jerry Avins wrote:
> Randy Yates wrote: > > > So an infinitely-narrow spectrum is the same as no spectrum at all? > > I.e., > > a sine wave has no energy? ... > > Did I say that? > > Jerry
I don't think you did. You would need a sine wave of infinite duration for it to have infinitely narrow bandwidth. A sine wave turned on at 07h00 and turned of at 19h00 would have a spectrum dependent on how it was turned on and off, but it could not be infinitely narrow or not even 1/43200 Hz narrow ! Rocky