COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

FIR and IIR?

• Follow

```What I know is FIR system can only be non-recursive and IIR system can only
be recursive discrete system.

But I just read from one DSP book that FIR can also be recursive and IIR
can also be non-recursive discrete system.

Can anybody help me to understand this using an example?

Dhaval
```
 0

```Here's an example of a recursive FIR implementation:

http://cnx.org/content/m11918/latest/

To see the case of an non-recursive IIR filter, take a look at FIR least sq=
uares inverse filters.

A specific example, let g(n) =3D d(n) - a*d(n), for |a| < 1 (so it is minim=
um phase and the inverse is both causal and stable). Taking this approach, =
it can be shown that the FIR least squares inverse filter unit sample respo=
nse approaches the true inverse (which is an IIR filter) as N->inf, N being=
the number of taps[1]. I'm not sure if this is what the aforementioned boo=
k was referring to, but I hope it helps!

[1] Statistical Digital Signal Processing and Modeling (Monson H. Hayes 199=
6) pp169-172

Bryan
```
 0

```On Fri, 25 Feb 2011 10:09:26 -0600, Dhaval_DSP wrote:

> What I know is FIR system can only be non-recursive and IIR system can
> only be recursive discrete system.
>
> But I just read from one DSP book that FIR can also be recursive and IIR
> can also be non-recursive discrete system.
>
> Can anybody help me to understand this using an example?

It helps to understand the abbreviations: FIR stands for "Finite Impulse
Response", IIR stands for "Infinite Impulse Response".  You can _achieve_
a finite impulse response in a system with feedback, if you get all your
numbers right.  I'm not sure what your book is thinking, but you can't
achieve an infinite impulse response structure non-recursively unless you
have an infinite number of taps -- perhaps that's what they meant.

--
http://www.wescottdesign.com
```
 0

```Tim,

Under what conditions can a IIR be approximated by a non-linear
phase FIR? Do all pratically realizable stable IIR's have their
non-linear phase FIR as counterpart?

If I feed and impulse to IIR and truncate it's impulse response
using half-windowing, could I implement those IIR's as FIR's?
Not sure which window to use though? Any suggestions? Maybe dolph-
chebwin?

Regards
Bharat
```
 0

```On 02/25/2011 11:09 AM, Dhaval_DSP wrote:
> What I know is FIR system can only be non-recursive and IIR system can only be recursive discrete system.
>
> But I just read from one DSP book that FIR can also be recursive and IIR can also be non-recursive discrete system.
>
> Can anybody help me to understand this using an example?
>
> Dhaval

Hi Dhaval,

The increasingly popular CIC (cascaded integrator comb) filter is a
perfect example of a filter that has a finite impulse response but is
implemented recursively. It is a simple boxcar averager.

At least in the CIC case, this property comes from the identity

1 + z + z^2 + ... + z^n = (1 - z^(n+1)) / (1 - z) [complexvariables, section 7, exercise 18]

You may want to check out Rick Lyons latest book (3rd edition) [lyonsthird]---he
has more information on CIC filters than I've seen in any one text
book.

--Randy

@BOOK{complexvariables,
title = "{Complex Variables and Applications}",
author = "{Ruel~V.~Churchill, James~Ward~Brown}",
publisher = "McGraw-Hill",
edition = "fifth",
year = "1990"}

@BOOK{lyonsthird,
title = "{Understanding Digital Signal Processing}",
edition = "third",
author = "{Richard~G.~Lyons}",
publisher = "Prentice Hall",
year = "2011"}

--
Randy Yates                             Digital Signal Labs
919-577-9882                            http://www.digitalsignallabs.com
yates@digitalsignallabs.com

```
 0

```On Sat, 26 Feb 2011 11:21:24 -0600, bharat pathak wrote:

> Tim,
>
>     Under what conditions can a IIR be approximated by a non-linear
>     phase FIR? Do all pratically realizable stable IIR's have their
>     non-linear phase FIR as counterpart?
>
>     If I feed and impulse to IIR and truncate it's impulse response
>     using half-windowing, could I implement those IIR's as FIR's? Not
>     sure which window to use though? Any suggestions? Maybe dolph-
>     chebwin?
>
> Regards
> Bharat

I'm not sure what you mean by "half-window" -- just window the t > 0
part?  If that's what you mean, then yes, you could _approximate_ any
stable IIR with an FIR, and could approximate it ever better with ever-
longer FIR filters.

--
http://www.wescottdesign.com
```
 0

