You are on page 1of 2

Omar Ahmed Alsharif 18104021

clc;
clear all;
close all;
N=5;
fc=2*(10^9);
wc=2*pi*fc;
[b,a]=butter(N,2*wc,'s');
[ht,w]=freqs(b,a,500);
f=w/(2*pi);
htdb=mag2db(abs(ht));
[b1,a1]=butter(N,wc,'s');
[ht1,w1]=freqs(b1,a1,500);
f1=w1/(2*pi);
ht1db=mag2db(abs(ht1));
[c,d]=cheby1(N,2,wc,'s');
[ht2,w2]=freqs(c,d,500);
f2=w2/(2*pi);
ht2db=mag2db(abs(ht2));
plot(f,htdb);
hold on;
plot(f1,ht1db);
hold on;
plot(f2,ht2db);
xlim([0 4*(10^9)])
ylim([-40 0]);
xlabel('Freuency(GHZ)');
ylabel('Attenution(DB)');
title('Amplitude Response')
legend('Linear Phase N=5','Maximally Flat N=5','Equal Ripples N=5');
grid on;

1
Published with MATLAB® R2016a

You might also like