DSPRelated.com
Forums

Relation between delay in FIR filter and the cutoff frequency...

Started by ronycsdu October 7, 2009
I am new to digital filters. I am trying to understand them. I have gone
through the internet and found the design of a simple low pass filter. It
can be implemented digitally by an FIR filter (which is a simple averaging
filter). The example that I found is something like this:

Suppose x[n] is digital bit sequence. So the averaging filter (low pass)
would be:  0.5 * (x[n] + x[n-1]) where x[n-1] represents x[n] with 1 unit
of delay. Now another averaging filter ((low pass)) would be: 

0.25 * (x[n] + x[n-1] + x[n-2] + x[n-3])  ---> 4 units of delay used here

As you all know the most common term related to any filter (in the analog
domain) is the cutoff frequency. Now my question is: 

(1) What is the OR Is there any relation between the number of delays used
and the cutoff frequency? Meaning, if you increase/decrease the number of
delays, how will it affect the cutoff frequency of that filter?
(2) What is the OR Is there any relation between the co-efficient used and
the cutoff frequency? Meaning, if you increase/decrease the value of the
co-efficient, how will it affect the cutoff frequency of that filter?

Thank you.


On 7 Okt, 13:49, "ronycsdu" <ronyc...@yahoo.com> wrote:
> I am new to digital filters. I am trying to understand them. I have gone > through the internet and found the design of a simple low pass filter. It > can be implemented digitally by an FIR filter (which is a simple averaging > filter). The example that I found is something like this: > > Suppose x[n] is digital bit sequence. So the averaging filter (low pass) > would be: &#4294967295;0.5 * (x[n] + x[n-1]) where x[n-1] represents x[n] with 1 unit > of delay. Now another averaging filter ((low pass)) would be: > > 0.25 * (x[n] + x[n-1] + x[n-2] + x[n-3]) &#4294967295;---> 4 units of delay used here > > As you all know the most common term related to any filter (in the analog > domain) is the cutoff frequency. Now my question is: > > (1) What is the OR Is there any relation between the number of delays used > and the cutoff frequency? Meaning, if you increase/decrease the number of > delays, how will it affect the cutoff frequency of that filter?
There is no relation to the cut-off frequency, but there is a realtion between the bandwidth between passband and stop-band corner frequencies, and the number of coefficients: The narrower the bandwidth, the more coefficients are needed.
> (2) What is the OR Is there any relation between the co-efficient used and > the cutoff frequency? Meaning, if you increase/decrease the value of the > co-efficient, how will it affect the cutoff frequency of that filter?
The filter coefficients determine the characteristics of the filter. The general workflow during filter design goes more or less as: 1) Decide a filter spec (filter type, filter class attenuations, ripples, corner frequencies) 2) Compute the transtion bandwidth from the spec 3) Compute the filter order from the bandwidth and selected filter class (FIR, IIR, Butterworth, Chebychev, Kaiser window...) 4) Compute the prototype filter coefficients, given filter class and filter order 5) Transform prototype low-pass filter to target filter type (low-pass, high-pass, ...) The idea behind the filter design is to be able to compute the set of filter coefficients that satisfy the given filter specification. I would guess this would account for some 30% of the time in a 1-year class on DSP. Rune
ronycsdu wrote:
> I am new to digital filters. I am trying to understand them. I have gone > through the internet and found the design of a simple low pass filter. It > can be implemented digitally by an FIR filter (which is a simple averaging > filter).
An FIR filter can work by averaging, but usually doesn't. It's hard to see how one might make a high-pass filter by any procedure that could be called averaging. In one sense, though all transversal (the usual FIR structure) filters produce a weighted average, but the weights are very specially chosen. The example that I found is something like this:
> > Suppose x[n] is digital bit sequence. So the averaging filter (low pass) > would be: 0.5 * (x[n] + x[n-1]) where x[n-1] represents x[n] with 1 unit > of delay. Now another averaging filter ((low pass)) would be: > > 0.25 * (x[n] + x[n-1] + x[n-2] + x[n-3]) ---> 4 units of delay used here > > As you all know the most common term related to any filter (in the analog > domain) is the cutoff frequency. Now my question is: > > (1) What is the OR Is there any relation between the number of delays used > and the cutoff frequency? Meaning, if you increase/decrease the number of > delays, how will it affect the cutoff frequency of that filter? > (2) What is the OR Is there any relation between the co-efficient used and > the cutoff frequency? Meaning, if you increase/decrease the value of the > co-efficient, how will it affect the cutoff frequency of that filter?
More delays imply a higher-order filter, and more control over the filter's performance if the coefficients are cleverly chosen. The relation of the coefficients one to the rest determines the filter's performance. Most FIR filters have symmetrical coefficients, like, for example, the binomial coefficients that result from (1+x)^n. There are some good filter tutorials available on the web. search http://www.bores.com/courses/intro/index.htm and http://www.dspguide.com/ for starters. 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;
On Oct 7, 4:49&#4294967295;am, "ronycsdu" <ronyc...@yahoo.com> wrote:
> I am new to digital filters. I am trying to understand them. I have gone > through the internet and found the design of a simple low pass filter. It > can be implemented digitally by an FIR filter (which is a simple averaging > filter). The example that I found is something like this: > > Suppose x[n] is digital bit sequence. So the averaging filter (low pass) > would be: &#4294967295;0.5 * (x[n] + x[n-1]) where x[n-1] represents x[n] with 1 unit > of delay. Now another averaging filter ((low pass)) would be: > > 0.25 * (x[n] + x[n-1] + x[n-2] + x[n-3]) &#4294967295;---> 4 units of delay used here > > As you all know the most common term related to any filter (in the analog > domain) is the cutoff frequency. Now my question is: > > (1) What is the OR Is there any relation between the number of delays used > and the cutoff frequency? Meaning, if you increase/decrease the number of > delays, how will it affect the cutoff frequency of that filter? > (2) What is the OR Is there any relation between the co-efficient used and > the cutoff frequency? Meaning, if you increase/decrease the value of the > co-efficient, how will it affect the cutoff frequency of that filter? > > Thank you.
I have some flash tutorials on the DFT, digital convolution and FIR filters here: http://www.fourier-series.com/fourierseries2/DSP.html Perhaps this will help your understanding. Brent
Jerry Avins <jya@ieee.org> wrote:
< ronycsdu wrote:
<> I am new to digital filters. I am trying to understand them. I have gone
<> through the internet and found the design of a simple low pass filter. It
<> can be implemented digitally by an FIR filter (which is a simple averaging
<> filter).
 
