iirnotch filter and q-factor

16 ビュー (過去 30 日間)
Peter
Peter 2013 年 10 月 8 日
コメント済み: NASRIN AKTER 2021 年 9 月 8 日
Dear all, I'm using an iirnotch or iircomb filter to remove 60Hz from my recorded signal. Following matlab help it is easy to implement the code
fs = 20000; fo = 60; q = 35; bw = (fo/(fs/2))/q;
[b,a] = iircomb(fs/fo,bw,'notch'); % Note type flag 'notch'
fvtool(b,a);
But I really do not understand what the quality factor q is for. Matlab usually recommend a setting with 35. But what exactly do I set there? I'm really looking forward to a bit of information... Thanks a lot! Peter

採用された回答

Wayne King
Wayne King 2013 年 10 月 8 日
編集済み: Wayne King 2013 年 10 月 8 日
The above code will not work because you end up with a non-integer filter order. The filter order has to be an integer.
Having said that, the quality factor is the center frequency divided by the bandwidth. The higher q, the narrower the notch.
You can see this in the zplane by looking at the position of the poles with respect to the zeros.
Fs = 600; Fo = 60; Q = 35; BW = (Fo/(Fs/2))/Q;
[b,a] = iircomb(Fs/Fo,BW);
zplane(b,a)
Zoom in on one of the pole-zero pairs in the above, you'll see the pole very close to the zero on the unit circle.
You can also see the widith of the notches by looking at the magnitude in the frequency domain
fvtool(b,a)
Now relax the Q factor, or equivalently increase the bandwidth of the notch
Q = 10;
BW = (Fo/(Fs/2))/Q;
[b,a] = iircomb(Fs/Fo,BW);
zplane(b,a)
Now you see the pole has moved further away from the zero on the unit circle. To see the notches widening in the frequency domain use
fvtool(b,a)
  3 件のコメント
Seth Cattanach
Seth Cattanach 2017 年 4 月 22 日
編集済み: Seth Cattanach 2017 年 4 月 22 日
I'm trying to remove a specific tone (frequency) from a recorded audio sample (a song with a tone played over it). I have code written that identifies the tone, and I tried to use the iircomb function to design a notch filter and remove this frequency.
The code I'm using doesn't give any errors, but it doesn't seem to work - the output audio signal is much too short compared to the input audio signal. Here's the code:
Q = 35;
bw = maxFreq/(Fs/2)/Q;
[b,a] = iircomb(round(Fs/maxFreq),bw);
yOut = filter(yAudio,a,b);
sound(yOut,sampleRate);
...where yAudio is the recorded (input) audio signal, sampleRate is 44100 (times per second), maxFreq is the identified frequency I'm trying to remove, and yOut is the output audio signal I want to obtain.
How can I do this / why isn't this design working? When I debug this function, I see that 'a' and 'b' are of size 1x65, but the original input audio signal yAudio is 235200x1 (this varies depending on the length of time I record the sample).
Thanks!
NASRIN AKTER
NASRIN AKTER 2021 年 9 月 8 日
Hello
What to do if the Fs/Fo value is not an integer? How to deal with that?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio Processing Algorithm Design についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by