%% Measure the Filter Specifications
% Create a lowpass filter and check whether the actual filter meets the specifications. For this case, use normalized frequency for Fs, the default setting.

desigLowpass = fdesign.lowpass('Fp,Fst,Ap,Ast',0.45,0.55,0.1,80)

%

designmethods(desigLowpass,'SystemObject',true)

%
% Use the default equiripple design method.

equiFilter = design(desigLowpass,'SystemObject',true)

%
% Measure the specifications of the designed lowpass filter.

measure(equiFilter)

% Stopband Edge, Passband Edge, Passband Ripple, and Stopband Attenuation all meet the specifications.
%
% Now, using Fs in linear frequency, create a bandpass filter, and measure the magnitude response characteristics.

designBandpass = fdesign.bandpass

%
% Convert to Linear Frequency.

normalizefreq(designBandpass,false,1.5e3)

%

bpFilter = design(designBandpass,'cheby2','SystemObject',true);

%
% Measure the specifications of the designed bandpass filter.

measure(bpFilter)

% Copyright 2012 The MathWorks, Inc.