```Thanks Tim,

Bharat
```
 0

```Tim Wescott <tim@seemywebsite.com> wrote:
(snip)

>> Can anybody help me to understand this using an example?

> It helps to understand the abbreviations: FIR stands for "Finite Impulse
> Response", IIR stands for "Infinite Impulse Response".  You can _achieve_
> a finite impulse response in a system with feedback, if you get all your
> numbers right.  I'm not sure what your book is thinking, but you can't
> achieve an infinite impulse response structure non-recursively unless you
> have an infinite number of taps -- perhaps that's what they meant.

Yes, but most IIR aren't actually infinite with quantized data.
They usually go to zero (after rounding) at some point, unless they
go to an oscillating state.   So, if they actually are finite, then
it should be possible to replace one with a (likely long) FIR.

The convenience of IIR is that you get a long tail to the impulse
response with a small number of taps.

-- glen
```
 0

```On Sun, 27 Feb 2011 09:12:34 +0000, glen herrmannsfeldt wrote:

> Tim Wescott <tim@seemywebsite.com> wrote: (snip)
>
>>> Can anybody help me to understand this using an example?
>
>> It helps to understand the abbreviations: FIR stands for "Finite
>> Impulse Response", IIR stands for "Infinite Impulse Response".  You can
>> _achieve_ a finite impulse response in a system with feedback, if you
>> get all your numbers right.  I'm not sure what your book is thinking,
>> but you can't achieve an infinite impulse response structure
>> non-recursively unless you have an infinite number of taps -- perhaps
>> that's what they meant.
>
> Yes, but most IIR aren't actually infinite with quantized data. They
> usually go to zero (after rounding) at some point, unless they go to an
> oscillating state.

This brings up a really interesting issue.  If you have an IIR that has
an input that's a mix of an intended signal and random noise, and if that
random noise is of sufficiently high magnitude to randomize the least
significant bits of your filter states, then the filter will act like it
does not suffer from quantization noise, meaning that _in the expected
value_, the response will, indeed, bet infinite.

Yet in the real world, that can't be for any individual input sample,
because a collection of a finite number of state variables, each of which
can only take on a finite number of values, simply can't carry
information about an infinite number of past values.

I'm sure this conundrum is solvable if you feed it into the "math-o-
shredder" correctly, but I'm not sure how.

> So, if they actually are finite, then it should be
> possible to replace one with a (likely long) FIR.

See above.  _Certainly_ for anything that has an impulse response that is
absolute integrable you'll be able to come up with an arbitrarily close
approximation.

> The convenience of IIR is that you get a long tail to the impulse
> response with a small number of taps.

That's a good time domain way of looking at it.

In the frequency domain I'd word that as the IIR often gives you the best
bang for the buck in terms of filtering effectiveness vs. filter cost.

For a control system I'd point out that you almost always want your
compensator to be minimum phase, and that an IIR filter is a very low-
complexity way to make a minimum phase filter.

--
http://www.wescottdesign.com
```
 0

```Tim Wescott <tim@seemywebsite.com> wrote:
(snip, I wrote)

>> Yes, but most IIR aren't actually infinite with quantized data. They
>> usually go to zero (after rounding) at some point, unless they go to an
>> oscillating state.

> This brings up a really interesting issue.  If you have an IIR that has
> an input that's a mix of an intended signal and random noise, and if that
> random noise is of sufficiently high magnitude to randomize the least
> significant bits of your filter states, then the filter will act like it
> does not suffer from quantization noise, meaning that _in the expected
> value_, the response will, indeed, bet infinite.

Hmmm.  OK, say we put in an actual impulse (in addition to the noise).
Now, when the output (from the impulse) is enough below the output noise,
then you can't really say that you still see it.

> Yet in the real world, that can't be for any individual input sample,
> because a collection of a finite number of state variables, each of which
> can only take on a finite number of values, simply can't carry
> information about an infinite number of past values.

Also, the available state can only be in bits that are changing.

-- glen
```
 0

