I have to use Matlab with the iirnotch()-function to design a notch filter. The notch should sit at 520Hz, the Bandwidth should be 100Hz and I have a sampling frequency of 8000Hz.

The syntax for iirnotch() is

iirnotch(w0, bw)

See the example at the Mathworks-page. After reading the doc, i now know how i should use the w0 -property, but I don't really understand how I should use bw to include my given bandwidth!

  • $\begingroup$ Why not iirnotch(520/8000,100/8000)? $\endgroup$
    – Florian
    May 16 '19 at 16:11
  • 2
    $\begingroup$ Maybe 520/4000 would be better $\endgroup$
    – user28715
    May 16 '19 at 16:29
  • $\begingroup$ yes, I think it would. Recall that relative frequency is taken from the Nyquist frequency rather than the sample rate. $\endgroup$
    – Thefoilist
    May 16 '19 at 18:48
  • $\begingroup$ @Thefoilist You are all right. I managed to filter the given audiofile. However isn't the information on the mathworks-page a bit misleading? I thought i had to calculate the q-factor after reading the page! $\endgroup$
    – Tim Hilt
    May 16 '19 at 19:03
  • $\begingroup$ I don't think its misleading, especially when you look at the examples they give. I would agree it isn't exactly obvious though, which is why a lot of people end up using fdatool $\endgroup$
    – Thefoilist
    May 18 '19 at 1:00

Your Answer

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

Browse other questions tagged or ask your own question.