DSPRelated.com
Forums

Beginers question on nos of taps

Started by gmartin February 20, 2005
Hi,
   How do the number of taps of an IIR or FIR filter corelate to the order
of the filter?? Lets say I have a 2nd order Low pass Butterworth filter,
does that mean the nos of taps will be 2?? Also will the number of taps
vary with the corner frequency.

Thanks
-Glidden


		
This message was sent using the Comp.DSP web interface on
www.DSPRelated.com
gmartin wrote:
> Hi, > How do the number of taps of an IIR or FIR filter corelate to the order > of the filter?? Lets say I have a 2nd order Low pass Butterworth filter, > does that mean the nos of taps will be 2?? Also will the number of taps > vary with the corner frequency.
Ouch! IIR filters don't have taps. Convolutional FIR filters -- the usual kind -- don't have orders. Follow links to tutorials at http://www.dspguru.com. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
man, Jerry.  dunno if it's me (or the semantics i've grown up with), i don't
agree with you on two counts.

in article A7udnVCmgaXONYXfRVn-gw@rcn.net, Jerry Avins at jya@ieee.org wrote
on 02/20/2005 10:10:

> gmartin wrote: >> How do the number of taps of an IIR or FIR filter correlate to the order >> of the filter?? Lets say I have a 2nd order Low pass Butterworth filter, >> does that mean the nos of taps will be 2?? Also will the number of taps >> vary with the corner frequency. > > Ouch! IIR filters don't have taps.
sure they do. it's just that the taps feed back to the input as well as feed forward to the output.
> Convolutional FIR filters -- the usual kind -- don't have orders.
sure they do. the number of taps of an ordinary FIR filter is one more than the order of the filter. when you use MATLAB's "remez"() or firls() to design an FIR filter, it asks for the order, not the number of taps. the order of a filter, IIR or FIR is the largest power of z^-1 that you see in the transfer function.
> Follow links to tutorials at http://www.dspguru.com.
that one i agree with. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Jerry Avins wrote:

