Experiment 01
Experiment 01
: 01
Experiment Name: Representation of basic discrete time signals using MATLAB
Objectives:
(i) To get familiar with the basic discrete time signal
(ii) To see the output signal of the basic discrete signal
(iii)To verify the results with actual one
Theory: Discrete time signals are “the signals or quantities that can be defined and represented at certain
time instants of the sequence.” These are finite or countable sets of number sequences. They are also
called digitalized signals.
MATLAB Code:
Step Signal:
clc
clear all
N=input(' enter N ');
n=0:1:N;
y=[ones(1,N+1)]
subplot(2,2,2)
stem(n,y)
grid on
title('step in 1st quadrant')
xlabel('n')
ylabel('Amplitude of step')
subplot(2,2,4)
stem(n,-y)
grid on
title('step in 4th quadrant')
xlabel('n')
ylabel('step of exponential')
n=-n;
y=y;
subplot(2,2,1)
stem(n,y)
grid on
title('step in 2nd quadrant')
xlabel('n')
ylabel('Amplitude of step')
y=-y;
subplot(2,2,3)
stem(n,y)
grid on
title('step in 3rd quadrant')
xlabel('n')
ylabel('Amplitude of step')
Output:
subplot(2,2,4)
stem(n,-y)
grid on
title('Ramp in 4th quadrant')
xlabel('n')
ylabel('Amplitude of Ramp')
n=-n;
y=y;
subplot(2,2,1)
stem(n,y)
grid on
title('Ramp in 2nd quadrant')
xlabel('n')
ylabel('Amplitude of Ramp')
y=-y;
subplot(2,2,3)
stem(n,y)
grid on
title('Ramp in 3rd quadrant')
xlabel('n')
ylabel('Amplitude of Ramp')
Output:
y=-y
subplot(2,1,2)
stem(n,y)
grid on
xlabel('n')
ylabel('unit impulse')
Output:
subplot(3,1,2)
stem(n+1,y)
grid on
title('delayed unit impulse')
xlabel('n')
ylabel('unit impulse')
subplot(3,1,3)
stem(n-1,y)
grid on
title('advanced unit impulse')
xlabel('n')
ylabel('unit impulse')
Output:
unit impulse
unit impulse
unit impulse
Output:
subplot(3,1,2)
stem(it+1,y)
grid on
title('Delayed Function')
xlabel('n')
ylabel('Amplitude')
subplot(3,1,3)
stem(it-1,y)
grid on
title('Advanced Function')
xlabel('n')
ylabel('Amplitude')
Output:
Amplitude
Amplitude
Amplitude
Sinusoidal Function:
clc
clear all
n=0:0.3:4*pi
y=sin(n)
subplot(2,2,2)
stem(n,y)
xlabel('n')
ylabel('Amplitude')
subplot(2,2,4)
stem(n,-y)
xlabel('n')
ylabel('Amplitude')
subplot(2,2,1)
stem(-n,y)
xlabel('n')
ylabel('Amplitude')
subplot(2,2,3)
stem(-n,-y)
xlabel('n')
ylabel('Amplitude')
Output:
Amplitude
Amplitude
Amplitude
Amplitude