%% Determine if Filter Has Minimum Phase and is Stable
% Design a Chebyshev Type I IIR filter and determine if the filter has minimum phase and is stable.
%
% Using the fdesign.lowpass and design functions, design a Chebyshev Type I IIR filter with a passband ripple of 0.5 dB and a 3 dB cutoff frequency at 9600 Hz.

Fs = 48000; % Sampling frequency of input signal
d  = fdesign.lowpass('N,F3dB,Ap', 10, 9600, .5, Fs);
filt = design(d,'cheby1','Systemobject',true)

% Using the isminphase function, determine if the filter has minimum phase.

isminphase(filt)

% Verify the location of poles and zeros of the filter transfer function on the z-plane. By definition, the poles and zeros of the minimum phase filter must be on or inside the unit circle.

zplane(filt)

% All minimum phase filters are stable. To verify if the designed filter is stable, use the isstable function.

isstable(filt)

%
% Copyright 2020 The MathWorks, Inc.