How to design a FIR filter with two pass bands

4 次查看(过去 30 天)
I need to carry out a FIR type multiple bandpass filter of order 100 and want to know how can "firls function" be useful.
Given Data :
-Sampling frequency : 500Hz
- Center frequencies : 20 Hz and 180Hz
- Bandwidth amplitudes : 1 and 5
- Bandwidth : 20 Hz
- Width of the rise and fall regions : 15 Hz
Any documentation or help would be really appreciated.

回答(1 个)

Star Strider
Star Strider 2020-12-29
Try this:
Fs = 500; % Sampling Frequency
fcomb = [19 19.5 20.5 21 177 177.5 182.5 183]; % Frequency Vector
mags = [0 1 0 1 0]; % Magnitude Vector
dev = [0.5 0.1 0.5 0.1 0.5]; % Deviations
[n,Wn,beta,ftype] = kaiserord(fcomb,mags,dev,Fs);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');
figure
freqz(hh, 1, 2^20, Fs)
FrqLim = [0 250]; % Frequency Limits (Optional)
set(subplot(2,1,1), 'XLim',FrqLim) % Optional
set(subplot(2,1,2), 'XLim',FrqLim) % Optional
It should do what you want.
The ‘Optional’ set calls after freqz allow you to ‘zoom in’ on various parts of the spectrum if you want to, in order to see it more clearly and adjust the passbands to your requirements. Here, they are set to present the entire filter spectrum.
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Digital Filter Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by