Design Notching Filter for different frequencies
22 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Nade Sritanyaratana
2014-8-5
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 个评论
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
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Design 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!