1
$\begingroup$

Given a LTI-system $$y[n]=x[n]-2x[n-1]+y[n-1]- \frac{8}{9}y[n-2]$$

The transfer function $H(z)$ is: $$H(z) = \frac{1-2z^{-1}}{1-z^{-1}+ \frac{8}{9} z^{-2}} $$

How do I calculate the amplitude transfer function so I can plot a Bode diagram like this? (in hand, not in MATLAB)

enter image description here

I thought that I should substitue $z=e^{j\omega}$ in $H(z)$, but it doesn't seem to be right. I hope you guys can help me out.

$\endgroup$
  • $\begingroup$ Your method is right. Just plug $z=e^{j\omega}$ into the (stable) system's Transfer function $H(z)$. Then you should simplify the expressions, then compute the magnitude of it and insert into $20 \log_{10}(\cdot)$ $\endgroup$ – Fat32 May 29 '16 at 22:45
  • $\begingroup$ It might also be useful to recall Euler's formula $\text{e}^{j \omega} = \cos(\omega) + j \sin(\omega)$ for computing the the response. $\endgroup$ – Arnfinn May 29 '16 at 23:37
  • $\begingroup$ possible dup of this question. i have an answer that takes it a little different in that it has better numerical properties for low frequency and is simplified to as simple as it can get for a biquad (which this is). $\endgroup$ – robert bristow-johnson May 30 '16 at 2:57
1
$\begingroup$

There are many algebraic paths to get into the required expression some of them being long and tedious, while the others being shorter with a carefully choosen route.

Given : $$H(z) = \frac{ 1 - 2z^{-1} }{1 - z^{-1} + \frac{8}{9}z^{-2} }$$

To evaluate the corresponding Bode-Plot, by hand, we need to first derive the expression called as the Frequency Spectrum Magnitude $\lvert H(e^{j\omega})\rvert$ of $H(z)$, provided that the system is stable (i.e.all poles of $H(z)$ inside unit circle) And then compute:

$$20\log_{10}\left(\lvert H(e^{j\omega})\rvert\right),$$ to get the Magnitude in dB scale.

Let's proceed into the first step and plug $e^{j\omega}$ into $H(z)$ to get Frequency Response: $$H(e^{j\omega}) = \frac{ 1 - 2e^{-j\omega} }{1 - e^{-j\omega} + \frac{8}{9}e^{-2j\omega} }$$

As this is a complex valued rational fraction expression, it is equal to: $$H(e^{j\omega}) = \frac{P(e^{j\omega})}{Q(e^{j\omega})}$$

And from complex algebra, the magnitude of $H(e^{j\omega})$ is equivalent to: $$ \lvert H(e^{j\omega})\rvert = \frac{\lvert P(e^{j\omega})\rvert}{\lvert Q(e^{j\omega})\rvert}$$

Hence we need to compute the absolute values of the numerator and denumerator expressions, where the absolute value of a complex number is understood as: $$z=a+jb \implies \lvert z\rvert=(a^2+b^2)^{0.5}$$

Lets elaborate the Numerator: \begin{align} P(e^{j\omega}) &= 1 - 2e^{-j\omega} = \left(1-2\cos(\omega)\right) + j\left(2\sin(\omega)\right)\\ \lvert P(e^{j\omega})\rvert &= \left[\left(1-2\cos(\omega)\right)^2 + \left(2\sin(\omega)\right)^2\right]^{0.5}\\ \lvert P(e^{j\omega})\rvert &= \left[1+4\cos^2(\omega)-4\cos(\omega) + 4\sin^2(\omega)\right]^{0.5}\\ \lvert P(e^{j\omega})\rvert &= \left[5-4\cos(\omega)\right]^{0.5}\\ \end{align}

Also elaborate the Denumerator (Denominator I mean!): \begin{align} Q(e^{j\omega}) &= 1 - e^{-j\omega} + \frac 89 e^{-2j\omega} = e^{-j\omega} \left(e^{j\omega} - 1 + \frac 89 e^{-j\omega}\right)\\ \lvert Q(e^{j\omega})\rvert&=\lvert e^{-j\omega}\rvert\cdot \bigg\lvert \left(e^{j\omega} - 1 + \frac 89 e^{-j\omega}\right)\bigg\rvert\\ \lvert Q(e^{j\omega})\rvert&=\bigg\lvert \left(e^{j\omega} - 1 + \frac 89 e^{-j\omega}\right)\bigg\rvert\\ \lvert Q(e^{j\omega})\rvert&=\left[\left(\cos(\omega) - 1 + \frac 89 \cos(\omega)\right)^2 + \left(\sin(\omega) - \frac 89\sin(\omega)\right)^2\right]^{0.5}\\ \lvert Q(e^{j\omega})\rvert&=\left[\left(\frac{17}{9}\cos(\omega) - 1\right)^2 + \left(\frac 19 \sin(\omega)\right)^2\right]^{0.5}\\ \end{align}

As there seems no more useful simplifications, we can deduce $\lvert H(e^{j\omega})\rvert$ as: $$\lvert H(e^{j\omega})\lvert = \frac{\left[5-4\cos(\omega)\right]^{0.5}}{\left[\left(\frac{17}{9}\cos(\omega) - 1\right)^2 + \left(\frac 19\sin(\omega)\right)^2\right]^{0.5}}$$

The Bode plot takes the logarithm of this to produce the graph: $$\begin{align} \lvert H(e^{j\omega})\rvert_\text{dB} & \triangleq 20 \log_{10}\left(\lvert H(e^{j\omega})\rvert\right) \\ & = 20 \log_{10}\left(\frac{\left[5-4\cos(\omega)\right]^{0.5}}{\left[\left(\frac{17}{9}\cos(\omega) - 1\right)^2 + \left(\frac 19\sin(\omega)\right)^2\right]^{0.5}}\right)\\ & = 10 \log_{10}\left(\frac{5-4\cos(\omega)}{\left(\frac{17}{9}\cos(\omega) - 1\right)^2 + \left(\frac 19\sin(\omega)\right)^2}\right) \\ & = 10 \log_{10}\left(5-4\cos(\omega)\right) - 10 \log_{10}\left(\left(\tfrac{17}{9}\cos(\omega) - 1\right)^2 + \left(\tfrac 19\sin(\omega)\right)^2\right)\\ \end{align}$$

Which produces the same graph when compared with freqz([1 -2],[1 -1 8/9]) function of MATLAB to produce discrete time frequency response plot, for a linear frequency axis. In discrete time it is customary to use linear frequency axis rather than a logarithmic one as usual in continuous time Bode-Plots.

$\endgroup$
  • 1
    $\begingroup$ i love "Denumerator". i also did some simplification of the last dB equations. that "\big(" doesn't seem to work. $\endgroup$ – robert bristow-johnson May 30 '16 at 3:17
  • $\begingroup$ Thank you for the explanation! If i want to find and sketch the phase respons can i use this formula: $arctan(\frac{Im[ 1-2e^{-jqw}]}{Re[1-e^{-jw}+8/9e^{-2*w*j}} $ ? $\endgroup$ – yoyoyo jansen May 30 '16 at 7:02
  • $\begingroup$ @robert bristow-johnson :))) "Denumerator" is possibly the opposite of numerator, that ordinary people should be calling Denominator :)) I've looked up the dictionary and no such as thing as denumerator ever defined... $\endgroup$ – Fat32 May 30 '16 at 12:40
  • 1
    $\begingroup$ Denumerator and Remunerator? :-D $\endgroup$ – Peter K. May 30 '16 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.