You are on page 1of 5

Digital Signal Processing Laboratory

Experiment 1:
1. To Discrete linear signal
CODE

X=[1,2,3,4,5,6,7];

Y=[-3,-2,-1,0,1,2,3];

stem(X,Y)

xlabel('sample')

ylabel('amplitude')

title('linear discrete signal')

GRAPH:
2. To Discrete linear signal
CODE

K=5;

X=0:pi/50:2*pi;

Y=K*sin(X);

stem(X,Y)

xlabel('X=0 : 2\pi')

ylabel('amplitude')

legend('sine wave')

title('sine discrete wave')

GRAPH:
Experiment 2:
1. Amplitude Shifting
k=3

X=[1,2,3,4,5];

a=length(X);

n=0:1:a-1;

subplot(3,1,1)

stem(n,X);

xlabel('no of sampel');

ylabel('amplitude');

title('input signal');

Y=k*X;

subplot(3,1,2)

stem(n,Y);

xlabel('no of sampel');

ylabel('amplitude');

title('scaling of input signal');

Z=X/k;

subplot(3,1,3)

stem(n,Z);

xlabel('no of sampel');

ylabel('amplitude');

title('scaling of input signal')


2. Time Shifting
k=3;

X=[1,2,3,4,5];

a=length(X);

n=0:1:a-1;

subplot(3,1,1)

stem(n,X);

xlabel('no of sampel');

ylabel('amplitude');

title('input signal');

Y=k*X;

subplot(3,1,2)

stem(n-2,Y);

xlabel('no of sampel');

ylabel('amplitude');

title('advance');

Z=X/k;

subplot(3,1,3)

stem(n+2,Z);

xlabel('no of sampel');

ylabel('amplitude');

title('delay ')
3. Time Reversal
k=3;
X=[1,2,3,4,5];
a=length(X);
n=0:1:a-1;
subplot(2,1,1)
stem(n,X);
xlabel('no of sampel');
ylabel('amplitude');
title('input signal');
Y=k*X;
subplot(2,1,2)
stem(-n,Y);
xlabel('no of sampel');
ylabel('amplitude');
title('reversal')

You might also like