DSPRelated.com
Forums

cutoff frequency of a FIR Filter

Started by dnb September 23, 2004
On 23 Sep 2004 19:31:47 -0700, dbhat2@yahoo.com (dnb) wrote:

>Thanks for the reply! >I should restate my question - I hope it makes sense. I have a low >pass >FIR filter with transfer function whose coefficients are functions >of the sample size N. The function is: > >H(z,N) = J. sigma_k{k=0,1,...(N-1)} [ (k-1). z^{k-N} ] > >where J is a constant. Is it possible to determine/express the >bandwidth/cut-off frequency of the low-pass filter in terms of N? > >Thanks, >Dinkar. >
Hi, At first I thought this might be a homework problem. But now I don't think so because it's doubtful that a textbook, or professor, would pose a question with such "scrambled" notation. My guess is that the answer to your question is: No. First, you haven't defined at all what you mean by "cutoff frequency". Can you state, exactly, what that phrase means? In any case, I don't think there's a closed-form equation that computes a cutoff frequency (a single value measured in radians/second.) Any math expression that tries to describe a cutoff frequency would, it seems to me, have to use the discrete Fourier transform equation in some manner. That's my two cents. [-Rick-]
Fred and all,

Thanks for the replies.
The exact transfer function should be:
             N-1
H(z,N) = J * sum {(2k - N +1)*z^(k-N)}
             k=0

Just as you did, for N=4, the coefficients work out to be:

H(z,4) = J*[ (-3)(z^-4) + (-1).(z^-3) + (1).(z^-2) + 3.(z^-3)]

There is no z^0 term in it. But if I assume that it is a *low-pass*
filter, then I assume the transition bandwidth would be equal or
proportional to 1/N.

Thanks
Dinkar
 


