Reply by Tim Wescott October 26, 20052005-10-26
Jake wrote:
> Tim Wescott wrote: > >>Jake wrote: >> >> >>>Tim Wescott wrote: >>> >>> >>>>Jake wrote: >>>> >>>> >>>> >>>>>Real_McCoy wrote: >>>>> >>>>> >>>>> >>>>>>"Jake" <wh@ever.com> wrote in message news:435BF765.66DB2BA3@ever.com... >>>>>> >>>>>> >>>>>> >>>>>>>How many taps does an iir filter have? TIA. >>>>>> >>>>>>I never understood the reason for calling it taps or tapped-delay line. To >>>>>>me it is just an equation - ditto for IIR. >>>>>> >>>>>>y(k)=-a1y(k-1)-a2y(k-2)+....-any(k-n) + b0u(k)+b1u(k-1)++...+bmu(k-m) >>>>>> >>>>>>why the need to know about taps - the equation is obvious. >>>>> >>>>> >>>>>So does u(k) need to be stored along with the rest or not? I think >>>>>that's where the "taps" aspect comes from: how much storage space is >>>>>required. >>>>> >>>>>I'm guessing the number of taps in the equation is n+m+1 but I'm open to >>>>>revision. >>>>> >>>>>Thanks. >>>> >>>>If the filter is arranged right then no, the u(k) does not need to be >>>>stored -- you should only have to store a number of states equal to the >>>>order of the transfer function you're trying to implement. >>> >>>So you're saying that order = n+m, which completely contradicts the >>>convention that order = max(m,n). >>> >> >>No, I'm not. >> >>Your method results in some pretty odd transfer functions. I'm saying >>that for a transfer function that can be expressed as a constant plus a >>proper fraction in z, such that >> >> b_{n-1} z^{n-1} + ... + b_0 >>H(z) = b_n + ----------------------------- >> z^n + a_{n-1} + ... + a_0 >> >>then the order is n, and that's the number of states you have to store. >> For your way of putting things this only fits if n >= m, so if you >>want to insist on your difference equation having more input than output >>terms you have to pad the denominator out by having some roots at z = 0. >> >>Do you know what the z transform is? > > > Yes. A useful fiction for LTIs but completely worthless for nonlinear > filters. > > >>There's a (somewhat sketchy) tutorial at >>http://www.wescottdesign.com/articles/zTransform/z-transforms.html that >>explains what a transfer function is and gives an example of a 2nd-order >>filter implemented with 2 states. Higher-order examples are not given >>because you really, really don't want to implement IIR filters with >>order higher than 2 (I explain why, in the article). >> >>> >>>>But if you are as much a beginner as you say this isn't the question you >>>>should be asking -- you're pointing the muzzle of the DSP gun at your >>>>head and asking where the safety is. You should be reading the manual >>>>to find out some more basic basics before you shoot yourself. >>> >>> >>>I've read two tutorials. Neither one discussed taps. So what's your >>>point? >> >>You won't get there reading one or two little tutorials (not even mine). >> You need at least one book-length work. I'd suggest Rick Lyon's >>"Understanding Digital Signal Processing" for a start. >> >>>BTW I also looked in several electronics "reference" books in the >>>library. Not only did none of them discuss taps, I couldn't even find >>>one that defined "filter order", although one inexplicably had diagrams >>>of a "first-order filter" and a "second-order filter". >> >>If you are working in the z domain (or the Laplace domain with >>continuous-time filters) then the order is simply the required order of >>the denominator of the transfer function. I suspect that every author >>just expects that you understand this. > > > Filter Order - a number describing the highest exponent in the numerator > or denominator of the z-domain transfer function of a digital filter. > For FIR filters, there is no denominator in the transfer function and > the filter order is merely the number of taps used in the filter > structure. For IIR filters, the filter order is equal to the number of > delay elements in the filter structure. Generally, the larger the > filter order, the better the frequency magnitude response performance of > the filter. > http://www.dspguru.com/info/terms/filtterm/index.htm >
If you take an FIR filter transfer function expressed as a proper ratio of polynomials in z (not 1/z) then you have to put a z^n in the denominator -- and n is the filter order.
> >>But if it helps the order of a filter is the minimum number of storage >>elements required to implement the filter -- that sounds like a circular >>definition, given what I said above, but this is the controlling >>statement from which the rest flows. >> >> >>>If you're >>>implying there's some readily available and completely thorough font of >>>dsp clarity "out there" somewhere, I'd sure like to hear about it. >>> >> >>I wasn't, really, I was just trying to imply that you're jumping into >>the middle. >> >>If it has to be _completely_ thorough then yes, they are readily >>available -- they're called "Universities" and many of them have >>comprehensive programs that will teach you all the math you need to >>understand general signal processing, then general signal processing, >>then DSP as well as several interesting things you can do with it. >> >>If you mean "one book" or "on the web" then no, such things don't exist. > > > My primary concern is nonlinear filter analysis. Frequency transforms > don't help much there, right? Do you have a standard method of > nonlinear filter analysis to offer? >
Yes: Write the difference equation and solve it. That's it. Of course, the ramifications will fill a library. Truly, the way you solve difference equations in general is much like solving differential equations -- you pull a guess out of your bag of tricks and try it out; if that doesn't work you pull out another guess and try again. If the difference (or differential) equation is linear and shift (or time) invariant with discrete states you can confidently guess that the z (or Laplace) transform will solve it for you. Since a discrete-time nonlinear filter is just a system that implements a nonlinear difference equation it's time to start guessing. You can try to identify a certain class of difference equation with formulaic answers, and see if your filters fit. This is essentially what has been done with LSI (or LTI) systems and the z (or Laplace) transform. Have fun. You're definitely jumping into the deep end. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by Jake October 26, 20052005-10-26
Tim Wescott wrote:
> > Jake wrote: > > > Tim Wescott wrote: > > > >>Jake wrote: > >> > >> > >>>Real_McCoy wrote: > >>> > >>> > >>>>"Jake" <wh@ever.com> wrote in message news:435BF765.66DB2BA3@ever.com... > >>>> > >>>> > >>>>>How many taps does an iir filter have? TIA. > >>>> > >>>>I never understood the reason for calling it taps or tapped-delay line. To > >>>>me it is just an equation - ditto for IIR. > >>>> > >>>>y(k)=-a1y(k-1)-a2y(k-2)+....-any(k-n) + b0u(k)+b1u(k-1)++...+bmu(k-m) > >>>> > >>>>why the need to know about taps - the equation is obvious. > >>> > >>> > >>>So does u(k) need to be stored along with the rest or not? I think > >>>that's where the "taps" aspect comes from: how much storage space is > >>>required. > >>> > >>>I'm guessing the number of taps in the equation is n+m+1 but I'm open to > >>>revision. > >>> > >>>Thanks. > >> > >>If the filter is arranged right then no, the u(k) does not need to be > >>stored -- you should only have to store a number of states equal to the > >>order of the transfer function you're trying to implement. > > > > So you're saying that order = n+m, which completely contradicts the > > convention that order = max(m,n). > > > No, I'm not. > > Your method results in some pretty odd transfer functions. I'm saying > that for a transfer function that can be expressed as a constant plus a > proper fraction in z, such that > > b_{n-1} z^{n-1} + ... + b_0 > H(z) = b_n + ----------------------------- > z^n + a_{n-1} + ... + a_0 > > then the order is n, and that's the number of states you have to store. > For your way of putting things this only fits if n >= m, so if you > want to insist on your difference equation having more input than output > terms you have to pad the denominator out by having some roots at z = 0. > > Do you know what the z transform is?
Yes. A useful fiction for LTIs but completely worthless for nonlinear filters.
> There's a (somewhat sketchy) tutorial at > http://www.wescottdesign.com/articles/zTransform/z-transforms.html that > explains what a transfer function is and gives an example of a 2nd-order > filter implemented with 2 states. Higher-order examples are not given > because you really, really don't want to implement IIR filters with > order higher than 2 (I explain why, in the article). > > > > > >>But if you are as much a beginner as you say this isn't the question you > >>should be asking -- you're pointing the muzzle of the DSP gun at your > >>head and asking where the safety is. You should be reading the manual > >>to find out some more basic basics before you shoot yourself. > > > > > > I've read two tutorials. Neither one discussed taps. So what's your > > point? > > You won't get there reading one or two little tutorials (not even mine). > You need at least one book-length work. I'd suggest Rick Lyon's > "Understanding Digital Signal Processing" for a start. > > > > BTW I also looked in several electronics "reference" books in the > > library. Not only did none of them discuss taps, I couldn't even find > > one that defined "filter order", although one inexplicably had diagrams > > of a "first-order filter" and a "second-order filter". > > If you are working in the z domain (or the Laplace domain with > continuous-time filters) then the order is simply the required order of > the denominator of the transfer function. I suspect that every author > just expects that you understand this.
Filter Order - a number describing the highest exponent in the numerator or denominator of the z-domain transfer function of a digital filter. For FIR filters, there is no denominator in the transfer function and the filter order is merely the number of taps used in the filter structure. For IIR filters, the filter order is equal to the number of delay elements in the filter structure. Generally, the larger the filter order, the better the frequency magnitude response performance of the filter. http://www.dspguru.com/info/terms/filtterm/index.htm
> > But if it helps the order of a filter is the minimum number of storage > elements required to implement the filter -- that sounds like a circular > definition, given what I said above, but this is the controlling > statement from which the rest flows. > > > If you're > > implying there's some readily available and completely thorough font of > > dsp clarity "out there" somewhere, I'd sure like to hear about it. > > > I wasn't, really, I was just trying to imply that you're jumping into > the middle. > > If it has to be _completely_ thorough then yes, they are readily > available -- they're called "Universities" and many of them have > comprehensive programs that will teach you all the math you need to > understand general signal processing, then general signal processing, > then DSP as well as several interesting things you can do with it. > > If you mean "one book" or "on the web" then no, such things don't exist.
My primary concern is nonlinear filter analysis. Frequency transforms don't help much there, right? Do you have a standard method of nonlinear filter analysis to offer?
> -- > > Tim Wescott > Wescott Design Services > http://www.wescottdesign.com
Reply by Tim Wescott October 25, 20052005-10-25
Jake wrote:

