Design Notching Filter for different frequencies

22 ビュー (過去 30 日間)
Abdulrahman
Abdulrahman 2014 年 8 月 5 日
編集済み: Neema Joseph 2018 年 11 月 21 日
Hi,
I want to design a filter with Notches in different frequencies. The MATLAB give the option for one Notch only:
F0 = 60; % interference is at 60 Hz
Fs = 3000; % sampling frequency is 3000 Hz
BW=1;
f = fdesign.notch('N,F0,BW',2,F0,10,Fs);
h = design(f,'SystemObject',true);
hfvt= fvtool(h,'Color','white');
Any idea how to filter the other frequencies?

採用された回答

Nade Sritanyaratana
Nade Sritanyaratana 2014 年 8 月 5 日
You can use dfilt.cascade to combine filters in series.
In the following code, I create two notch filters, and cascade them together.
F0 = 60; % interference is at 60 Hz
Fs = 3000; % sampling frequency is 3000 Hz
BW=1;
f = fdesign.notch('N,F0,BW',2,F0,10,Fs);
h = design(F);
hfvt= fvtool(h,'Color','white');
f2 = fdesign.notch('N,F0,BW',2,F0+300,10,Fs);
h2 = design(f2);
hfvt= fvtool(h2,'Color','white');
hd = dfilt.cascade(h, h2);
hfvt= fvtool(hd,'Color','white');
  2 件のコメント
Abdulrahman
Abdulrahman 2014 年 8 月 6 日
It works when I tried to use different version of MATLAB. But still I don't know how to plot the bode plot of the overall filter?
Nade Sritanyaratana
Nade Sritanyaratana 2014 年 8 月 6 日
One quick correction to the code I provided:
After the line:
f = fdesign.notch('N,F0,BW',2,F0,10,Fs);
Correct the following line:
h = design(f);
In other words, F should be f.
Regarding the Bode plot of the composite filter, the last line I provided should have displayed the magnitude response:
hfvt= fvtool(hd,'Color','white');
Did this not work for you? Here's a screenshot of what I'm getting:
The "Analysis" menu provides the option to also look at the phase response, if desired.
Lastly, there are three more methods that simply plot the Bode plots for magnitude, phase, or both - Magnitude response:
>> hd.magresp;
Phase response:
>> hd.phaseresp;
Both:
>> hd.freqresp

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

その他の回答 (1 件)

Neema Joseph
Neema Joseph 2018 年 11 月 21 日
編集済み: Neema Joseph 2018 年 11 月 21 日
can you please help to write the output of cascaded filter in case of an audio input

カテゴリ

Help Center および File ExchangeFilter Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by