Effacer les filtres
Effacer les filtres

fir and iir filtering

3 vues (au cours des 30 derniers jours)
k.v.swamy
k.v.swamy le 19 Mar 2012
can any one give me the code for fir and iir lowpass and highpass filters of a given input sequence. regards k.v.swamy

Réponse acceptée

Wayne King
Wayne King le 19 Mar 2012
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

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by