フィルターのクリア

How to design a FIR filter with two pass bands

4 ビュー (過去 30 日間)
Abdul Sajeed Mohammed
Abdul Sajeed Mohammed 2020 年 12 月 29 日
編集済み: Abdul Sajeed Mohammed 2020 年 12 月 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 件のコメント
Abdul Sajeed Mohammed
Abdul Sajeed Mohammed 2020 年 12 月 29 日
Thank you for your response.
Star Strider
Star Strider 2020 年 12 月 29 日
My pleasure!

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

カテゴリ

Help Center および File ExchangeDigital Filter Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by