> Tim Wescott wrote: > >>Jake wrote: >> >> >>>Real_McCoy wrote: >>> >>> >>>>"Jake" <wh@ever.com> wrote in message news:435BF765.66DB2BA3@ever.com... >>>> >>>> >>>>>How many taps does an iir filter have? TIA. >>>> >>>>I never understood the reason for calling it taps or tapped-delay line. To >>>>me it is just an equation - ditto for IIR. >>>> >>>>y(k)=-a1y(k-1)-a2y(k-2)+....-any(k-n) + b0u(k)+b1u(k-1)++...+bmu(k-m) >>>> >>>>why the need to know about taps - the equation is obvious. >>> >>> >>>So does u(k) need to be stored along with the rest or not? I think >>>that's where the "taps" aspect comes from: how much storage space is >>>required. >>> >>>I'm guessing the number of taps in the equation is n+m+1 but I'm open to >>>revision. >>> >>>Thanks. >> >>If the filter is arranged right then no, the u(k) does not need to be >>stored -- you should only have to store a number of states equal to the >>order of the transfer function you're trying to implement. > > > So you're saying that order = n+m, which completely contradicts the > convention that order = max(m, n). >
No, I'm not. Your method results in some pretty odd transfer functions. I'm saying that for a transfer function that can be expressed as a constant plus a proper fraction in z, such that b_{n-1} z^{n-1} + ... + b_0 H(z) = b_n + ----------------------------- z^n + a_{n-1} + ... + a_0 then the order is n, and that's the number of states you have to store. For your way of putting things this only fits if n >= m, so if you want to insist on your difference equation having more input than output terms you have to pad the denominator out by having some roots at z = 0. Do you know what the z transform is? There's a (somewhat sketchy) tutorial at http://www.wescottdesign.com/articles/zTransform/z-transforms.html that explains what a transfer function is and gives an example of a 2nd-order filter implemented with 2 states. Higher-order examples are not given because you really, really don't want to implement IIR filters with order higher than 2 (I explain why, in the article).
> > >>But if you are as much a beginner as you say this isn't the question you >>should be asking -- you're pointing the muzzle of the DSP gun at your >>head and asking where the safety is. You should be reading the manual >>to find out some more basic basics before you shoot yourself. > > > I've read two tutorials. Neither one discussed taps. So what's your > point?
You won't get there reading one or two little tutorials (not even mine). You need at least one book-length work. I'd suggest Rick Lyon's "Understanding Digital Signal Processing" for a start.
> > BTW I also looked in several electronics "reference" books in the > library. Not only did none of them discuss taps, I couldn't even find > one that defined "filter order", although one inexplicably had diagrams > of a "first-order filter" and a "second-order filter".
If you are working in the z domain (or the Laplace domain with continuous-time filters) then the order is simply the required order of the denominator of the transfer function. I suspect that every author just expects that you understand this. But if it helps the order of a filter is the minimum number of storage elements required to implement the filter -- that sounds like a circular definition, given what I said above, but this is the controlling statement from which the rest flows.
> If you're > implying there's some readily available and completely thorough font of > dsp clarity "out there" somewhere, I'd sure like to hear about it. >
I wasn't, really, I was just trying to imply that you're jumping into the middle. If it has to be _completely_ thorough then yes, they are readily available -- they're called "Universities" and many of them have comprehensive programs that will teach you all the math you need to understand general signal processing, then general signal processing, then DSP as well as several interesting things you can do with it. If you mean "one book" or "on the web" then no, such things don't exist. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by Jerry Avins October 25, 20052005-10-25
Jake wrote:

   ...