```On Mon, 28 Feb 2011 11:45:59 +0000, glen herrmannsfeldt wrote:

> Tim Wescott <tim@seemywebsite.com> wrote: (snip, I wrote)
>
>>> Yes, but most IIR aren't actually infinite with quantized data. They
>>> usually go to zero (after rounding) at some point, unless they go to
>>> an oscillating state.
>
>> This brings up a really interesting issue.  If you have an IIR that has
>> an input that's a mix of an intended signal and random noise, and if
>> that random noise is of sufficiently high magnitude to randomize the
>> least significant bits of your filter states, then the filter will act
>> like it does not suffer from quantization noise, meaning that _in the
>> expected value_, the response will, indeed, bet infinite.
>
> Hmmm.  OK, say we put in an actual impulse (in addition to the noise).
> Now, when the output (from the impulse) is enough below the output
> noise, then you can't really say that you still see it.

You can make that statement about continuous-value IIR filters, too.  I
was perfectly aware of this issue -- I'm just mentioning the conundrum.

>> Yet in the real world, that can't be for any individual input sample,
>> because a collection of a finite number of state variables, each of
>> which can only take on a finite number of values, simply can't carry
>> information about an infinite number of past values.
>
> Also, the available state can only be in bits that are changing.

I'm not sure what you mean by that.  My point was that if you have (say)
an IIR filter that has 4 32-bit states, then there's no way on earth that
you have more than 128 bits worth of information on past inputs.
Probably less, but certainly no more.

--
http://www.wescottdesign.com
```
 0

```Tim Wescott <tim@seemywebsite.com> wrote:
(snip)

>>> Yet in the real world, that can't be for any individual input sample,
>>> because a collection of a finite number of state variables, each of
>>> which can only take on a finite number of values, simply can't carry
>>> information about an infinite number of past values.

(then I wrote)

>> Also, the available state can only be in bits that are changing.

> I'm not sure what you mean by that.  My point was that if you have (say)
> an IIR filter that has 4 32-bit states, then there's no way on earth that
> you have more than 128 bits worth of information on past inputs.
> Probably less, but certainly no more.

Yes, I meant a lot less.  If your state has four 32 bit values, but,
after some short time (number of clock cycles), only the low three
bits are changing (the rest all zero), then there are only 12 bits
of state left.  (Or the high bits might switch between all zeros
and all ones, as a twos-complement value changes sign, while holding
only one bit of information.)

I might not wait out 128 bits of state, but can easily wait long
enough for 12 bits.

-- glen
```
 0

```>
> >>> Yet in the real world, that can't be for any individual input sample,
> >>> because a collection of a finite number of state variables, each of
> >>> which can only take on a finite number of values, simply can't carry
> >>> information about an infinite number of past values.
>
>
Tim,
I think your question/conundrum can be generalized to all forms of
dither.

How can a 16 bit value represent an infintie number of voltages?

I think the answer lies here:  The value is represented not by just a
single snapshot in time of the state of the system, but in the
sequence of states.  If you have an infinelty long sequence, you can
reperesent an infinite amount of values.

Mark
```
 0

