Beruflich Dokumente
Kultur Dokumente
COMSATS INSTITUTE OF
INFORMATION TECHNOLOGY,ISLAMABAD
DIGITAL SIGNAL PROCESSING
LAB MANUAl
LAB REPORT :01
Lab Tasks
x=2*cos(t);
t=1:2:10;
Plot (t,x);
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.
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.
= -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.
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.
b. x[n] = an u[n]
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