DSPRelated.com
Forums

Tunable FIR filter spectral nulls?

Started by JS April 1, 2005
All,

Looking for any help here from my DSP cronies.  I am analyzing a method
of filtering a periodic pulsed sinusoid signal with a bandpass FIR
filter and have hit a stumbling block!  As you know, the spectrum of
the pulsed periodic sinusoid results in line spectra based on the pulse
length (PW) and repetition rate (PRF).  The line spectra are separated
in the freq. domain by the PRF rate.

Ok, now what I want to do is design a bandpass filter around the
carrier frequency (which is the largest spectral line) and have the
nulls in the FIR filter stopband match up with the PRF freq. so they
automatically notch out all the line spectra except for the carrier.
We all know FIR filters have periodic nulls in the stopband
proportional to the number of zeros in the filter.

This brings me to the problem:  I have been trying to come with a
closed-form solution for the location of the inherent spectral nulls of
a linear-phase windowed FIR filter (based on cutoff freq. and filter
length).  I started with the freq. response of a Type I zero-phase
(ignoring linear phase for now since it doesnt effect mag response)
lowpass FIR, which has a real-valued freq response:

H(e^jw) = h[0] + 2*sum(n=1 to L){ h[n]*cos(w*n) }

And for a zero-phase lowpass prototype using the windowed method:

h[n] = sin(wc*T*n)/(pi*n)  n = -L to L
and of course h[n] = h[-n]

so that,

H(e^jw) = (wc*T)/pi + 2/pi * sum(n=1 to L){ 1/n * sin(wc*T*n) *
cos(w*n) }

And since this is real-valued the mag response | H(e^jw) | = H(e^jw)

ok, then I figured well let's try and find where the mag response hits
zero:

|H(e^jw)| = 0  --->   -(wc*T)/2 = sum(n=-L to L){
1/n*sin(wc*T*n)*cos(w*n) }

Basically I am looking to solve for w that meets:

-(wc*T)/2 = sin(wc*T)*cos(w) + sin(2wc*T)cos(2w) + ... +
sin(L*wc*T)cos(Lw)

or,

-h[0] = h[1]*cos(w) + h[2]*cos(2w) + h[3]*cos(3w) + ... + h[L]*cos(Lw)

Am I stuck with just doing a spectral search for zeros, or does someone
have any idea on how to solve for w in closed-form?  It doesnt appear
possible to me.  I think I have to take a step back.  Someone show me
the error of my ways!  LOL

Heck, I can easily compute the spectrum and search for the nulls, then
tweak the length and do this again and again.  But I was looking for
something a bit more elegant.

I then considered figuring out all the zeros of the filter's TF, but
then again that doesnt solve the problem.  I would still need to relate
the position of the zeros spaced around the unit circle to my desired
null freqs - this would entail some search alg to converge to an
answer.

Next I thought well maybe I could design a FIR comb filter with a
fractional delay so the nulls match up with my PRF.  Not sure how that
would work, as I would have to center it around my desired carrier
freq. and then line up the comb notches.

Does anyone have input on how to proceed?  Any help is appreciated!

Regards,
Jim Shima

JS wrote:
> All, > > Looking for any help here from my DSP cronies. I am analyzing a method > of filtering a periodic pulsed sinusoid signal with a bandpass FIR > filter and have hit a stumbling block! As you know, the spectrum of > the pulsed periodic sinusoid results in line spectra based on the pulse > length (PW) and repetition rate (PRF). The line spectra are separated > in the freq. domain by the PRF rate.
And they carry all the information about the PRF.
> Ok, now what I want to do is design a bandpass filter around the > carrier frequency (which is the largest spectral line) and have the > nulls in the FIR filter stopband match up with the PRF freq. so they > automatically notch out all the line spectra except for the carrier.
So you end up with a contuous sine. I don't think you want that.
> We all know FIR filters have periodic nulls in the stopband > proportional to the number of zeros in the filter.
[technical futility snipped]
> ... I think I have to take a step back. Someone show me > the error of my ways! LOL
I think I did, Jim. It's my guess that you're on to something that might almost -- but never quite -- work. Like the drayman who mixed sawdust into his horse's feed, but was never able to reach 100% before the horse died. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Hey Jerry,

Yes, I do want the continuous sine left over.  This is for an analysis
tool I am looking at, where I need to suppress the line spectra in
order to search for other spectral lines not due to the pulsed
sinusoid.  Plus I found the idea intriguing.  :)

At any rate, the germ of the idea came from radar s-parameter
measurement technique.  There is an agilent paper here:

http://www.home.agilent.com/upload/cmc_upload/All/Advances_in_pulsed_RF_sparameter04.pdf
that outlines the crux of the idea starting on page 23.

Anyway, of course they talk about doing this spectral nulling with FIR
filters but hand wave over all of the details.  I found it interesting
on how to accomplish this, as I can think of several other
applications.

Again, it may turn out to be some non-optimal trial and error routine
but I thought I would get some insight here into the viability of the
method - particularly since I was unable to converge to any sort of
elegant solution.

Jim

