You are on page 1of 3

ASSIGNMENT NO:14

Q:1 Design band pass filter using r1=2K ,r2=500 ,c1=1F and
c2=0.1F.
Ans:
clear all
close all
clc
a=2000;
b=500;
c=0.000001;
d=0.0000001;
f=1:20000
for i=1:20000
g(i)=1/(1-(j/(2*pi*f(i)*a*c)));
h(i)=1/(1+(j*2*pi*f(i)*b*d));
k(i)=g(i)*h(i);
end
semilogx(f,abs(k),f,0.707);
xlabel('f')
ylabel('gain')
title('frequency gain response for band pass filter'

frequency gain response for band pass filter


1

0.9

0.8
X: 82
Y: 0.707

0.7

gain

0.6

0.5

0.4

0.3

0.2

0.1

0
0
10

10

10

10
f

10

10

Q:2 Design high pass, low pass and band pass filter using r and l
components.
Ans:
clear all
close all
clc
r1=100;
l1=0.1;
r2=10;
l2=0.1;
f=1:20000;
for i=1:20000
a(i)=(j*2*pi*f(i)*l1)/(r1+(j*2*pi*f(i)*l1));
b(i)=r2/(r2+(j*2*pi*f(i)*l2));
c(i)=a(i)*b(i);
end
subplot(3,1,1)
semilogx(f,abs(a),f,0.707)
xlabel('f')
ylabel('gain')
title('high pass filter')
subplot(3,1,2)
semilogx(f,abs(b),f,0.707)
xlabel('f')
ylabel('gain')
title('low pass filter')
subplot(3,1,3)
semilogx(f,abs(c))
xlabel('f')
ylabel('gain')
title('band pass filter'

high pass filter


gain

1
0.5
0
0
10

10

10

10

10

10

f
low pass filter
gain

1
0.5
0
0
10

10

10

10

10

10

f
band pass filter
gain

0.1
0.05
0
0
10

10

10

10
f

10

10

You might also like