Thanks for the replies. 
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<K8KdnbvJL8nXoc7cRVn-oA@centurytel.net>...
> "dnb" <dbhat2@yahoo.com> wrote in message > news:fa0deac8.0409230739.1b0b14dc@posting.google.com... > > Hi, > > > > I have learnt some amount of DSP recently by reading a few artickes > > (and using this newsgroup). I had a question regarding cut-off > > frequency. > > > > Given an FIR Filter with Transfer function: > > > > H(z,N) = J . sigma_k={0...N-1} (z^{k-N}[k -1 ]) > > > > where J is a constant, is it possible to get a relation for the cutoff > > frequency in terms of N (in closed form)? In general, how does one > > determine the cutoff frequency of a FIR filter? > > > > Dinkar, > > I'm not sure about your notation. Did you mean: > N-1 > H(z,N) = J*sum {(k-1)*z^(k-N)] > k=0 > > so that H(z,4) would be: > 3 > J*sum{(k-1)*z^(k-4) = J*(-z^-4 + z^-2 + 2*z^-1) where J is a constant > 0 > > ????? (note that z^-3 has a zero coefficient) > > Normally there is a z^0 term which only represents a unit delay difference > from the above. > > Shifting one delay and reversing the order of the expression and without > bothering with the scale factor the above becomes: > > H(z) = 2*z^0 + z^-1 - z^-3 > > This makes me think that you meant something slightly different: > > N > J*sum{(k)*z^[k-N)]} = J*(-z^-3 + 2*z^-2 + 3*z^-1 + 4*z^0) where J is a > constant > k=1 > > So the filter coefficients are: [4 3 2 1] for N=4 and [5 4 3 2 1] for N=5, > etc. > > Either way, these coefficient sequences aren't generally low pass filters - > although some cases could look like a lowpass in some sense. > > One thing one can say is that if all the coefficients are positive, then the > highest gain will occur at zero frequency - because the gain at zero > frequency is the sum of the coefficients. The output of a filter with real > coefficients can never be greater than the sum of the magnitudes of the > coefficients - thus, if all the coefficients are positive, can never be > greater than the sum of the coefficients which met at zero frequency (and > possibly other frequencies depending on if the temporal sequence of > coefficients has periodic zeros in it. > > You cannot state the "cutoff frequency" of a FIR filter because you cannot > assume it is a lowpass filter. If you state "a priori" that it *is* a > lowpass filter then you can estimate its transition band width being the > reciprocal of the length of the filter. > > Because a lowpass filter impulse response resembles a sinc function, you > might estimate the bandwith from the distance between zeros in the tails of > the impulse response. > > Fred
It is not a hw question - I have long since graduated and finished
with college forever. However, unfortunately now, DSP was not included.

I have a transfer function that represents a smoothed linear fit
to a data sample of size N. Because of this I assumed it is a 
low-pass filter. By "cut-off", I assumed it is the frequency at
which a low-pass filter will start attentuating the input. I thought
we can express that frequency (and hence the bandwidth) as a function
of N.

But it looks like it cannot be done. 

So thanks

r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message news:<4153ee62.728900078@news.sf.sbcglobal.net>...
> On 23 Sep 2004 19:31:47 -0700, dbhat2@yahoo.com (dnb) wrote: > > >Thanks for the reply! > >I should restate my question - I hope it makes sense. I have a low > >pass > >FIR filter with transfer function whose coefficients are functions > >of the sample size N. The function is: > > > >H(z,N) = J. sigma_k{k=0,1,...(N-1)} [ (k-1). z^{k-N} ] > > > >where J is a constant. Is it possible to determine/express the > >bandwidth/cut-off frequency of the low-pass filter in terms of N? > > > >Thanks, > >Dinkar. > > > Hi, > > At first I thought this might be a > homework problem. But now I don't think > so because it's doubtful that a textbook, > or professor, would pose a question with > such "scrambled" notation. > > My guess is that the answer to your > question is: No. > > First, you haven't defined at all what you > mean by "cutoff frequency". > Can you state, exactly, what that phrase > means? In any case, I don't think there's > a closed-form equation that computes a > cutoff frequency (a single value measured in > radians/second.) Any math expression that > tries to describe a cutoff frequency would, > it seems to me, have to use the discrete > Fourier transform equation in some manner. > > That's my two cents. > [-Rick-]

dnb wrote:

> It is not a hw question - I have long since graduated and finished > with college forever. However, unfortunately now, DSP was not included.
> I have a transfer function that represents a smoothed linear fit > to a data sample of size N. Because of this I assumed it is a > low-pass filter. By "cut-off", I assumed it is the frequency at > which a low-pass filter will start attentuating the input. I thought > we can express that frequency (and hence the bandwidth) as a function > of N.
Well, a sharper filter tends to need more taps (larger N). Cutoff tends to be where the response is down by some small factor relative to the pass band, where the factor might be 2 or e. With restrictions on the filter response, there will be restrictions on the cutoff frequency for small N, but I don't believe the restrictions are simple to describe. For a simple FIR filter, as I believe you are describing, I believe the minimum N is such that the sampling rate divided by the cutoff frequency is O(N), so O(N) taps would be required. -- glen
"dnb" <dbhat2@yahoo.com> wrote in message 
news:fa0deac8.0409241140.270a1b3b@posting.google.com...
> Fred and all, > > Thanks for the replies. > The exact transfer function should be: > N-1 > H(z,N) = J * sum {(2k - N +1)*z^(k-N)} > k=0 > > Just as you did, for N=4, the coefficients work out to be: > > H(z,4) = J*[ (-3)(z^-4) + (-1).(z^-3) + (1).(z^-2) + 3.(z^-3)] > > There is no z^0 term in it. But if I assume that it is a *low-pass* > filter, then I assume the transition bandwidth would be equal or > proportional to 1/N. >
Well, it looks more like a differentiator and is surely *not* a lowpass filter because the sum of the coefficients is zero = H(0) Fred
Thank you all for your response.

Dinkar,.

"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<9uednbc5QqsYMsncRVn-jw@centurytel.net>...
> "dnb" <dbhat2@yahoo.com> wrote in message > news:fa0deac8.0409241140.270a1b3b@posting.google.com... > > Fred and all, > > > > Thanks for the replies. > > The exact transfer function should be: > > N-1 > > H(z,N) = J * sum {(2k - N +1)*z^(k-N)} > > k=0 > > > > Just as you did, for N=4, the coefficients work out to be: > > > > H(z,4) = J*[ (-3)(z^-4) + (-1).(z^-3) + (1).(z^-2) + 3.(z^-3)] > > > > There is no z^0 term in it. But if I assume that it is a *low-pass* > > filter, then I assume the transition bandwidth would be equal or > > proportional to 1/N. > > > > Well, it looks more like a differentiator and is surely *not* a lowpass > filter because the sum of the coefficients is zero = H(0) > > Fred
On 24 Sep 2004 12:55:29 -0700, dbhat2@yahoo.com (dnb) wrote:

>It is not a hw question - I have long since graduated and finished >with college forever. However, unfortunately now, DSP was not included. > >I have a transfer function that represents a smoothed linear fit >to a data sample of size N. Because of this I assumed it is a >low-pass filter. By "cut-off", I assumed it is the frequency at >which a low-pass filter will start attentuating the input. I thought >we can express that frequency (and hence the bandwidth) as a function >of N. > >But it looks like it cannot be done. > >So thanks >
With the full realization that I didn't help you too much, I'll say "You're welcome". With analog filters, the "cutdoff frequency" usually means the frequency at which the filter's attenuation is 3 decibels below the filter's passband gain (of course, we'd have the define what the heck is meant by the phrase "filter's passband gain"). I've learned that the above definiation of "cutoff frequency" does *not* apply to digital filters. As far as I can tell, in digital filter language the "cutdoff frequency" usually means the highest frequency at which the filter's gain is equal to, or above, the minimum gain within the filter's passband. [-Rick-]
There is no cutoff frequency for the reasons that others have given 
however it is such a simple filter that (unusually) it is possible to 
give a closed form transfer function in the frequency domain.


For small numbers of terms you can simply collect terms about the 
central term and you can see the response is a phase shift of N/2
and the a series of sine terms eg. for N=5

H(z) = J*( (-4 z^-5 + 4 z^-1) + (-2.z^-4 + 2 z^-2))

H(z) = J*z^-3( 4( -z^-2 + z^2) + 2(z^-1+ z^1))

H(w) = exp(3jwT)(-8sinwT +4sinwT)

(I hate ascii maths and I may have made a mistake but the principle is 
clear)

As the impulse response is a ramp you could approximate the transfer 
function using the continuous fourier transform. Analytical methods for 
such a simple function are not difficult using integration by parts.
Actually it is a standard text book example.

That is very illustrative. With your example, I can generalize 
it to N. I would then like to understand the magnitude of
the transfer function...

Thanks
Dinkar.

Alan Johnson <alan.johnson@pyrrhic.co.uk> wrote in message 
news:<41588CD9.4070601@pyrrhic.co.uk>...
> There is no cutoff frequency for the reasons that others have given > however it is such a simple filter that (unusually) it is possible to > give a closed form transfer function in the frequency domain. > > > For small numbers of terms you can simply collect terms about the > central term and you can see the response is a phase shift of N/2 > and the a series of sine terms eg. for N=5 > > H(z) = J*( (-4 z^-5 + 4 z^-1) + (-2.z^-4 + 2 z^-2)) > > H(z) = J*z^-3( 4( -z^-2 + z^2) + 2(z^-1+ z^1)) > > H(w) = exp(3jwT)(-8sinwT +4sinwT) > > (I hate ascii maths and I may have made a mistake but the principle is > clear) > > As the impulse response is a ramp you could approximate the transfer > function using the continuous fourier transform. Analytical methods for > such a simple function are not difficult using integration by parts. > Actually it is a standard text book example.
As followup,
Along the lines mentioned below, I wrote the transfer function for
N=2*P +1 (N is odd) and substituted z = exp(jw). :
                                         P
H(w,P) = J(P). exp(-j*[P(w+1) - pi/2]).sigma(l.sin(lw)]
                                        l=1

where J(P) is independent fo w.
I plotted the magnitude function for several N, and as many of you
pointed out, it is not a low-pass filter and has no cut-off.

So, now what I am trying to do is given a measurement bandwidth
(bandwdith over which measurements are available), how would I relate
it to P which is the size of the filter?

Thanks all again 
Dinkar

Alan Johnson <alan.johnson@pyrrhic.co.uk> wrote in message news:<41588CD9.4070601@pyrrhic.co.uk>...
> There is no cutoff frequency for the reasons that others have given > however it is such a simple filter that (unusually) it is possible to > give a closed form transfer function in the frequency domain. > > > For small numbers of terms you can simply collect terms about the > central term and you can see the response is a phase shift of N/2 > and the a series of sine terms eg. for N=5 > > H(z) = J*( (-4 z^-5 + 4 z^-1) + (-2.z^-4 + 2 z^-2)) > > H(z) = J*z^-3( 4( -z^-2 + z^2) + 2(z^-1+ z^1)) > > H(w) = exp(3jwT)(-8sinwT +4sinwT) > > (I hate ascii maths and I may have made a mistake but the principle is > clear) > > As the impulse response is a ramp you could approximate the transfer > function using the continuous fourier transform. Analytical methods for > such a simple function are not difficult using integration by parts. > Actually it is a standard text book example.