"JS" <jshima@timing.com> wrote in message 
news:1112400432.898232.182210@l41g2000cwc.googlegroups.com...
> Hey Jerry, > > Yes, I do want the continuous sine left over. This is for an analysis > tool I am looking at, where I need to suppress the line spectra in > order to search for other spectral lines not due to the pulsed > sinusoid. Plus I found the idea intriguing. :) > > At any rate, the germ of the idea came from radar s-parameter > measurement technique. There is an agilent paper here: > > http://www.home.agilent.com/upload/cmc_upload/All/Advances_in_pulsed_RF_sparameter04.pdf > that outlines the crux of the idea starting on page 23. > > Anyway, of course they talk about doing this spectral nulling with FIR > filters but hand wave over all of the details. I found it interesting > on how to accomplish this, as I can think of several other > applications. > > Again, it may turn out to be some non-optimal trial and error routine > but I thought I would get some insight here into the viability of the > method - particularly since I was unable to converge to any sort of > elegant solution. > > Jim
If I understand what you want, here may be a way to get there: First, let me say that the idea that FIR filters have periodic zeros in the stop band is *not* at all usualy or necessary. Here I emphasize the word "periodic" which means equidistant. But, there is a way to get equidistant zeros in the stop band. To do this, we depart from the time-honored method of approximating the desired filter response with cosines and sines in frequency. Instead, we replace the cosines and sines with a family of shifted Dirichlet kernels. If you examine a Dirichlet kernel carefully you can figure out that it is just a sum of sines and cosines anyway - so we really aren't doing anything very earth-shattering here. What is the periodicity of the Dirichlet kernel in frequency? It is directly related to the length of the temporal epoch that is chosen. Just like the periodicity of the kernel in time is directly related to the bandwidth of a perfect lowpass filter. So, to get the filter you want, you can select the length of the temporal epoch to have a relationship to the frequencies upon which you want to force zeros. Another way to say this is that the zeros are spaced the same as the frequency samples which are spaced by the reciprocal 1/T of the temporal epoch T. Now what you do is force all of the Dirichlet kernels in the stop band to be zero-valued and you adjust the passband ripple using the values / coefficients of the non-zero Dirichlet kernels (in the passband). This can be done with the Remez exchange algorithm using a limited number of basis functions over the frequency range and allowing for the zeros that occur. There is another way: In this method you use the full set of shifted Dirichlet kernels for the filter approximation. However, you don't worry so much about T and 1/T. Instead, you use a modified Remez exchange algorithm that allows equality constraints and you *force* periodic zeros in the frequency response as desired. The end result is a filter response that is minimax everywhere subject to the zeros being specified. For every zero that you force, you lose one degree of freedom in the minimax solution - that makes sense doesn't it? And, for every zero that you force, the sign alternation property of the error, normally expected. loses one alternation so the error looks like this: + - + - 0 - + - + It's not a "closed form" solution but it is sure how we design filters with the help of a computer. Is it tunable? Not really. You can always design multiple filters for different zero locations. Fred
JS wrote:
> Hey Jerry, > > Yes, I do want the continuous sine left over. This is for an analysis > tool I am looking at, where I need to suppress the line spectra in > order to search for other spectral lines not due to the pulsed > sinusoid. Plus I found the idea intriguing. :)
As usual, I didn't understand the problem but thought I did, and so spouted foolishness. It surprised me that you should have wanted what I thought you did; I should have known better.
> At any rate, the germ of the idea came from radar s-parameter > measurement technique. There is an agilent paper here: > > http://www.home.agilent.com/upload/cmc_upload/All/Advances_in_pulsed_RF_sparameter04.pdf > that outlines the crux of the idea starting on page 23. > > Anyway, of course they talk about doing this spectral nulling with FIR > filters but hand wave over all of the details. I found it interesting > on how to accomplish this, as I can think of several other > applications. > > Again, it may turn out to be some non-optimal trial and error routine > but I thought I would get some insight here into the viability of the > method - particularly since I was unable to converge to any sort of > elegant solution.
I haven't time to think about it now. Hot coffee and a companion await. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
JS wrote:
> All, > > Looking for any help here from my DSP cronies. I am analyzing a
method
> of filtering a periodic pulsed sinusoid signal with a bandpass FIR > filter and have hit a stumbling block! As you know, the spectrum of > the pulsed periodic sinusoid results in line spectra based on the
pulse
> length (PW) and repetition rate (PRF). The line spectra are
separated
> in the freq. domain by the PRF rate. > > Ok, now what I want to do is design a bandpass filter around the > carrier frequency (which is the largest spectral line) and have the > nulls in the FIR filter stopband match up with the PRF freq. so they > automatically notch out all the line spectra except for the carrier. > We all know FIR filters have periodic nulls in the stopband > proportional to the number of zeros in the filter.
No, we don't! The "usual" FIR filters, based on the windowed truncated sinc impulse response do, but no one forces each and every FIR filter to be on that particular form.
> This brings me to the problem: I have been trying to come with a > closed-form solution for the location of the inherent spectral nulls
of
> a linear-phase windowed FIR filter (based on cutoff freq. and filter > length).
I am not quite sure what you try to achieve: Do you want to use one of the "standard" windowed FIR filter forms and tweak the nulls to where you want them to go? Or do you want to filter out certain lines, regardless of what "analytic" form the FIR filter is? The statement of the problem is important here. If you KNOW where the "bad" spectral lines are, it is in principle no problem to design a FIR filter that cancel them. In practice, you might not know exactly where the lines are, or there may be conditions to ringing or other side effects that complicate matters. So my suggestion would be that you contemplate the scope of your problem once more, and decide what's important: Reject the spurious spectral lines, or stay with the windowed FIR filters. These requirements might contradict each other in practice. Rune
Rune Allnor wrote:

