MATLAB SIGNAL PROCESSING TOOLBOX 6 Bedienungsanleitung Seite 58

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 60
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 57
4 Filter Design with the FDATool GUI
4-20
Designing Filters Using Command Line Functions
You can specify and design filters at the command line using fdesign and design.
The use of fdesign and design provides a powerful and efficient way to specify and
implement digital filters. With fdesign and design, digital filter design is a two-
step process. In the first step, the user specifies the desired characteristics of the filter
and saves those specifications in a Filter Specification Object. In the second step, the
user implements the filter as a dfilt object, which can then be used to filter data. As an
example of this two-step process, we will design a lowpass filter for data sampled at 20
kHz. The desired passband frequency is 1 kHz with a stopband frequency of 1.2 kHz.
We will limit the passband ripple to 1 dB and require 60 dB of attenuation between the
passband and stopband frequencies.
1
To specify the filter use fdesign.lowpass with the parameters given above. You
can copy and paste the following code at the MATLAB command prompt.
d=fdesign.lowpass('Fp,Fst,Ap,Ast',1000,1200,1,60,20000);
2
To design the filter use design with the appropriate design methods. In this
example, we create FIR equiripple and IIR Butterworth designs and compare the
filters' magnitude responses.
Hd1=design(d,'equiripple'); %FIR equiripple design
Hd2=design(d,'butter'); %Butterworth design
Hd=[Hd1 Hd2];%filter object with both designs
%compare filters
fvtool(Hd,'legend','on'); axis([0 2 -70 10])
Seitenansicht 57
1 2 ... 53 54 55 56 57 58 59 60

Kommentare zu diesen Handbüchern

Keine Kommentare