Lecture 2
Lecture 2
(CS202)
2022 – 2023
Lecture-2
2
DSP Scenario
Analog input – analog output
Digital recording of music
Analog input – digital output
Touch tone phone dialing
Digital input – analog output
Text to speech
Digital input – digital output
Compression of a file on computer
3
Why DSP?
Digital data storage and transmission is much more
effective than in the analogue form
Flexibility: processing functions can be altered or
adjusted
Possibility of implementing much more complicated
processing functions than in analogue devices
Efficient implementation of fast algorithms and
matrix-based processing
Avery high accuracy and reliability is possible to
achieve
Signal multiplexing: simultaneous (parallel)
processing 4
ANALOG TO DIGITAL (A/D)
CONVERSION
Analog to Digital Converter (ADC)
6
Analog to Digital Converter (ADC)
Consists of 3 processes:
1. Sampling: Conversion from Continuous-Time,
Continuous-Amplitude signal to Discrete-Time,
Continuous-Amplitude signal.
2. Quantizing: Conversion from Discrete-Time,
Continuous-Amplitude signal to Discrete-Time,
Discrete-Amplitude signal.
3. Coding: Conversion from a Discrete-Time,
Discrete-Amplitude signal to an efficient Digital
data format.
7
Analog to Digital Converter (ADC)
8
9
Analog to Digital Converter (ADC)
1. Sample and Hold :
• Analog signal is continuous in time and continuous
in amplitude.
10
Analog to Digital Converter (ADC)
1. Sample and Hold :
• It is impossible to digitize an infinite number of
points.
13
Analog to Digital Converter (ADC)
1. Sample and Hold :
The sampling of a continuous time signal 𝑋𝑎 (t)
consists of keeping the information of the signal
𝑋𝑎 (t) once every 𝑇𝑆 second (sampling period).
sampling period, 𝑻𝑺
14
Sampling Theorem
15
Sampling Theorem
It is possible to perfectly reconstruct a sampled
signal from its samples if the following condition is
met:
The sampling frequency 𝑭𝑺 is at least twice as
large as the maximum frequency 𝐹𝑀 of the signal.
𝑭𝑺 ≥2 𝑭𝒎 (Shannon, Nyquis, 1940)
e.g., Audio signal (to store in memory),
𝐹𝑚 = 3.5 KHz 𝑭𝑺 =7KHz at least. (𝑻𝑺 =142 µs),
𝑭𝑺 ≥ 7KHz
𝑭𝑺 =11𝑭𝒎 𝑭𝑺 =3.3𝑭𝒎
17
The Sampling Theorem and Aliasing
𝑭𝑺 =1.05𝑭𝑴 𝑭𝑺 =1.05𝑭𝑴
18
The Sampling Theorem and Aliasing
Example of Aliasing
in the time domain of
various sinusoidal
signals ranging from
10 kHz to 80 kHz with
a sampling frequency
Fs = 40 kHz.
19
Analog to Digital Converter (ADC)
2. Quantization
Quantization: The process of converting discrete-time continuous valued
signal into discrete-time discrete valued (digital) signal
3. Coding
We need to encode each sample value in order to store it in b bits
memory location.
For example
If b = 2 , we can have 2b=4 different possible sample values.
If b = 4, we can have 2b=16 different possible sample values.
20
Analog to Digital Converter (ADC)
2. Quantization
21
Representation of Discrete Signals
22
Representation of Discrete Signals
23
Important Discrete Time Signals
Unit Impulse
Unit Step
Rectangular Signal
Ramp Signal
Real value exponential
Sinusoidal Signal
24
1. Unit Impulse Function
a) δ[0] = 1
b) δ[3] = 0
c) δ[-2] = 0
26
Scaled Unit Impulse Function
Example: Draw the following signal:
x[n] = 4δ[n]
27
Scaled Unit Impulse Function
Example: Draw the following signal:
x[n] = -2δ[n]
28
Shifted Unit Impulse Function
Example: Draw the following signals:
a) x[n] = δ[n - 2]
b) x[n] = δ[n + 2]
29
Shifted Unit Impulse Function
Example: Draw the following signals:
x[n] = δ[n - 3]
30
1. Unit Impulse Function
Hence, the unit impulse signal can be used as a
basic building block for the construction &
representation of other signals.
𝑥[𝑛] = 𝑥 𝑘 𝛿[𝑛 − 𝑘]
𝑘=−∝
31
1. Unit Impulse Function
Example: write a function to describe the signal in the figure.
34
2. Unit Step Function
Example: Determine the values of the following
a) u[-1], b) u[0], c) u[1]
Answers
a) u[-1] = 0
b) u[0] = 1
c) u[1] = 1
35
Scaled Step Function
Example: Draw the signal x[n] = 3u[n]
36
Shifted Step Function
Example: Draw the signal (a) x[n] = u[n - 2]
(b) x[n] = u[n + 2]
37
2. Unit Step Function
Example: Draw the signal x[n] = u[-n]
38
2. Unit Step Function
39
2. Unit Step Function
Example: Draw the signal
x[n] = u[n] + 2u[n - 2]
2
40
2. Unit Step Function
Example: Draw the signal x[n] = u[n] - u[n - 3]
41
3. Rectangular Signal
42
4. Ramp Signal
r[n] = nu[n]
43
5. Real value exponential
44
6. Sinusoidal Signal
45
Do time shift then time scaling 46
Example:
A discrete-time signal x[n] is defined as:
47
Thank You
55