> So my suggestion would be that you contemplate the scope of your > problem once more, and decide what's important: Reject the spurious > spectral lines, or stay with the windowed FIR filters. These > requirements might contradict each other in practice.
Yup! Using a window function on an impulse response will mean convolving the Fourier Transform of the window function with that of the impulse response. This means that, if the impulse response had spectral zeros in particular places BEFORE windowing, it almost certainly won't afterwards. Ciao, Peter K.
Hi, Jim,

A quick suggestion. Have you looked into a generalized sidelobe 
cancellers or linearly constrained minimum-variance filter?

If you know the carrier frequency and want to reject all other known 
spectral lines, then it appears you can use the GSC technique.

Kesh

JS wrote:
> All, > > Looking for any help here from my DSP cronies. I am analyzing a method > of filtering a periodic pulsed sinusoid signal with a bandpass FIR > filter and have hit a stumbling block! As you know, the spectrum of > the pulsed periodic sinusoid results in line spectra based on the pulse > length (PW) and repetition rate (PRF). The line spectra are separated > in the freq. domain by the PRF rate. > > Ok, now what I want to do is design a bandpass filter around the > carrier frequency (which is the largest spectral line) and have the > nulls in the FIR filter stopband match up with the PRF freq. so they > automatically notch out all the line spectra except for the carrier. > We all know FIR filters have periodic nulls in the stopband > proportional to the number of zeros in the filter. > > This brings me to the problem: I have been trying to come with a > closed-form solution for the location of the inherent spectral nulls of > a linear-phase windowed FIR filter (based on cutoff freq. and filter > length). I started with the freq. response of a Type I zero-phase > (ignoring linear phase for now since it doesnt effect mag response) > lowpass FIR, which has a real-valued freq response: > > H(e^jw) = h[0] + 2*sum(n=1 to L){ h[n]*cos(w*n) } > > And for a zero-phase lowpass prototype using the windowed method: > > h[n] = sin(wc*T*n)/(pi*n) n = -L to L > and of course h[n] = h[-n] > > so that, > > H(e^jw) = (wc*T)/pi + 2/pi * sum(n=1 to L){ 1/n * sin(wc*T*n) * > cos(w*n) } > > And since this is real-valued the mag response | H(e^jw) | = H(e^jw) > > ok, then I figured well let's try and find where the mag response hits > zero: > > |H(e^jw)| = 0 ---> -(wc*T)/2 = sum(n=-L to L){ > 1/n*sin(wc*T*n)*cos(w*n) } > > Basically I am looking to solve for w that meets: > > -(wc*T)/2 = sin(wc*T)*cos(w) + sin(2wc*T)cos(2w) + ... + > sin(L*wc*T)cos(Lw) > > or, > > -h[0] = h[1]*cos(w) + h[2]*cos(2w) + h[3]*cos(3w) + ... + h[L]*cos(Lw) > > Am I stuck with just doing a spectral search for zeros, or does someone > have any idea on how to solve for w in closed-form? It doesnt appear > possible to me. I think I have to take a step back. Someone show me > the error of my ways! LOL > > Heck, I can easily compute the spectrum and search for the nulls, then > tweak the length and do this again and again. But I was looking for > something a bit more elegant. > > I then considered figuring out all the zeros of the filter's TF, but > then again that doesnt solve the problem. I would still need to relate > the position of the zeros spaced around the unit circle to my desired > null freqs - this would entail some search alg to converge to an > answer. > > Next I thought well maybe I could design a FIR comb filter with a > fractional delay so the nulls match up with my PRF. Not sure how that > would work, as I would have to center it around my desired carrier > freq. and then line up the comb notches. > > Does anyone have input on how to proceed? Any help is appreciated! > > Regards, > Jim Shima >
"Peter K." wrote:
> > Rune Allnor wrote: > > > So my suggestion would be that you contemplate the scope of your > > problem once more, and decide what's important: Reject the spurious > > spectral lines, or stay with the windowed FIR filters. These > > requirements might contradict each other in practice. > > Yup! Using a window function on an impulse response will mean > convolving the Fourier Transform of the window function with that of > the impulse response. This means that, if the impulse response had > spectral zeros in particular places BEFORE windowing, it almost > certainly won't afterwards.
The meteor (Stiglitz et al) filter design method allows the design of FIR filters with arbitrary nulls in the stop band. Search Google for "Meteor" and "FIR design". Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "Software is largely a service industry operating under the persistent but unfounded delusion that it is a manufacturing industry." -- Eric S. Raymond