%% Design Minimum Order Elliptic Bandstop Filter
% Design a minimum order elliptic bandstop filter. 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 fdesign.bandstop in the default state and input the design specifications to the function.

bandstopSpecs = fdesign.bandstop(.3,.4,.6,.7,.5,60,1)

% Determine the available designmethods using the designmethods function. To design an elliptic filter, pick ellip.

designmethods(bandstopSpecs,'Systemobject',true)

% When designing the filter, you can specify additional design options. View a list of options using the designoptions function. The function also shows the default design options the filter uses.

designoptions(bandstopSpecs,'ellip')

% Use the design function to design the filter. Pass 'ellip' and the specifications given by the variable 'bandstopSpecs', as input arguments.

bsFilter = design(bandstopSpecs,'ellip','Systemobject',true)

% Visualize the frequency response of the designed filter.

fvtool(bsFilter)

%
% Copyright 2019 The MathWorks, Inc.