> gmartin wrote: > >> Hi, >> How do the number of taps of an IIR or FIR filter corelate to the >> order >> of the filter?? Lets say I have a 2nd order Low pass Butterworth filter, >> does that mean the nos of taps will be 2?? Also will the number of taps >> vary with the corner frequency. > > > Ouch! IIR filters don't have taps. Convolutional FIR filters -- the > usual kind -- don't have orders. Follow links to tutorials at > http://www.dspguru.com. > > Jerry
I'm with RBJ, more or less. If you implement your IIR filter as y[n] = a_1 y[n-1] + a_2 y[n-2] + b_0 x[n] + b_1 x[n-1] + b_2 x[n-2] then you do indeed have taps -- 5 of them. And the order of any discrete-time system is the number of prior states that you need to save -- so technically the filter as I wrote it is 4th-order. Of course you'll look at the transfer function and see a 2nd-order polynomial and realize that it's a state-wasteful implementation. More directly, if you have a 100-tap FIR filter you need to save 99 prior states, so it's a 99th-order filter, which you can see when you look at it's transfer function: 1 99 Y(z) = ---- sum a_n z^n z^99 n=0 -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
robert bristow-johnson wrote:
> man, Jerry. dunno if it's me (or the semantics i've grown up with), i don't > agree with you on two counts. > > in article A7udnVCmgaXONYXfRVn-gw@rcn.net, Jerry Avins at jya@ieee.org wrote > on 02/20/2005 10:10: > > >>gmartin wrote: >> >>>How do the number of taps of an IIR or FIR filter correlate to the order >>>of the filter?? Lets say I have a 2nd order Low pass Butterworth filter, >>>does that mean the nos of taps will be 2?? Also will the number of taps >>>vary with the corner frequency. >> >>Ouch! IIR filters don't have taps. > > > sure they do. it's just that the taps feed back to the input as well as > feed forward to the output.
If you say so. In IIRs that I know, there is always one path directly to the output. But there are other ways to see the same configuration, so OK.
>>Convolutional FIR filters -- the usual kind -- don't have orders. > > > sure they do. the number of taps of an ordinary FIR filter is one more than > the order of the filter. when you use MATLAB's "remez"() or firls() to > design an FIR filter, it asks for the order, not the number of taps. the > order of a filter, IIR or FIR is the largest power of z^-1 that you see in > the transfer function.
Indeed so. But when I build a tapped delay line, I count taps. Poles and zeros balance too, but we call an FIR an all-sero design. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
robert bristow-johnson wrote:
> man, Jerry. dunno if it's me (or the semantics i've grown up with),
i don't
> agree with you on two counts. > > in article A7udnVCmgaXONYXfRVn-gw@rcn.net, Jerry Avins at
jya@ieee.org wrote
> on 02/20/2005 10:10: > > > gmartin wrote: > >> How do the number of taps of an IIR or FIR filter correlate to the
order
> >> of the filter?? Lets say I have a 2nd order Low pass Butterworth
filter,
> >> does that mean the nos of taps will be 2?? Also will the number of
taps
> >> vary with the corner frequency. > > > > Ouch! IIR filters don't have taps. > > sure they do. it's just that the taps feed back to the input as well
as
> feed forward to the output.
I don't agree with either of you here. I prefer to say that the filters have "coefficients". The FIR filter has only feed forward coefficients, while the IIR has feedback coefficients as well. I think the word "tap" oroginates from some analog model, the "tapped delay line", that was used to model the FIR filter. This model may have been useful in the early years for electrical engineers, who were trained in analog electronics, to provide some sort of "hook" to understand the FIR filter. Unfortunately, the terminology stayed on while most newbies to DSP these days have no clue what a "transmission line" is. So I believe the "simple" explanation is a significant part of the problem, these days.
> > Convolutional FIR filters -- the usual kind -- don't have orders. > > sure they do. the number of taps of an ordinary FIR filter is one
more than
> the order of the filter. when you use MATLAB's "remez"() or firls()
to
> design an FIR filter, it asks for the order, not the number of taps.
the
> order of a filter, IIR or FIR is the largest power of z^-1 that you
see in
> the transfer function.
Here I agree with RBJ.
> > Follow links to tutorials at http://www.dspguru.com. > > that one i agree with.
Rune
I thought the order of a filter was given by the larger delay either side: the 
filter below is second-order, as the largest delay (on both input and output) is 
2.  I assumed the OP used the term "tap" meaning "unit delays", and these are 
not exactly the same as "coefficients", which are the multiplier factors applied 
to each delay, a_1,a_2,b_0,b_1,b_2 etc. So you have 5 coefficients, but still a 
second-order filter.

Richard Dobson


Tim Wescott wrote:
..
> I'm with RBJ, more or less. If you implement your IIR filter as > > y[n] = a_1 y[n-1] + a_2 y[n-2] + b_0 x[n] + b_1 x[n-1] + b_2 x[n-2] > > then you do indeed have taps -- 5 of them. > > And the order of any discrete-time system is the number of prior states > that you need to save -- so technically the filter as I wrote it is > 4th-order. ..
"Rune Allnor" <allnor@tele.ntnu.no> wrote in news:1108971612.159927.12070
@o13g2000cwo.googlegroups.com:

Although, I agree that the order of the filter is the order of the 
polynominal, I never refer to FIR filters by order. I use Jerry's 
convention.

I used to sell filters to non DSP types. An IIR filter typically has 
similar performance to an analog filter of the same order. The problem 
with calling an FIR filter by order is that it implies a different level 
of performance to the non DSP user. A 100th order Chebyshev LP might be 
very brickwall like, and it might still be ringing tomorrow. This would 
be a very different filter than a 100 tap FIR.

