0% found this document useful (0 votes)
11 views26 pages

Lab 02 DSIP

The document provides an overview of discrete-time signals, including their definition, the sampling theorem, and the concept of aliasing. It includes examples of generating and plotting discrete-time signals such as sinusoidal, unit impulse, unit step, and ramp sequences using MATLAB code. Additionally, it outlines specific tasks for generating various discrete-time sequences.

Uploaded by

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

Lab 02 DSIP

The document provides an overview of discrete-time signals, including their definition, the sampling theorem, and the concept of aliasing. It includes examples of generating and plotting discrete-time signals such as sinusoidal, unit impulse, unit step, and ramp sequences using MATLAB code. Additionally, it outlines specific tasks for generating various discrete-time sequences.

Uploaded by

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

TO GENERATE AND

PLOT DISCRETE TIME


(DT) SIGNALS
LAB # 2
DISCRETE TIME SIGNALS

• A discrete signal or discrete-time signal is a time series consisting of a


sequence of quantities.
• Unlike a continuous-time signal, a discrete-time signal is not a function
of a continuous argument; however, it may have been obtained by
sampling from a continuous-time signal.
• A function of discrete time instants is defined by integer “n”.
DISCRETE TIME SIGNAL
SAMPLING THEOREM

• The sampling theorem specifies the minimum sampling rate at which a


continuous time signal needs to be uniformly sampled so that the
original signal can be completely recovered or reconstructed by these
samples alone.
• This is usually referred to as Shannon’s sampling theorem.
• Sampling theorem establishes conditions that prevent aliasing so that a
continuous-time signal can be uniquely reconstructed from its samples.
SAMPLING THEOREM
ALIASING

• Aliasing is an effect that causes different signals to become


indistinguishable (or aliases of one another) when sampled.
EXAMPLE: 01

•t = [0:0.01:2];
•x = sin(2*pi*t);
•plot(t,x);
•xlabel('t [sec]');
•ylabel('x(t)')
1

0.8

0.6

0.4

0.2

OUTPUT
x(t)

-0.2

-0.4

-0.6

-0.8

-1
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
t [sec]
• Make its discrete form
f=1;

fs=20;

Ts=1/fs;

t=-2:Ts:2;

x=sin(2*pi*f*t);

stem(t,x)
1

0.8

0.6

0.4

0.2

OUTPUT
0

-0.2

-0.4

-0.6

-0.8

-1
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
f=1;
fs=20;
Ts=1/fs;
t=-2:Ts:2;
x=sin(2*pi*f*t);
stem(t,x);
x=sin(2*pi*f*n*Ts);
stem(n,x)
1

0.8

0.6

0.4

0.2

OUTPUT 0

-0.2

-0.4

-0.6

-0.8

-1
-20 -15 -10 -5 0 5 10 15 20
EXAMPL-02: GENERATION OF A SINUSOIDAL SEQUENCE
A = 2;
ph=pi/2;
f=1;
fs=20;
Ts=1/fs;
t=-2:Ts:2;
x=sin(1*pi*f*t);
stem(t,x);
x=A*sin(1*pi*f*n*Ts-ph);
stem(n,x)
2

1.5

0.5

OUTPUT 0

-0.5

-1

-1.5

-2
-20 -15 -10 -5 0 5 10 15 20
SOME ELEMENTARY
DISCRETE-TIME
SIGNALS

UNIT SAMPLE / UNIT


IMPULSE:
EXAMPLE-03: UNIT IMPULSE

n=-20:1:20; 1

0.9
x=n==0; 0.8

stem(n,x) 0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
-20 -15 -10 -5 0 5 10 15 20
DELAYED IMPULSE DELAYED Unit Sample Sequence
1.2

n=-20:1:20;
x=(n-2)==0; 0.8

Amplitude
stem(n,x); 0.6

xlabel('Time index n');


0.4
ylabel('Amplitude');
title('DELAYED Unit 0.2

Sample Sequence'); 0
-10 -5 0 5 10 15 20
axis([-10 20 0 1.2]) Time index n
EXAMPLE-04: GENERATION OF UNIT STEP SIGNAL

Unit Step:
Unit Step Sequence
1.2

1
n=-20:1:20;
x=n>=0; 0.8

Amplitude
stem(n,x); 0.6

xlabel('Time index n');


0.4
ylabel('Amplitude');
title('Unit Step 0.2

Sequence’);
0
axis([-10 20 0 1.2]) -10 -5 0 5
Time index n
10 15 20
EXAMPLE-05: GENERATION OF RAMP SIGNAL

Unit Ramp:
ramp Sequence
20

18

n=-20:1:20; 16

14
x=n.*(n>=0);
12

Amplitude
stem(n,x); 10

xlabel('Time index n'); 8

ylabel('Amplitude'); 6

4
title('ramp Sequence’);
2
axis([-10 20 0 20]) 0
-10 -5 0 5 10 15 20
Time index n
TASK#01

Generate a unit step sequence x[n] with an


advance of 7 samples.
TASK#02

Generate the sinusoidal sequence of length 50,


frequency 0.08, amplitude 2.5, and phase shift
of 90 degrees.
TASK#03

Generate a ramp sequence with an delay of 5 samples.

You might also like