You are on page 1of 2

% Mohamed Adel Mokhtar

% 18104047

clc; clear all; close all;

N=5; fc=2*(10^9); wc=2*pi*fc;

[b1,a1]=butter(N,2*wc,'s');
[ht1,w1]=freqs(b1,a1,500);
f1=w1/(2*pi);
ht1db=mag2db(abs(ht1));

[b2,a2]=butter(N,wc,'s');
[ht2,w2]=freqs(b2,a2,500);
f2=w2/(2*pi);
ht2db=mag2db(abs(ht2));

[a3,b3]=cheby1(N,2,wc,'s');
[ht3,w3]=freqs(a3,b3,500);
f3=w3/(2*pi);
ht3db=mag2db(abs(ht3));

figure
plot(f1,ht1db);
hold on
plot(f2,ht2db);
hold on
plot(f3,ht3db);
xlim([0 4*(10^9)]); ylim([-40 0]);
xlabel('Freuency (GHZ)'); ylabel('Attenution (db)');
title('Amplitude response');
legend('Linear Phase','Maximally flat','Equal ripples');
grid on;

1
Published with MATLAB® R2018a

You might also like