-- 
Al Clark
Danville Signal Processing, Inc.
--------------------------------------------------------------------
Purveyors of Fine DSP Hardware and other Cool Stuff
Available at http://www.danvillesignal.com




> > robert bristow-johnson wrote: >> man, Jerry. dunno if it's me (or the semantics i've grown up with), > i don't >> agree with you on two counts. >> >> in article A7udnVCmgaXONYXfRVn-gw@rcn.net, Jerry Avins at > jya@ieee.org wrote >> on 02/20/2005 10:10: >> >> > gmartin wrote: >> >> How do the number of taps of an IIR or FIR filter correlate to the > order >> >> of the filter?? Lets say I have a 2nd order Low pass Butterworth > filter, >> >> does that mean the nos of taps will be 2?? Also will the number of > taps >> >> vary with the corner frequency. >> > >> > Ouch! IIR filters don't have taps. >> >> sure they do. it's just that the taps feed back to the input as well > as >> feed forward to the output. > > I don't agree with either of you here. I prefer to say that the filters > > have "coefficients". The FIR filter has only feed forward coefficients, > > while the IIR has feedback coefficients as well. > > I think the word "tap" oroginates from some analog model, the "tapped > delay line", that was used to model the FIR filter. This model may have > > been useful in the early years for electrical engineers, who were > trained > in analog electronics, to provide some sort of "hook" to understand > the FIR filter. Unfortunately, the terminology stayed on while most > newbies to DSP these days have no clue what a "transmission line" is. > So I believe the "simple" explanation is a significant part of the > problem, these days. > >> > Convolutional FIR filters -- the usual kind -- don't have orders. >> >> sure they do. the number of taps of an ordinary FIR filter is one > more than >> the order of the filter. when you use MATLAB's "remez"() or firls() > to >> design an FIR filter, it asks for the order, not the number of taps. > the >> order of a filter, IIR or FIR is the largest power of z^-1 that you > see in >> the transfer function. > > Here I agree with RBJ. > >> > Follow links to tutorials at http://www.dspguru.com. >> >> that one i agree with. > > Rune >
Al Clark <dsp@danvillesignal.com> writes:

> "Rune Allnor" <allnor@tele.ntnu.no> wrote in news:1108971612.159927.12070 > @o13g2000cwo.googlegroups.com: > > Although, I agree that the order of the filter is the order of the > polynominal, > I never refer to FIR filters by order.
The filter H(z) = z^5 + z^4 is a fifth-order filter. I agree that this is the convention but I don't like it either. -- % Randy Yates % "Remember the good old 1980's, when %% Fuquay-Varina, NC % things were so uncomplicated?" %%% 919-577-9882 % 'Ticket To The Moon' %%%% <yates@ieee.org> % *Time*, Electric Light Orchestra http://home.earthlink.net/~yatescr
Al Clark wrote:
> "Rune Allnor" <allnor@tele.ntnu.no> wrote in news:1108971612.159927.12070 > @o13g2000cwo.googlegroups.com: > > Although, I agree that the order of the filter is the order of the > polynominal, I never refer to FIR filters by order. I use Jerry's > convention. > > I used to sell filters to non DSP types. An IIR filter typically has > similar performance to an analog filter of the same order. The problem > with calling an FIR filter by order is that it implies a different level > of performance to the non DSP user. A 100th order Chebyshev LP might be > very brickwall like, and it might still be ringing tomorrow. This would > be a very different filter than a 100 tap FIR.
Al and everyone, I have to agree than my view of the DSP world is rather idiosyncratic, being an add-on to years of analog practice and theory. I know that an IIR can be built with a pair of tapped delay lines; I've seen that integrated using CCD bucket brigades. For the reason Al states, it's historically reasonable to think about any unidirectional transversal filter having "taps". While it's possible to find similar structures in IIRs and to characterize the filter by them, it doesn't seem reasonable to me. Would a third-order IIR be said to have six taps, or three? Will someone come along with the plaint, "But you said a filter's delay is half the number of taps"? 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;