MATLAB CODE TO DESIGN A ELLIPTICAL LOW PASS FILTER

CODE:



clc;
clear all;
N = input('Order = ');
Fp = input('Passband edge frequency in Hz = ');
Rp = input('Passband ripple in dB = ');
Rs = input('Minimum stopband attenuation in dB = ');
% Determine the coefficients of the transfer function
[num,den] = ellip(N,Rp,Rs,2*pi*Fp,'s');
% Compute and plot the frequency response
omega = [0: 200: 12000*pi];
h = freqs(num,den,omega);
plot (omega/(2*pi),20*log10(abs(h)));
xlabel('Frequency, Hz'); ylabel('Gain, dB');




OUTPUT:



Order = 5
Passband edge frequency in Hz = 2000
Passband ripple in dB = 1
Minimum stopband attenuation in dB = 40


1 comments:

  1. how did you get this?
    omega = [0: 200: 12000*pi];

    ReplyDelete