1
$\begingroup$

$H(z) = G\cdot\displaystyle\frac{2b_0\left(1-z^{-2}\right)}{1-2a_1z^{-1}-2a_2z^{-2}} + 1$

I have a data sheet with the above transfer function, I need to calculate its frequency response in code. I have the functions to calculate $b_0$, $a_1$, $a_2$ and $G$, but it has been a loooooong time since I have handled $H(z)$ transfer functions and I can't for the life of me remember how to work it out.

I have googled around and it mentions jw this and that and I have tried everything Ive found but I'm not getting a frequency response anything like what is expected.

I have a sampling rate of $48000\textrm{ Hz}$ and want to calculate the frequency response from $0-24000\textrm{ Hz}$ in $1\textrm{ Hz}$ steps.

Any help would be very much appreciated.

$\endgroup$

1 Answer 1

2
$\begingroup$

To get the frequency response, replace $z$ in $H(z)$ by $e^{j2\pi f/f_s}=\cos(2\pi f/f_s)+j\sin(2\pi f/f_s)$ where $f_s$ is the sampling frequency in Hz and $f$ is the desired frequency in Hz. This will give you the value of the frequency response at frequency $f$. Note that the frequency response is a complex function, so you might want to look at its magnitude.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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