# Notch Filter with given Bandwidth

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!

• Why not iirnotch(520/8000,100/8000)? – Florian May 16 at 16:11
• Maybe 520/4000 would be better – Stanley Pawlukiewicz May 16 at 16:29
• yes, I think it would. Recall that relative frequency is taken from the Nyquist frequency rather than the sample rate. – Thefoilist May 16 at 18:48
• @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! – Tim Hilt May 16 at 19:03
• 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 – Thefoilist May 18 at 1:00