fir and iir filtering
4 ビュー (過去 30 日間)
古いコメントを表示
can any one give me the code for fir and iir lowpass and highpass filters of a given input sequence. regards k.v.swamy
0 件のコメント
採用された回答
Wayne King
2012 年 3 月 19 日
You have to know your filter specifications. If you do, you can do both with fdesign.lowpass and fdesign.highpass
fdesign.lowpass and fdesign.highpass have different specification strings which support different filter designs.
The default string 'Fp,Fst,Ap,Ast' supports both FIR and IIR designs.
Here is an example:
Design a lowpass filter with a passband frequency of 1 kHz, a stopband frequency of 1.5 kHz, passband ripple of 0.5 dB, and stopband attenuation of 40 dB. The sampling frequency is 20 kHz
d = fdesign.lowpass('Fp,Fst,Ap,Ast',1e3,1.5e3,0.5,40,20e3);
designmethods(d) %shows which designs are valid for this spec
Hdeq = design(d,'equiripple'); % FIR filter
Hbutt = design(d,'butter'); %IIR design
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!