MATLAB script:
clc;close all;clear all;
%specifications for HPF
Fs=1500;%sampling frequency
%cut offf frequency
wp=2*500/Fs;
%Elliptic Filter design for order 8
Rp=1;Rs=60;%Assumption
%elliptic returns 2n order transfer function.
% Hence enter order =4 for 8th order filter
[b,a] = ellip(4,Rp,Rs,wp,'high');
w=0:pi/1000:pi
H1=freqz(b,a,w);
%Elliptic Filter design for order 32
[b,a] = ellip(16,Rp,Rs,wp,'high');
H2=freqz(b,a,w);
figure;
subplot(211)
plot(w/pi,(abs(H1)),'r','LineWidth',3);hold on;grid on;
plot(w/pi,(abs(H2)),'g','LineWidth',3);hold off;
legend('Elliptic for order 8','Elliptic for order 32')
xlabel('w X pi')
ylabel('|H(w)|')
title('Magnitude plot')
subplot(212)
plot(w/pi,20*log10(abs(H1)),'r','LineWidth',3);hold on;grid
on;
plot(w/pi,20*log10(abs(H2)),'g','LineWidth',3);hold off;
legend('Elliptic for order 8','Elliptic for order 32')
xlabel('w X pi')
ylabel('|H(w)| in db')
title('Log Magnitude plot')
Get Answers For Free
Most questions answered within 1 hours.