< An FIR filter can work by averaging, but usually doesn't. It's hard to 
< see how one might make a high-pass filter by any procedure that could be 
< called averaging. In one sense, though all transversal (the usual FIR 
< structure) filters produce a weighted average, but the weights are very 
< specially chosen.

Interesting question.  As long as all the weights are positive it 
doesn't seem so strange to call it a (weighted) average. I am not
sure either way about the case of negative weights.  All postive
weights would seem to generate low pass filters, though, and
the OP specified low pass.

(snip) 

-- glen

glen herrmannsfeldt wrote:
> Jerry Avins <jya@ieee.org> wrote: > < ronycsdu wrote: > <> I am new to digital filters. I am trying to understand them. I have gone > <> through the internet and found the design of a simple low pass filter. It > <> can be implemented digitally by an FIR filter (which is a simple averaging > <> filter). > > < An FIR filter can work by averaging, but usually doesn't. It's hard to > < see how one might make a high-pass filter by any procedure that could be > < called averaging. In one sense, though all transversal (the usual FIR > < structure) filters produce a weighted average, but the weights are very > < specially chosen. > > Interesting question. As long as all the weights are positive it > doesn't seem so strange to call it a (weighted) average. I am not > sure either way about the case of negative weights. All postive > weights would seem to generate low pass filters, though, and > the OP specified low pass.
As far as I know, a high-pass filter can't be made without negative weights (somebody prove me wrong, please!) but some low-pass filters have negative weights. For examples, the flattop window in a recent thread: http://tinyurl.com/ycf3tqq and a truncated sinc. 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;
On 7 Okt, 20:04, Jerry Avins <j...@ieee.org> wrote:

> As far as I know, a high-pass filter can't be made without negative > weights (somebody prove me wrong, please!)
The seminal LP FIR prototype is h = [1,1]. The similar HP FIR prototype is h = [1, -1]. Rune
On Oct 7, 5:21&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote:


> I have some flash tutorials on the DFT, digital convolution and FIR > filters here: > > http://www.fourier-series.com/fourierseries2/DSP.html > > Perhaps this will help your understanding. > > Brent
Good stuff. What's the advantage of using an inverse FFT compared to just calculating the sinc directly?
On 8 Okt, 05:55, Fully Half Baked <jfez...@googlemail.com> wrote:
> On Oct 7, 5:21&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote: > > > I have some flash tutorials on the DFT, digital convolution and FIR > > filters here: > > >http://www.fourier-series.com/fourierseries2/DSP.html > > > Perhaps this will help your understanding. > > > Brent > > Good stuff. What's the advantage of using an inverse FFT compared to > just calculating the sinc directly?
From a computational POV there shouldn't be any. From a pedagogical POV it might help to illustrate the ideas behind the method. Oncce the student understand that the time-domain sinc in fact is an IDFT of the frequency-domain box filter response, one can add later that 'Ah, yeah, this might interest you: There is a faster way to compute the sinc.' Rune
On Oct 7, 11:55&#4294967295;pm, Fully Half Baked <jfez...@googlemail.com> wrote:
> On Oct 7, 5:21&#4294967295;pm, brent <buleg...@columbus.rr.com> wrote: > > > I have some flash tutorials on the DFT, digital convolution and FIR > > filters here: > > >http://www.fourier-series.com/fourierseries2/DSP.html > > > Perhaps this will help your understanding. > > > Brent > > Good stuff. What's the advantage of using an inverse FFT compared to > just calculating the sinc directly?
I think there is an advantage of using the sinc function directly. When computing the inverse FFT you need to pick a certain length IFFT to use. The longer you pick , the more true the coefficients will be, but the more difficult it is to compute it. Going straight to the sinc function gives you ideal coefficients with little computational difficulty. Good point. Brent