0% found this document useful (0 votes)
37 views7 pages

Digital Signal Processing: Lab Task No 4

This document contains the work of two students - Muhammad Ali and Shahid Rasool - for their Digital Signal Processing lab task #4 on September 24, 2014. It includes MATLAB code to generate and plot various signals including unit impulse, unit step, complex exponentials, cosine waves, and decaying exponentials. Plots with labeled axes are generated for each signal to analyze and observe its characteristics.

Uploaded by

TRUE LOVERS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views7 pages

Digital Signal Processing: Lab Task No 4

This document contains the work of two students - Muhammad Ali and Shahid Rasool - for their Digital Signal Processing lab task #4 on September 24, 2014. It includes MATLAB code to generate and plot various signals including unit impulse, unit step, complex exponentials, cosine waves, and decaying exponentials. Plots with labeled axes are generated for each signal to analyze and observe its characteristics.

Uploaded by

TRUE LOVERS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Digital Signal Processing

Lab Task No 4

Group Members

 Muhammad Ali CIIT/SP12-BSEE-024/ATK

 Shahid Rasool CIIT/SP12-BSEE-024/ATK

Wednesday, September 24, 2014


clear all;
close all;
n=-10:10;
xi=n==0;%unit impulse
figure(1)
stem(n,xi)

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

You might also like