
Design a low pass filter using kaiser window
16 ビュー (過去 30 日間)
古いコメントを表示
I need to setup a FIR filter for a signal with pass band cutoff 3.2 Hz, stop band cutoff 4.8 Hz, pass band ripple 0.1 dB, stop band attenuation 44 dB and sample frequency 16 Hz
After reading the documentation I tried this. Is the implementation correct?
[n,Wn,beta,ftype] = kaiserord([3.2 4.8],[1 0],...
[0.1 44],16);
b = fir1(n,Wn,ftype,kaiser(n+1,beta),'noscale');
c = kaiserord([3.2 4.8],[1 0],[0.1 44],16,'cell');
bcell = fir1(c{:});
hfvt = fvtool(b,1,bcell,1);
legend(hfvt,'b','bcell');
0 件のコメント
採用された回答
John BG
2016 年 12 月 18 日
Like Start Strider points out you can manually key in filter parameter in the fvtool GUI, but can also key in all fvtool parameters in a single MATLAB line:
LpFilt = designfilt('lowpassfir', ...
'PassbandFrequency',0.2, ...
'StopbandFrequency',30, ...
'PassbandRipple',0.1, ...
'StopbandAttenuation',44, ...
'SampleRate',100, ...
'DesignMethod','kaiserwin');
figure(1);fvtool(LpFilt)

the following filters test noise through this LPF .
dataIn = rand(1000,1);
dataOut = filter(LpFilt,dataIn);
subplot(2,1,1);plot(dataIn);title('input noise')
subplot(2,1,2);plot(dataOut);title('LPF Kai filtered noise')
.
would it be possible to let us the readers know what book are these exercises from?
.
if you find these lines useful would you please mark my answer as Accepted Answer?
To any other reader, please if you find this answer of any help, please click on the thumbs-up vote link,
thanks in advance for time and attention
John BG
0 件のコメント
その他の回答 (1 件)
Star Strider
2016 年 12 月 16 日
For what it’s worth, it seems to me to do what you designed it to do. In the fvtool GUI, you need to open the ‘Analysis’ tab and enter your sampling frequency (the last item in the drop-down menu) to verify the frequencies of the passband and stopband.
2 件のコメント
Star Strider
2016 年 12 月 16 日
The frequencies you calculated from the radian frequencies are approximately correct (you rounded them to the nearest 0.1). By that criterion, the filter is correct. I don’t recognise the notation of ‘Ap’ and ‘Aa’, so I assume you interpreted them correctly. (I can’t find my copy of Antoniou just now.) Your filter has about 40 dB stopband ripple and about 20 dB stopband attenuation. I didn’t specifically measure the passband ripple, but it looks correct.
参考
カテゴリ
Help Center および File Exchange で Kaiser についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
