0% found this document useful (0 votes)
6 views10 pages

Experiment 01

The document outlines an experiment using MATLAB to represent basic discrete time signals, including unit step, ramp, exponential, impulse, and sinusoidal functions. It provides theoretical definitions, MATLAB code for generating these signals, and visual outputs for each signal type. The discussion emphasizes the importance of discrete time signals in digital signal processing applications such as communication systems and biomedical analysis.

Uploaded by

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

Experiment 01

The document outlines an experiment using MATLAB to represent basic discrete time signals, including unit step, ramp, exponential, impulse, and sinusoidal functions. It provides theoretical definitions, MATLAB code for generating these signals, and visual outputs for each signal type. The discussion emphasizes the importance of discrete time signals in digital signal processing applications such as communication systems and biomedical analysis.

Uploaded by

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

Experiment No.

: 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.

Figure: Discrete Time Signal

Unit step signal:


The unit step signal is normally given the symbol u(n)
u(n) = 1 for n ≥0 (1)
u(n) = 0 for n<0
Note the signal is not zero before time = 0 but is just not
defined at that time
period. So, this type of signal is very important in
analysis of discrete time signal. Thus, this type of signal
should be analyzed properly

Figure: Unit Step Signal


Unit ramp signal :
The ramp function is a unary real function, easily
computable as the mean of the independent variable and its
absolute value. The ramp function may be defined
analytically in several ways. Possible definitions are
system of equations:
𝑛, 𝑛≥0
𝑟(𝑛) =
0, 𝑛<0
So this type of signal is very important in analysis of
discrete time signal. Thus this type of signal should be
analyzed properly Figure: Unit Ramp Signal
Exponential signal:
X(n) = 𝑎 ; 𝑓𝑜𝑟 𝑛 ≥ 0
X(n) = 0 ; 𝑓𝑜𝑟 𝑛 < 0
Where 0 < a < 1 i.e. a is a fractional number. α values result in
a shrinking signal, whereas positive values result in
a growing signal. The exponential signal models the behavior
of many phenomena, such as the decay of electrical signals
across a capacitor or inductor. Positive α values show
processes with compounding values, e.g. the growth of money
with a compounded interest rate Figure: Exponential Signal

Unit impulse signal:


In signal processing, the impulse response, or impulse
response function (IRF), of a dynamic system is its output
when presented with a brief input signal, called an impulse.
More generally, an impulse response is the reaction of any
dynamic system in response to some external change. In
both cases, the impulse response describes the reaction of
the system as a function of time (or possibly as a function
of some other independent variable that parameterizes the
dynamic behavior of the system).

Figure: Impulse Signal


The impulse signal can be represented by:
1 ;𝑛 = 0
𝛿=
0; 𝑛 ≠ 0

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:

Figure: Step Signal Output


Ramp Signal:
clc
clear all
m=input(' enter m= ')
n=0:1:m-1
subplot(2,2,2)
y=n;
stem(n,y)
grid on
title('Ramp in 1st quadrant')
xlabel('n')
ylabel('Amplitude of Ramp')

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:

Figure: Ramp Signal Output


Impulse Signal:
clc
clear all
a=input('Enter value for positive side=');
b=input('Enter value for negative side=');
y=[zeros(1,b),ones(1,1),zeros(1,a)];
n=-b:1:a
subplot(2,1,1)
stem(n,y)
grid on
xlabel('n')
ylabel('unit impulse')

y=-y
subplot(2,1,2)
stem(n,y)
grid on
xlabel('n')
ylabel('unit impulse')

Output:

Figure: Impulse Signal Output


Delayed Or Advanced Impulse signal:
clc
clear all
a=input('Enter value for positive side=');
b=input('Enter value for negative side=');
y=[zeros(1,b),ones(1,1),zeros(1,a)];
n=-b:1:a
subplot(3,1,1)
stem(n,y)

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

Figure: Impulse Signal Output


Exponential Signal:
clc
clear all
m=input(' enter m= ')
n=0:1:m-1
a=1
y=exp(a*n);
subplot(2,2,2)
stem(n,y)
grid on
title('exponential in 1st quadrant')
xlabel('n')
ylabel('Amplitude of exponential')
subplot(2,2,4)
stem(n,-y)
grid on
title('exponential in 4th quadrant')
xlabel('n')
ylabel('Amplitude of exponential')
n=-n;
y=y;
subplot(2,2,1)
stem(n,y)
grid on
title('exponential in 2nd quadrant')
xlabel('n')
ylabel('Amplitude of exponential')
y=-y;
subplot(2,2,3)
stem(n,y)
grid on
title('exponential in 3rd quadrant')
xlabel('n')
ylabel('Amplitude of exponential')

Output:

Figure: Exponential Signal Output


Exercise:
|𝑛|| ; −3 ≤ 𝑛 ≤ 3|
x(n) =
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Plot The function and also plot x(n-1) & x(n+1|).
clc
clear all
it=-3:1:3
y=abs(it)
subplot(3,1,1)
stem(it,y)
grid on
title('Actual Function')
xlabel('n')
ylabel('Amplitude')

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

Figure: Sinusoidal Output


Discussion & Conclusion:
The discrete time signal is very important in analysis of Digital signal processing. The discrete time is
very use of daily application like in communication system, radar and sonar signal processing,
Biomedical signal analysis and processing, speech analysis and processing etc. Time delay and shifting
property is also used here. Time delay and folding are not associative. If folding is done before time
delay, then the result will be different compared to otherwise.

You might also like