Lab No 02 (DSP) Tariq KAMAL (18) LAB TASK . Plotting The Following Programs and Generate Its RESPONSE
Lab No 02 (DSP) Tariq KAMAL (18) LAB TASK . Plotting The Following Programs and Generate Its RESPONSE
(DSP)
TARIQ
KAMAL (18)
LAB TASK.
PLOTTING THE FOLLOWING PROGRAMS AND GENERATE ITS
RESPONSE.
am
plitude
Graph
a
m
p
litu
d
e
b)shift of 325
n2=250:350;
x2=zeros(size(n2));% it will give all the zero
ind=find(n2==325)
x2(ind)=1;
figure(2);
stem(n2,x2);
grid on;
1
xlabel('n-axis');
0
.
9
ylabel('amplitude');
0
.
8
title('1*amplitude'
1
0
n
-a
x
is
1
2
1
4
1
6
1
8
2
0
1
*
a
m
p
l
i
t
u
d
e
0
.
7
0
.
6
0
.
5
0
.
4
0
.
3
0
.
2
0
.
1
0
2
5
0
2
6
0
2
7
0
2
8
0
2
9
0
3
0
0
n
a
x
i
s
3
1
0
3
2
0
3
3
0
3
4
0
3
5
0
LAB NO 02
(DSP)
TARIQ
KAMAL (18)
(c) x3(n)=3.6$(n-6)+2.4$(n+4)
1
*a
m
p
litu
d
e
amplitude
n3=-12:8;
x3=zeros(size(n3));% it will give all the zero
4
ind=find(n3==6)
x3(ind)=3.6;
3
.5
x4=zeros(size(n3));
3
ind=find(n3==-4);
2
.5
x4(ind)=2.4;
x5=x3+x4;
2
figure(3);
Graph
1
.5
stem(n3,x5);
1
grid on;
xlabel('n-axis');
0
.5
ylabel('amplitude');
0
-1
2
-1
0
-8
title('1*amplitude')
-6
-4
-2
n
-a
xis
(d)n4=-10:20;
1
*
a
m
p
l
i
t
u
d
e
0
.
8
0
.
6
a
m
p
litu
d
e
Graph.
0
.
4
0
.
2
0
0
.
2
0
.
4
0
.
6
0
.
8
1
1
0
5
n
a
x
i
s
1
0
1
5
2
0
LAB NO 02
(DSP)
TARIQ
KAMAL (18)
n=0:3:50
w=pi/16
x=cos(w.*n)
subplot(4,3,2)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=pi/16')
grid on
n=0:3:50
w=pi/8
x=cos(w.*n)
subplot(4,3,3)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=pi/8')
grid on
n=0:3:50
w=pi/4
x=cos(w.*n)
subplot(4,3,4)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=pi/4')
grid on
GRAPH..
GRAPH
GRAPH
GRAPH
LAB NO 02
(DSP)
KAMAL (18)
n=0:3:50
w=pi/2
x=cos(w.*n)
subplot(4,3,5)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=pi/2')
grid on
n=0:3:50
w=pi
x=cos(w.*n)
subplot(4,3,6)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=pi')
grid on
GRAPH
GRAPH
n=0:3:50
w=15*pi/8
x=cos(w.*n)
subplot(4,3,7)
GRAPH
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=15*pi/16')
grid on
n=0:3:50
w=15*pi/8
x=cos(w.*n)
subplot(4,3,8)
GRAPH
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=15*pi/8')
grid on
UNIVERSITY OF ENGINEERING AND TECHNOLOGY ABBOTTABAD CAMPUS
DATED: 20 SEP.2011
TARIQ
LAB NO 02
(DSP)
KAMAL (18)
n=0:3:50
w=7*pi/4
x=cos(w.*n)
subplot(4,3,9)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=7*pi/4')
grid on
n=0:3:50
w=3*pi/2
x=cos(w.*n)
subplot(4,3,10)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=3*pi/2')
grid on
n=0:3:50
w=2*pi
x=cos(w.*n)
subplot(4,3,11)
stem(n,x)
xlabel('n-axis')
ylabel('amplitude')
title('for w=2*pi')
grid on
GRAPH
GRAPH
GRAPH
TARIQ