Digital Signal Processing: Lab Task No 4
Digital Signal Processing: Lab Task No 4
Lab Task No 4
Group Members
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
%=========================================================
xs=n>=0; %unit step
figure(2)
stem(n,xs)
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
%=========================================================
Page 2 of 7
a= exp(0) +2 +(3/2)*exp(i*pi/3) +4*(4/(3*4*sqrt(2)))
magnitude=abs(a)
angl=angle(a)
Output
a=
4.6928 + 1.2990i
magnitude =
4.8693
angl =
0.2701
%=========================================================
b= cos(pi/2) + 7 + (9/2)*170
Output
b=
772
%=========================================================
Page 3 of 7
p=-4:2;
x3=[-1/2 1 2/4 0 1 -3 2];
figure(3)
stem(p,x3)
1.5
0.5
-0.5
-1
-1.5
-2
-2.5
-3
-4 -3 -2 -1 0 1 2
%=========================================================
q=-5:1;
x4=[0 1 4 3 -1 -2 3];
figure(4)
stem(q,x4)
-1
-2
-5 -4 -3 -2 -1 0 1
Page 4 of 7
%=========================================================
f=0.16;
w=2*pi*f;
n=-20:0.5:20;
x5= (3/2)*cos(w*n +(pi/2));
figure(5)
stem(n,x5)
1.5
0.5
-0.5
-1
-1.5
-20 -15 -10 -5 0 5 10 15 20
%=========================================================
f=0.04;
w=2*pi*f;
x6= (2)*cos(w*n +pi);
figure(6)
stem(n,x6)
1.5
0.5
-0.5
-1
-1.5
-2
-20 -15 -10 -5 0 5 10 15 20
Page 5 of 7
%=========================================================
n=-10:10;
x7=((0.8).^n).*xs;
figure(7)
stem(n,x7)
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
%=========================================================
x8= -2*(0.8*i).^n;
figure(8)
stem(n,x8)
20
15
10
-5
-10
-15
-10 -8 -6 -4 -2 0 2 4 6 8 10
Page 6 of 7
%=========================================================
n=-20:0.5:20;
c=x5+x6;
figure(9)
stem(n,c)
-1
-2
-3
-4
-20 -15 -10 -5 0 5 10 15 20
%=========================================================
d=(1/2)*x5 - 5/4*x6;
figure(10)
stem(n,d)
-1
-2
-3
-4
-20 -15 -10 -5 0 5 10 15 20
Page 7 of 7