Relation between delay in FIR filter and the cutoff frequency...
I am new to digital filters. I am trying to understand them. I have gon
through the internet and found the design of a simple low pass filter. I
can be implemented digitally by an FIR filter (which is a simple averagin
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 uni
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 analo
domain) is the cutoff frequency. Now my question is:
(1) What is the OR Is there any relation between the number of delays use
and the cutoff frequency? Meaning, if you increase/decrease the number o
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 an
the cutoff frequency? Meaning, if you increase/decrease the value of th
co-efficient, how will it affect the cutoff frequency of that filter?
Re: Relation between delay in FIR filter and the cutoff frequency...
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: *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?
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.
Re: Relation between delay in FIR filter and the cutoff frequency...
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.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Re: Relation between delay in FIR filter and the cutoff frequency...
On Oct 7, 4:49*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: *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.
I have some flash tutorials on the DFT, digital convolution and FIR
filters here:
Re: Relation between delay in FIR filter and the cutoff frequency...
Jerry Avins <[email protected]> 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.
Re: Relation between delay in FIR filter and the cutoff frequency...
glen herrmannsfeldt wrote:
> Jerry Avins <[email protected]> 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.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Re: Relation between delay in FIR filter and the cutoff frequency...
On 8 Okt, 05:55, Fully Half Baked <jfez...@googlemail.com> wrote:
> On Oct 7, 5:21*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.'
Re: Relation between delay in FIR filter and the cutoff frequency...
On Oct 7, 11:55*pm, Fully Half Baked <jfez...@googlemail.com> wrote:
> On Oct 7, 5:21*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.
Re: Relation between delay in FIR filter and the cutoff frequency...
brent wrote:
> On Oct 7, 11:55 pm, Fully Half Baked <jfez...@googlemail.com> wrote:
>> On Oct 7, 5:21 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.
The sinc you so admire is infinitely long, requiring even more
coefficients than what you get from an IFFT. :-) Simply truncating the
sinc results in lousy stop-band attenuation. So you window however many
coefficients you decide to use and end up with "Windowed sinc" design.
That is good, but there are other methods that are often more effective.
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Re: Relation between delay in FIR filter and the cutofffrequency...
On Wed, 07 Oct 2009 14:04:11 -0400, Jerry Avins wrote:
> glen herrmannsfeldt wrote:
>> Jerry Avins <[email protected]> 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
Sure! Take the filter with the impulse response h(n) = [-i i]. It's
your basic high-pass, and it has no negative values.
But you probably meant a _realizable_ filter, didn't you?
If you mean high-pass in the normal sense of DC blocking, then any non-
zero impulse response would _have_ to have both negative and positive
values -- the filter can only block DC if its impulse response sums (or
integrates in continuous time) to zero, and that can only happen if the
whole filter is zero or if some terms are positive and some are negative.
Re: Relation between delay in FIR filter and the cutoff frequency...
Tim Wescott wrote:
> ... Take the filter with the impulse response h(n) = [-i i]. It's
> your basic high-pass, and it has no negative values. ...
Given both i and -i, doesn't one of them have to be negative?
Jerry
--
Engineering is the art of making what you want from things you can get.
ÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻ ÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻ ÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻÂŻ
> Sure! Take the filter with the impulse response h(n) = [-i i]. It's
> your basic high-pass, and it has no negative values.
> But you probably meant a _realizable_ filter, didn't you?
> If you mean high-pass in the normal sense of DC blocking, then any non-
> zero impulse response would _have_ to have both negative and positive
> values -- the filter can only block DC if its impulse response sums (or
> integrates in continuous time) to zero, and that can only happen if the
> whole filter is zero or if some terms are positive and some are negative.
Yes. Still unanswered is the question about weighted average.
Are negative weights allowed in a weighted average?
If so, an FIR filter is just a weighted average. If not, only
some of them are.
Re: Relation between delay in FIR filter and the cutofffrequency...
On Thu, 08 Oct 2009 20:57:57 -0400, Jerry Avins wrote:
> Tim Wescott wrote:
>
>> ... Take the filter with the impulse response h(n) = [-i i]. It's
>> your basic high-pass, and it has no negative values. ...
>
> Given both i and -i, doesn't one of them have to be negative?
>
> Jerry
Negative numbers are real numbers with values less than zero; i (and -i)
is an imaginary number and is neither positive nor negative (I, on the
other hand, appear to be a wise-ass tonight).
"The real numbers are the dependable breadwinner of the family, the
complete ordered field we all rely on. The complex numbers are a slightly
flashier but still respectable younger brother: not ordered, but
algebraically complete. The quaternions, being noncommutative, are the
eccentric cousin who is shunned at important family gatherings. But the
octonions are the crazy old uncle nobody lets out of the attic: they are
nonassociative. â John Baez"
Re: Relation between delay in FIR filter and the cutoff frequency...
On Oct 7, 11:30*am, Jerry Avins <j...@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.
>
> * 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. searchhttp://www.bores.com/courses/intro/index.htmandhttp://www.dspguide.com/for starters..
Jerry,
Take a look at comb filters. They are used when it is impractical to
use multipliers in a design (such as high speed or size constraints).
Without multipliers, they use coefficients of 1 or 0.5 or 0.25, etc.
which can be had by shifting. All of the comb filters I have seen
were simple 2 sample averaging filters.
Re: Relation between delay in FIR filter and the cutoff frequency...
rickman wrote:
...
> Jerry,
>
> Take a look at comb filters. They are used when it is impractical to
> use multipliers in a design (such as high speed or size constraints).
> Without multipliers, they use coefficients of 1 or 0.5 or 0.25, etc.
> which can be had by shifting. All of the comb filters I have seen
> were simple 2 sample averaging filters.
Rick,
I'm not sure why comb filters are apropos, but you are correct to assume
that I didn't have them in mind when I wrote.
Cascaded comb filters can be very selective. An optical example is the
quartz polarizing monochromator used (before multi-layer dichroic
filters were available) to view the sun in the line of one element. It
is a monstrous affair, tuned by varying its temperature. A fine example
of the ingenuity of the ancients! http://tinyurl.com/yhbo42l
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
Re: Relation between delay in FIR filter and the cutoff frequency...
>On Thu, 08 Oct 2009 20:57:57 -0400, Jerry Avins wrote:
>
>> Tim Wescott wrote:
>>
>>> ... Take the filter with the impulse response h(n) = [-i i]. It's
>>> your basic high-pass, and it has no negative values. ...
>>
>> Given both i and -i, doesn't one of them have to be negative?
>>
>> Jerry
>
>Negative numbers are real numbers with values less than zero; i (and -i
>is an imaginary number and is neither positive nor negative (I, on the
>other hand, appear to be a wise-ass tonight).
I think this points out something interesting anyway. I think the FI
coefficients can be negative on a weighted average if they're ALL negativ
(I carefully avoided an if-and-only-if here).
Moreover, if the signal to the FIR is real, you're effectivel
implementing two filters: the imaginary part and the real part. Then i
doesn't matter (other than a sign flip on the output) whether you divid
through by i or -i in deciding if some coefficient is "negative", sinc
it's relative, as far as the question being asked is concerned (weighte
average).