%
% Chebyshev lowpass design
%
% Step 1: determine specs
wph=100; wsh=200; Gp=-2; Gs=-25;

% Step 2: determine n
r=-Gp;
P1=-Gs/10; P2=r/10; Wsp=wsh/wph;
nc=acosh( sqrt( (10^P1-1)/(10^P2-1) ) )/(acosh(Wsp));
n= ceil(nc);
fprintf('Filter order is %i\n', n)

% Step 3: determine transfer function of prototype low pass
[num1, den1] = cheby1(n, r, wph, 's');

% Display prototype low pass transfer function
disp('The prototype lowpass transfer function is')
format short e
num1, den1
