필터 지우기
필터 지우기

How to design a FIR filter with two pass bands

조회 수: 8 (최근 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 CenterFile Exchange에서 Digital Filter Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by