0
$\begingroup$

I started studying DSP recently. In my MATLAB assignments, I am often asked to plot the frequency response of a digital filter using freqz. I know there's another function for plotting a frequency response, bode.

In my last assignment, I was asked to design a notch filter for $60\textrm{ Hz}$ with a sampling frequency of $200\textrm{ Hz}$. After doing so, I plotted the frequency response using freqz, which gave me the expected result - the notch was on $60\textrm{ Hz}$:

freqz plot

However, when I plot the frequency response using bode, the frequency is off significantly:

enter image description here

To my understanding, both functions measure the frequency response. Why is one giving me the correct result then, when the other is not?

$\endgroup$

1 Answer 1

1
$\begingroup$

freqz() plot uses a discrete-time frequency axis, linearly scaled, between $0$ and $1$, ($\times \pi$) radians per sample. For 200 Hz sampling frequency, a 60 Hz notch would be shown at $w_c = 0.6 \pi$ rads, which is put at frequency 0.6.

The Bode-plot, however, uses a logarithmic scale for the continuous-time radian frequency $\Omega$. Given that you have a notch frequency of $60$ Hz, corresponding radian value is $\Omega_c = 2\pi \times 60 \approx 377$ radians per second.

So both plots are showing the notch at the correct place.

$\endgroup$
1
  • 1
    $\begingroup$ Thank you. I screwed up the conversion from Hz to radians. $\endgroup$
    – Mu3
    May 31, 2017 at 21:47

Your Answer

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

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