```On 3/1/2011 6:47 AM, Mark wrote:
>>
>>>>> Yet in the real world, that can't be for any individual input sample,
>>>>> because a collection of a finite number of state variables, each of
>>>>> which can only take on a finite number of values, simply can't carry
>>>>> information about an infinite number of past values.
>>
>>
> Tim,
> I think your question/conundrum can be generalized to all forms of
> dither.
>
> How can a 16 bit value represent an infintie number of voltages?
>
> I think the answer lies here:  The value is represented not by just a
> single snapshot in time of the state of the system, but in the
> sequence of states.  If you have an infinelty long sequence, you can
> reperesent an infinite amount of values.
>
> Mark

I was never very good at modern control theory (mostly because in the
olden days it was presented as an exercise in math and not control
systems).  So forgive me if I don't understand the exact terms you're
using .. even if I think that I do.

I believe this:
- the state is the state at any single time.  Period.  So, some of the

- that the current state may have "historical significance" is just the
normal thing.

Take this example:

- put a unit sample into a filter.  It doesn't matter what kind of
filter it is.  Just a digital filter.

- we know that the filter dynamics will determine the future *states*
that result from the unit sample input.  And, in a linear system,
superposition will allow us to ponder those state contributions for just
this one input .. (an analytical statement).

- since it's a digital filter the states are held in memory with some
word length.  That limits the definition of "state" in the same way that
sampling or arithmetic limit the definition / representation of numbers.

I guess I was triggered by glen's:
"the available state can only be in bits that are changing."

"Changing" implies a temporal perspective.  But "state" doesn't.  So,
I'd say that the "available state" or simply "the state" doesn't care
how many bits changed since any of the previous states.  This is a
definitional matter and *not* about dynamical systems and their typical
behaviors (OLDEWCCs, etc.)

Here's an example:
Build a system (which you may not want to call a "filter" but....) that
captures the input at time=0 and saves it in a register.  Maybe it will
be used for future comparisons or something like that.  And, maybe it
won't be used for any output state at all (which I guess makes it
unobservable but I care not).  Let's say it's stored with 32 bits of
resolution.  By definition it doesn't change thereafter.  No bits are
changing.  But the state of that memory remains with full 32 bits
resolution.

I know that you guys know this.  Better than I.  It's about language,
usage.... etc.  I hope it's helpful and not a rant.

Fred

```
 0

```Well, now that I've opened my big mouth, I guess I should try to really

I believe these two situations are similar if not the "same":

- Sample data at 32 bits.  Present it to a filter or system with 24 bit
words.  System designed such that there's no overflow.

- Samples with only the 12 LSBs nonzero will show up in the
filter/system as zero values.

Similarly, a stable IIR filter will eventually present zero values to
word length.

So, what do we call this?

In practice there's an introduction of noise but isn't that the same
noise that we call quantization noise?  I mean, going from one value to
another by 1 bit is it and if it happens to be at zero then that's just
another transition.  At least at that point there'd be no more noise
introduced in a stable IIR, isn't that right?

Yeah,  I think that's it.  Another trivial observation.

So going back to the discussion of states:  the states are subject to
quantization / thus quantization noise.  But the number of bits involved
at any point in time is immaterial beyond that.

Fred

```
 0

```On Feb 26, 5:13=A0pm, Tim Wescott <t...@seemywebsite.com> wrote:
> On Sat, 26 Feb 2011 11:21:24 -0600, bharat pathak wrote:
> > Tim,
>
> > =A0 =A0 Under what conditions can a IIR be approximated by a non-linear
> > =A0 =A0 phase FIR? Do all pratically realizable stable IIR's have their
> > =A0 =A0 non-linear phase FIR as counterpart?
>
> > =A0 =A0 If I feed and impulse to IIR and truncate it's impulse response
> > =A0 =A0 using half-windowing, could I implement those IIR's as FIR's? N=
ot
> > =A0 =A0 sure which window to use though? Any suggestions? Maybe dolph-
> > =A0 =A0 chebwin?
>
> > Regards
> > Bharat
>
> I'm not sure what you mean by "half-window" -- just window the t > 0
> part? =A0If that's what you mean, then yes, you could _approximate_ any
> stable IIR with an FIR, and could approximate it ever better with ever-
> longer FIR filters.
>
> --http://www.wescottdesign.com

I think what he means by a "half window" is the something like the
second half of a symmetric window, aligned with the origin, so the
impulse response for small n is modified very little and the impulse
for large n is attenuated and finally truncated.  If you had a typical
IIR impulse response with most of its energy at the very beginning
(small n) and applied a typical window like a Hamming or Hann window,
you would destroy the frequency response in the process of truncating
the impulse response.

Dirk
```
 0

15 Replies
259 Views

Similiar Articles:

7/29/2012 7:18:28 PM