Sie sind auf Seite 1von 7

Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

COMSATS INSTITUTE OF
INFORMATION TECHNOLOGY,ISLAMABAD
DIGITAL SIGNAL PROCESSING
LAB MANUAl
LAB REPORT :01

NAME: SHAHERYAR ALAM KHAN

ROLL NO: FA16-ECE-102

SUBMITTED TO: Khurram Naveed

COMSATS Institute of Information Technology 1


Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

Lab Tasks

Task-1: Generate a Continuous time cosine signal and plot it.

x=2*cos(t);
t=1:2:10;
Plot (t,x);

Task-2: Generate a Discrete time exponential signal and plot it.

COMSATS Institute of Information Technology 2


Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

y=10*exp(t);
t=1:2:10;
Stem(y);

Task-3: Write a MATLAB program for the ‘running average’, a running total is a sequence of
partial sum of a given sequence/signal. For example, the running totals of the signal {a, b, c,
…}are a, a+b, a+b+c, ... Use that program to find the running total of the discrete time signal of
length N=100. Write your program so that it is flexible. That is, you should be able to invoke your
program from the command window as follows:

>> y=running_averagel(x)

function y=running_average(x)
y=0;
x=[1,2,6,40,-5];
L=length(x);
sum=0;
r=zeros(5);
For i=1:L
sum=sum+x(i);
r(i)=sum;
end
y=sum/L;
y=average(x)

where x is the input signal, and y is the running total of that signal.

COMSATS Institute of Information Technology 3


Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

Task-4: Write a program to compute the variance and mean of a signal x. The variance is defined
to be: where denotes the mean of the signal x. For signal x, use all the integers from 1 to 1000.

Task-5: Can you explain what the following program does:


L = length(x); for I

= 1: L if x (i) < 0 x (i)

= -1; end

end
Any value which zero, equal to zero or greater than zero is positive but any value which is less
than zero is negative.

COMSATS Institute of Information Technology 4


Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

Task-6: Generate a step sequence u [n] as described in In-Lab section, use it to generate an
impulse as δ [n] = u[n] – u[n-1].

Task-7: Generate an impulse sequence δ [n] as described in In-Lab section, use it to generate
step sequence.

n=-5:5;
x=[n>=0];
stem(n,x)

Task-8: Generate the following sequences using step and impulse sequence.

COMSATS Institute of Information Technology 5


Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

a. x[n] = u[n] – u[n-10]

b. x[n] = an u[n]

COMSATS Institute of Information Technology 6


Lab # 01 Introduction to Discrete Time Signal Processing on MATLAB

c. ∑an δ[n-k] , k = -10 to 10

Critical Analysis / Conclusion

(By Student about Learning from the Lab)

In this lab we have studied about the discrete-time signals and their representation in matlab.
In this lab we check the behavior of discrete time signals. We studied about all the logical
statements and operations also special characters. We understand the behavior of a signal with
step sequence and impulse response.

DSP LINK
https://www.dropbox.com/sh/9oyiy6mxx88yipm/AADQIssIRcJubpB8peMzesiQa?dl=0

COMSATS Institute of Information Technology 7

Das könnte Ihnen auch gefallen