Design an elliptic digital filter with bandpass frequency response. The filter design procedure is:
Specify the filter design specifications using a fdesign function.
Pick a design method provided by the designmethods function.
To determine the available design options to choose from, use the designoptions function.
Design the filter using the design function.
Construct the default bandpass filter specification object using fdesign.bandpass.
designSpecs = fdesign.bandpass
designSpecs =
bandpass with properties:
Response: 'Bandpass'
Specification: 'Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2'
Description: {7x1 cell}
NormalizedFrequency: 1
Fstop1: 0.3500
Fpass1: 0.4500
Fpass2: 0.5500
Fstop2: 0.6500
Astop1: 60
Apass: 1
Astop2: 60
Determine the available design methods using the designmethods function. To design an elliptic digital filter, pick ellip.
designmethods(designSpecs,'SystemObject',true)
Design Methods that support System objects for class fdesign.bandpass (Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2):
butter
cheby1
cheby2
ellip
equiripple
kaiserwin
While designing the filter, you can specify additional design options. View a list of the options using the designoptions function. This function also shows the default design options the filter uses.
designoptions(designSpecs,'ellip','SystemObject',true)
ans = struct with fields:
FilterStructure: {1x6 cell}
SOSScaleNorm: 'ustring'
SOSScaleOpts: 'fdopts.sosscaling'
MatchExactly: {'passband' 'stopband' 'both'}
DefaultFilterStructure: 'df2sos'
DefaultMatchExactly: 'both'
DefaultSOSScaleNorm: ''
DefaultSOSScaleOpts: [1x1 fdopts.sosscaling]
Use the design function to design the filter. Pass 'ellip' and the specifications given by the variable designSpecs, as input arguments. Specify the 'matchexactly' design option to 'both' to ensure the performance of the filter in both the passband and the stopband regions.
bandpassEllip = design(designSpecs,'ellip','matchexactly','both',...
'SystemObject',true)
bandpassEllip =
dsp.BiquadFilter with properties:
Structure: 'Direct form II'
SOSMatrixSource: 'Property'
SOSMatrix: [4x6 double]
ScaleValues: [5x1 double]
InitialConditions: 0
OptimizeUnityScaleValues: true
Show all properties
Use fvtool to view the frequency response of the designed filter.
fvtool(bandpassEllip)