> I've read two tutorials. Neither one discussed taps. So what's your > point? > > BTW I also looked in several electronics "reference" books in the > library. Not only did none of them discuss taps, I couldn't even find > one that defined "filter order", although one inexplicably had diagrams > of a "first-order filter" and a "second-order filter". If you're > implying there's some readily available and completely thorough font of > dsp clarity "out there" somewhere, I'd sure like to hear about it.
Then it should have occurred to you by now that most people don't discuss IIRs in terms of taps. While it's possible to justify the term, it isn't generally used. Move on. 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;
Reply by Jake October 24, 20052005-10-24
Tim Wescott wrote:
> > Jake wrote: > > > Real_McCoy wrote: > > > >>"Jake" <wh@ever.com> wrote in message news:435BF765.66DB2BA3@ever.com... > >> > >>>How many taps does an iir filter have? TIA. > >> > >>I never understood the reason for calling it taps or tapped-delay line. To > >>me it is just an equation - ditto for IIR. > >> > >>y(k)=-a1y(k-1)-a2y(k-2)+....-any(k-n) + b0u(k)+b1u(k-1)++...+bmu(k-m) > >> > >>why the need to know about taps - the equation is obvious. > > > > > > So does u(k) need to be stored along with the rest or not? I think > > that's where the "taps" aspect comes from: how much storage space is > > required. > > > > I'm guessing the number of taps in the equation is n+m+1 but I'm open to > > revision. > > > > Thanks. > > If the filter is arranged right then no, the u(k) does not need to be > stored -- you should only have to store a number of states equal to the > order of the transfer function you're trying to implement.
So you're saying that order = n+m, which completely contradicts the convention that order = max(m, n).
> But if you are as much a beginner as you say this isn't the question you > should be asking -- you're pointing the muzzle of the DSP gun at your > head and asking where the safety is. You should be reading the manual > to find out some more basic basics before you shoot yourself.
I've read two tutorials. Neither one discussed taps. So what's your point? BTW I also looked in several electronics "reference" books in the library. Not only did none of them discuss taps, I couldn't even find one that defined "filter order", although one inexplicably had diagrams of a "first-order filter" and a "second-order filter". If you're implying there's some readily available and completely thorough font of dsp clarity "out there" somewhere, I'd sure like to hear about it.
> -- > > Tim Wescott > Wescott Design Services > http://www.wescottdesign.com
Reply by Tim Wescott October 24, 20052005-10-24
Jake wrote:

> Real_McCoy wrote: > >>"Jake" <wh@ever.com> wrote in message news:435BF765.66DB2BA3@ever.com... >> >>>How many taps does an iir filter have? TIA. >> >>I never understood the reason for calling it taps or tapped-delay line. To >>me it is just an equation - ditto for IIR. >> >>y(k)=-a1y(k-1)-a2y(k-2)+....-any(k-n) + b0u(k)+b1u(k-1)++...+bmu(k-m) >> >>why the need to know about taps - the equation is obvious. > > > So does u(k) need to be stored along with the rest or not? I think > that's where the "taps" aspect comes from: how much storage space is > required. > > I'm guessing the number of taps in the equation is n+m+1 but I'm open to > revision. > > Thanks.
If the filter is arranged right then no, the u(k) does not need to be stored -- you should only have to store a number of states equal to the order of the transfer function you're trying to implement. But if you are as much a beginner as you say this isn't the question you should be asking -- you're pointing the muzzle of the DSP gun at your head and asking where the safety is. You should be reading the manual to find out some more basic basics before you shoot yourself. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by Tim Wescott October 24, 20052005-10-24
Jake wrote:

> Jerry Avins wrote: > >>Jake wrote: >> >>>How many taps does an iir filter have? TIA. >> >>none > > > What do you call the stored inputs for output calculation? > > Google search, "iir taps" : 20 hits ( but no explanation :-( ) > > >>-- >>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;
States. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by robert bristow-johnson October 24, 20052005-10-24
in article L9qdncgbrceYjsDenZ2dnUVZ_sqdnZ2d@centurytel.net, Fred Marshall at
fmarshallx@remove_the_x.acm.org wrote on 10/24/2005 12:59:

> "So, the number of "taps" depends on both the equation for the filter and > the > *architectural form* that's selected." [emphasis added] > > Thus addressing DF2, brothers and cousins ... > > Also: > > "Another answer: from the diagram above, count the coefficients b0, a1, b1 > ....an,bn" > > which I believe is 2*order+1.... or as close as I'm gonna get.
admittedly, i didn't see the text under the diagram. and this
> 1 delay -> 2 "taps" maximum > 2 delays -> 3 "taps" maximum
somehow caused my eyes to jump over your other words. my bad. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by Fred Marshall October 24, 20052005-10-24
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:BF827CE5.B7D0%rbj@audioimagination.com...
> > but it seems that Fred is assuming Direct Form 2 (which i never use > anymore). it seems to me, from a functional or operational POV that the > feedback path on the same "tap" should count separately to the feedforward > path. that would make it n_taps = 2*order+1, same as for DF1. this is > maybe getting to anal, even for me. >
r b-j Fred said: "So, the number of "taps" depends on both the equation for the filter and the *architectural form* that's selected." [emphasis added] Thus addressing DF2, brothers and cousins ... Also: "Another answer: from the diagram above, count the coefficients b0, a1, b1 ....an,bn" which I believe is 2*order+1.... or as close as I'm gonna get. Fred
Reply by Jerry Avins October 24, 20052005-10-24
robert bristow-johnson wrote:
> in article --ydnXnVAMOCacHeRVn-tQ@rcn.net, Jerry Avins at jya@ieee.org wrote > on 10/24/2005 10:47: > > >>Fred Marshall wrote: >> >>>"Jake" <wh@ever.com> wrote in message news:435BF765.66DB2BA3@ever.com... >>> >>> >>>>How many taps does an iir filter have? TIA. >>> >>> >>>Let's get real about the semantics: >> >>... >> >> >>>One answer: from the diagram above, count the delays and add one. >>> >>>Another answer: from the diagram above, count the coefficients b0, a1, b1 >>>....an,bn >> >>... >> >>Thanks, Fred. You straightened out my thinking in the subject. > > > but it seems that Fred is assuming Direct Form 2 (which i never use > anymore). it seems to me, from a functional or operational POV that the > feedback path on the same "tap" should count separately to the feedforward > path. that would make it n_taps = 2*order+1, same as for DF1. this is > maybe getting to anal, even for me.
Don't beat on yourself! :-) I didn't write that I accepted Fred's numbers, only that I liked his approach to the issue better than my fumbling. 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;