DSPRelated.com
Forums

Gain of an IIR Filter

Started by gokul_s1 September 2, 2007
I have an IIR transfer function characterized by the rational Z-transform 

H(z) = (1 - a1*z^-1 - a2*z^-2)/(1 - b1*z^-1 - b2*z^-2)

How do I calculate the DC gain of this filter??

Thanks for your help

Gokul
On Sep 2, 6:09 pm, "gokul_s1" <swamy...@msu.edu> wrote:
> I have an IIR transfer function characterized by the rational Z-transform > > H(z) = (1 - a1*z^-1 - a2*z^-2)/(1 - b1*z^-1 - b2*z^-2) > > How do I calculate the DC gain of this filter??
2 questions for you to ask yourself. either will get you to where you want to be. how do you calculate the gain of the filter at any frequency? what z = to at DC?
> Thanks for your help
listen, you're not representing your alma mater very well. either you were gone or not paying attention that day, or your prof is really, really bad at teaching. in either case, it doesn't look like you read the book very far. r b-j
"gokul_s1" <swamygok@msu.edu> writes:

> I have an IIR transfer function characterized by the rational Z-transform > > H(z) = (1 - a1*z^-1 - a2*z^-2)/(1 - b1*z^-1 - b2*z^-2) > > How do I calculate the DC gain of this filter??
Hi Gokul, Simply let z = 1, i.e., compute H(1). That will be the DC gain (including a possible sign change). In general, the frequency response of a digital filter (IIR or FIR) is determined by evaluating H(z) at z = e^{j*2*pi*f*Ts}, where Ts is the sample period and f is the frequency at which the response is taken. So for f = 0 (DC), z = 1. -- % 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
Randy Yates <yates@ieee.org> writes:

> In general, the frequency response of a digital filter (IIR or FIR) > is determined by evaluating H(z) at z = e^{j*2*pi*f*Ts}, where Ts is > the sample period and f is the frequency at which the response is taken. > So for f = 0 (DC), z = 1.
Correction: the frequency response is the magnitude response, so you should compute |H(z)| at z = e^{j*2*pi*f*Ts}. -- % Randy Yates % "She has an IQ of 1001, she has a jumpsuit %% Fuquay-Varina, NC % on, and she's also a telephone." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr
robert bristow-johnson wrote:
> On Sep 2, 6:09 pm, "gokul_s1" <swamy...@msu.edu> wrote: >> I have an IIR transfer function characterized by the rational Z-transform >> >> H(z) = (1 - a1*z^-1 - a2*z^-2)/(1 - b1*z^-1 - b2*z^-2) >> >> How do I calculate the DC gain of this filter?? > > 2 questions for you to ask yourself. either will get you to where you > want to be. > > how do you calculate the gain of the filter at any frequency? > > what z = to at DC? > >> Thanks for your help > > listen, you're not representing your alma mater very well. either you > were gone or not paying attention that day, or your prof is really, > really bad at teaching. in either case, it doesn't look like you read > the book very far. > > r b-j >
Or he's an art major trying to animate a sculpture, in which case he's doing pretty well. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
Randy Yates wrote:
> Randy Yates writes: > > In general, the frequency response of a digital filter (IIR or FIR) > > is determined by evaluating H(z) at z = e^{j*2*pi*f*Ts}, where Ts is > > the sample period and f is the frequency at which the response is taken. > > So for f = 0 (DC), z = 1. > > Correction: the frequency response is the magnitude response, so you > should compute |H(z)| at z = e^{j*2*pi*f*Ts}.
I'm not sure if this correction is needed. To me, the frequency response is a complex-valued function. It can be factored into a magnitude response and phase response, ie. H(w) = |H(w)| exp(i arg(H(w))). JOS seems to agree: http://ccrma.stanford.edu/~jos/filters/Amplitude_Response_I_I.html Regards, Andor
On Sep 3, 11:21 am, Andor <andor.bari...@gmail.com> wrote:
> Randy Yates wrote: > > Randy Yates writes: > > > In general, the frequency response of a digital filter (IIR or FIR) > > > is determined by evaluating H(z) at z = e^{j*2*pi*f*Ts}, where Ts is > > > the sample period and f is the frequency at which the response is taken. > > > So for f = 0 (DC), z = 1. > > > Correction: the frequency response is the magnitude response, so you > > should compute |H(z)| at z = e^{j*2*pi*f*Ts}. > > I'm not sure if this correction is needed. To me, the frequency > response is a complex-valued function. It can be factored into a > magnitude response and phase response, ie. > > H(w) = |H(w)| exp(i arg(H(w))). > > JOS seems to agree:http://ccrma.stanford.edu/~jos/filters/Amplitude_Response_I_I.html
i tend to agree with Andor and JOS3. filters do two things to a sinusoid; they (may) change the amplitude and they (may) change the phase. "frequency response" means the total effect that the LTI system has on a complex sinusoid of a given frequency. for analog filters we plug in s = jw into H(s) and for digital filters we plug in z = e^(jw) into H(z). one thing i wouldn't do that JOS does is introduce the function G(w) for |H(jw)| or |H(e^(jw))|. i would leave G() available for the Laplace or Z transform of g(t) or g[n]. r b-j
robert bristow-johnson wrote:

