Professional Documents
Culture Documents
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Coding: (b) Unit step function u (n)
n= input('enter value of n=');
x=-n:n;
y=-n:n;
for i=1:((2.*n)+1);
if(i>=n+1)
y(1,i)=1;
else
y(1,i)=0;
end
end
stem(x,y)
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
4.5
3.5
2.5
1.5
0.5
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Coding: (b) Unit step function u (n)
n=input('enter value of n=');
u=zeros(1,((2.*n)+1));
for j=1:((2.*n)+1);
y=zeros(1,((2.*n)+1));
x=-n:n;
for i=1:((2.*n)+1);
if(i==n+j)
y(1,i)=1;
else
y(1,i)=0;
end
end
u=u+y
end
stem(x,u)
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
10
0
-10 -8 -6 -4 -2 0 2 4 6 8 10
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
Coding: (b) Unit step function u (n)
n= input('enter value of n=');
p= input('enter shift p=');
x=-n:n;
y=-n:n;
for i=1:((2.*n)+1);
if(i>=n+p+1)
y(1,i)=1;
else
y(1,i)=0;
end
end
stem(x,y)
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
4.5
3.5
2.5
1.5
0.5
0
-5 -4 -3 -2 -1 0 1 2 3 4 5
0
1 2 3 4 5 6 7
4
0
1 2 3 4 5 6 7
30
20
10
0
1 2 3 4 5 6 7
0
0 2 4 6 8 10 12 14 16
4
0
0 2 4 6 8 10 12 14 16
30
20
10
0
0 10 20 30 40 50 60 70
0
1 1.5 2 2.5 3 3.5 4
4
0
1 1.5 2 2.5 3 3.5 4
100
-100
1 1.5 2 2.5 3 3.5 4
20
10
0
1 1.5 2 2.5 3 3.5 4
The DFT of two sequences x1(k) = [6 0 2 0]
x2 (k) = [10 -2+j2 -2 -2-j2]
m = [14 16 14 16]
0
1 1.5 2 2.5 3 3.5 4
2
-2
1 1.5 2 2.5 3 3.5 4
10
0
1 1.5 2 2.5 3 3.5 4
5
-5
1 1.5 2 2.5 3 3.5 4
Objective: (a) To design low pass FIR Equiripple filter for the following specifications and plot
magnitude and phase plot.
Fs = 48000Hz
Fpass = 9600Hz
Fstop = 12000Hz
Apass = 1db
Astop = 80db
Filter order = minimum
Result: (a)
Magnitude Response (dB)
20
-20
-40
Magnitude (dB)
-60
-80
-100
-120
-140
0 5 10 15 20
Frequency (kHz)
Phase Response
0
-500
Phase (degrees)
-1000
-1500
-2000
-2500
0 5 10 15 20
Frequency (kHz)
Objective: (b) To design low pass IIR Butterworth filter for the following specifications and plot
magnitude and phase plot.
Fs = 48000Hz
Fpass = 9600Hz
Fstop = 12000Hz
Apass = 1db
Astop = 80db
Filter order = minimum
Result: (b)
Magnitude Response (dB)
500
-500
Magnitude (dB)
-1000
-1500
-2000
-2500
0 5 10 15 20
Frequency (kHz)
Phase Response
0
-500
-1000
Phase (degrees)
-1500
-2000
-2500
-3000
0 5 10 15 20
Frequency (kHz)
Filter Design and Analysis Tool
The filter design and analysis tool (FDA Tool) is a user interface for designing and analyzing filters
quickly. FDA Tool enables one to design digital FIR or IIR filters by setting filter specifications, by
importing filters from MATLAB workspace, or by adding, moving or deleting poles and zeros. FDA Tool
also provides tools for analyzing Filter, such as magnitude and phase response and pole-zero plots.