(snip)

> i tend to agree with Andor and JOS3. filters do two things to a > sinusoid; they (may) change the amplitude and they (may) change the > phase. "frequency response" means the total effect that the LTI > system has on a complex sinusoid of a given frequency.
I might have missed the beginning, but as far as I know, in the audio field frequency response normally means amplitude and not phase. Also, in audio it sometimes comes with a distortion limit, audio systems being less and less linear at higher amplitudes. Not that phase isn't important, but the human auditory system is somewhat (not completely) insensitive to phase, and it isn't easy to control. For a loudspeaker it usually depends on position in the room which makes it hard to give a specific value. For other than audio systems, including phase makes a lot of sense. -- glen
On Sep 3, 6:30 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> robert bristow-johnson wrote: > > (snip) > > > i tend to agree with Andor and JOS3. filters do two things to a > > sinusoid; they (may) change the amplitude and they (may) change the > > phase. "frequency response" means the total effect that the LTI > > system has on a complex sinusoid of a given frequency. > > I might have missed the beginning, but as far as I know, in the > audio field frequency response normally means amplitude and not > phase. Also, in audio it sometimes comes with a distortion limit, > audio systems being less and less linear at higher amplitudes.
this is a semantic issue regarding literature about some devices. from a formal "signals and systems" or DSP POV, the term "frequency response" is consistently a complex function of a real variable and it is in the context of *only* linear systems (and usually time-invariant systems). if "distortion" is in the language, that use of the term "frequency response" is colloquial. "frequency response" it is what the system does to a sinusoid of a given frequency and what the system does to the sinusoid are two things. the use of the term "frequency response" to mean only "amplitude response" is colloquial and not formal, in the context of linear system theory (incl. linear DSP).
> Not that phase isn't important, but the human auditory system is > somewhat (not completely) insensitive to phase, and it isn't easy > to control. For a loudspeaker it usually depends on position in > the room which makes it hard to give a specific value.
that's clearly true. even if the loudspeaker is omni-directional, phase still depends on the distance one is away from the loudspeaker (the linear-phase term resulting from delay) and such a change in phase (from an isolated omni-directional loudspeaker) is not audible because it is just a very small delay and the listener has no reference to compare such listened audio to. when the delay is not constant over frequencies of interest (not linear phase), then it's a matter of degree for what the listener will detect. an APF with a feedback coefficient (and pole location) of 0.9 and a delay element of 1 second will easily be noticed and the amplitude response was not changed at all.
> For other than audio systems, including phase makes a lot > of sense.
this is a true (but misleading, IMO) statement. the qualification is not necessary. including phase for audio systems makes sense also. r b-j
robert bristow-johnson <rbj@audioimagination.com> writes:

> this is a semantic issue regarding literature about some devices. > from a formal "signals and systems" or DSP POV, the term "frequency > response" is consistently a complex function of a real variable and it > is in the context of *only* linear systems (and usually time-invariant > systems).
I do tend to blur these definitions sometimes. You, Andor, and JOSIII are of course correct. -- % Randy Yates % "She tells me that she likes me very much, %% Fuquay-Varina, NC % but when I try to touch, she makes it %%% 919-577-9882 % all too clear." %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO http://home.earthlink.net/~yatescr