CH - 1
CH - 1
Chapter one
I II III
Introduction to Digital Discrete time signals Analysis of LTI system
Signal Processing and systems analysis
Introduction to DSP
I Signal, Signal processing, Dsp,Why DSP,
Elements of Dsp……
1
Introduction
3
Cont.…
Digital signal processing (DSP): If the input signal given to the
system is digital then system does digital signal processing.
E.g.. Digital Computer, Digital Logic Circuits, FPGA etc.
4
Why DSP?
5
Advantages of DSP over ASP
7
Disadvantage of DSP over ASP
8
Application of DSP
Analog Binary
signal Sequence
Discrete time Quantized
(continuous in both time and continuous signal
amplitude.) amplitude
signal (Discrete in both time and
amplitude)
11
Sampling
Sampling: is the processes of converting continuous-time analog signal, Xa[t] into a
discrete-time signal, 𝑥 𝑛 by taking the “samples” of the continuous-time signal at discrete-
time intervals T.
𝑥 𝑛 = 𝑥𝑎 𝑛𝑇
Where the time interval T between successive samples is called sampling period / sample
interval. The reciprocal of sampling period is called the sampling frequency/ sampling rate
1
𝑓𝑠 = 𝑇.
Sampling gathers the variation of data into discreet time signals.
12
Cont.…
Types of sampling
✓ Ideal Sampling
✓ Natural Sampling
✓ Flat-Top Sampling
Flat-Top Sampling
Ideal Sampling Natural Sampling
13
Cont.…
Sampling Process
Mathematically, sampling process can be written as the product of the
continuous signal and the sampling pulses (pulse train). where pulses xp(t) is
the pulse train with a period T =1/fs
Ideal Sampling
14
Cont.…
Practically it is difficult to create a train of impulses
15
Cont.…
The problem with a natural sampled waveform is that the tops of the sample pulses
are not flat. It is not compatible with a digital system since the amplitude of each
sample has infinite number of possible values
Flat-Top Sampling
The pulse is held to a constant height for the whole sample period
This technique is used to realize Sample-and-Hold (S/H) operation. In S/H, input signal is
continuously sampled and then the value is held for as long as it takes to for the A/D to acquire
its value
16
Cont.…
How should we select the sampling period 𝑻 or, the sampling rate 𝑓𝑠 ?
Sampling Theorem: States that, “ If a signal is sampled at a rate which is
greater than twice the max frequency component of the waveform, then the
waveform can be exactly reconstructed from the samples. ”. When these
conditions are not satisfied, the phenomenon of aliasing occurs, which can
cause severe distortion of signal.
𝒇𝒔 ≥ 2𝒇𝒎𝒂𝒙
But we must have some general information concerning the frequency
content of the signal.
✓ If the sampling rate is equal to twice the maximum frequency of the given
signal 𝑓𝑚𝑎𝑥 , then it is called as Nyquist rate.
17
Cont.…
✓ The sample rate differs from medium to medium. E.g. The sample rate of
8KHz for telephones, for VoIP rate of 16KHz, for CD and MP3 rate of 44KHz is
considered good.
Example
Consider the analog signal
𝑥𝑎 𝑡 = 3𝑐𝑜𝑠100𝜋𝑡
a) Determine the minimum sampling rate required to avoid aliasing
b) Suppose that the signal is sampled at the rate of 200 Hz. What is the
discrete-time signal obtained after sampling
c) Suppose that the signal is sampled at the rate 𝑓𝑠 =75Hz. What is the
discrete time signal obtained after sampling?
𝑓
d) What is the frequency 0 < 𝑓 < 𝑠 of a sinusoid that yields samples identical
2
to those obtained in (c)?
18
Quantization
Quantization is representing the sampled values of the amplitude by a
finite set of levels, which means converting a discrete- time continuous-
valued signal into a discrete time, discrete valued (digital) signal.
19
Cont.…
Quantization done by map the infinite amplitude values onto a finite set of
known values. This is achieved by calculating the step-size
step-size The spacing between the two adjacent representation levels.
𝑚𝑎𝑥 − 𝑚𝑖𝑛 𝑚𝑎𝑥 : Max value of analog signal
∆=
𝐿
𝑚𝑖𝑛 : Min value of analog signal
N = log 2 𝐿 L: the number of quantization levels
N: the no. of bits to encode each sampled
value
✓ A unipolar quantizer: deals with analog signals ranging from 0 volt to a
positive reference voltage
✓ bipolar quantizer: deals with analog signals ranging from a negative
reference to a positive reference
20
Cont.…
Uniform Quantization: Constant step size between quantization level
➢ Two types of uniform quantization
𝑥−𝑥 𝑚𝑖𝑛
𝑖 = 𝑟𝑜𝑢𝑛𝑑 Δ
𝑖: Index corresponding to binary code
𝑥𝑞 : Quantization level
𝑥𝑞 = 𝑥𝑚𝑖𝑛+𝑖Δ , for i = 0,1, … , L − 1
21
Cont.…
✓ The midpoint of each zone is assigned a value from 0 to L-1 (resulting in L
values)
✓ Each sample falling in a zone is then approximated to the value of the
midpoint.
Quantization error: Deviation between actual sample value 𝑥[𝑛] and quantized
value 𝑥𝑄 [𝑛]
22
Digitals to Analog conversion (DAC)
❖ If 𝑓𝑠 > 2𝑓𝑚𝑎𝑥 then we recover x(t) exactly, Else we run into some
problems and signal is not fully recovered
23
Discrete time signals & system
II Representation of discrete time signals, Basic
discrete time signals, Classification of discrete time
systems…….
24
Discrete time signal and systems
Discrete time signal
25
Cont.…
Representation of discrete time signal
▪ Functional representation
▪ Graphical representation
▪ Tabular representation
▪ Sequence representation
Consider a signal x(n) with values
x (-2) = 3, x (-1) = 2, x (0) = 0, x (1) = 3, x (2) = 1 and x (3) = 2
Functional representation
−3 𝑓𝑜𝑟 𝑛 = −2
2 𝑓𝑜𝑟 𝑛 = −1
0 𝑓𝑜𝑟 𝑛 = 0
𝑥 𝑛 =
3 𝑓𝑜𝑟 𝑛 = 1
1 𝑓𝑜𝑟 𝑛 = 2
2 𝑓𝑜𝑟 𝑛 = 3 26
Cont.…
Graphical representation
Sequence representation
Tabular representation
2. Unit step:
1 𝑓𝑜𝑟 𝑛 ≥ 0
u 𝑛 =ቊ
0 𝑓𝑜𝑟 𝑛 < 0
𝛿 𝑛 = 𝑢 𝑛 − 𝑢(𝑛 − 1)
28
Cont.…
3. Unit ramp
𝑛 𝑓𝑜𝑟 𝑛 ≥ 0
𝑢𝑟 𝑛 = ቊ
0 𝑓𝑜𝑟 𝑛 < 0
𝑢𝑟 𝑛 = 𝑛𝑢(𝑛)
29
Cont.…
4. Exponential
𝑥 𝑛 = 𝑎𝑛 for all 𝑛
Where 𝑎 may be a real or complex number
if 𝑎 is real, the 𝑥 𝑛 is real exponential sequence
30
Cont.…
Where 𝑎 complex value it expressed as
𝑎 = 𝑟𝑒 𝑗θ
Then 𝑥 𝑛 = 𝑟 𝑛 𝑒 𝑗θ𝑛
= 𝑟 𝑛 (𝑐𝑜𝑠θ𝑛 + 𝑗𝑠𝑖𝑛θ𝑛 )
Now, 𝑥 𝑛 is complex exponential sequence. Since 𝑥 𝑛 is complex value, it have
real and imaginary part
𝑥𝑅 𝑛 = 𝑟𝑛 𝑐𝑜𝑠θ𝑛 and 𝑥𝐼 𝑛 = 𝑟𝑛 𝑠𝑖𝑛θ𝑛
31
Simple manipulation of discrete time signals
The manipulation of signals are generally compositions of a few basic signal
transformations.
a) Transformations of the independent variable n
i ) Time shifting: a signal 𝑥(𝑛) can be shifted to the left or right by
𝑛𝑜 that is 𝑥(𝑛 + 𝑛𝑜 )
If 𝑛𝑜 is positive 𝑥(𝑛) is shifted to the left (advance)
If 𝑛𝑜 is negative 𝑥(𝑛) is shifted to the right (delay)
1 𝑓𝑜𝑟 𝑛 = 𝑘
Shifted Unit sample sequence 𝛿 𝑛 − 𝑘 = ቊ 0 𝑓𝑜𝑟 𝑛 ≠ 𝑘
ii) Time reversal/ folding: Replace the independent variable 𝑛 by −𝑛. the
transformation is simply involves “flipping” the signal 𝑥(𝑛) with respect to the
index 𝑛 (folding of the signal about the time origin 𝑛=0).
32
Cont.…
iii) Time scaling: 𝑥(𝛼𝑛), the sequence is formed by taking every 𝛼 sample of 𝑥(𝑛)
Down sampling: if 𝛼 > 1
Up sampling: if 0 < 𝛼 < 1
Examples of shifting, reversing, and time scaling a signal
33
Cont.…
b) Transformations of the amplitude of 𝒙(𝒏) (amplitude manipulations)
The most common types of amplitude transformations are addition/subtraction,
multiplication and scaling. Consider two signals 𝑥1 𝑛 and 𝑥2 𝑛
i) Addition/ Subtraction
𝑦 𝑛 = 𝑥1 𝑛 ± 𝑥2 𝑛 −∞ < 𝑛 < ∞
ii) Multiplication
𝑦 𝑛 = 𝑥1 𝑛 𝑥2 𝑛 −∞ < 𝑛 < ∞
iii) Scaling: amplitude scaling of a signal 𝑥 𝑛 by a constant 𝑐 is accomplished
by multiplying every signal value by 𝑐
𝑦 𝑛 = 𝑐𝑥 𝑛 −∞ < 𝑛 < ∞
34
Discrete time system
a discrete time system is a device or algorithm that operate on a
discrete time signal
x(n) T y(n)
𝑥 𝑛 Discrete- time y 𝑛
system
Input 𝑇[. ] Output
Input or excitation output or response
Scaling a system which produces an output y(n) for an input x(n) must
produce an output ay(n) for an input ax(n).
Additivity a system which produces an output y1(n) for an input x1(n) and an
output y2(n) for an input x2(n) must produce an output y1(n) +
y2(n) for an input x1(n) + x2(n).
𝑻 𝑎1 𝑥1 (n) + 𝑎2 𝑥2 (𝑛) = 𝑎1 𝑻 𝑥1 (𝑛) + 𝑎2 𝑻[𝑥2 (𝑛)]
36
Cont.…
Example. Check whether the following systems are linear or not:
1
a) 𝑦 𝑛 = 𝑥 2 (𝑛) b) 𝑦 𝑛 = 𝑛2 𝑥(𝑛) c) 𝑦 𝑛 = 𝑥[𝑠𝑖𝑛 𝑛 ] d) 𝑥(𝑛) +
2𝑥(𝑛−2)
37
Cont.…
iii. Stability (stable vs unstable)
BIBO Criteria: for a stable system the output should be bounded for bounded
input at each and every instant. (if and only if every bound input produce a
bounded output)
Example: Check whether the following systems are stable or not:
a) 𝑦 𝑛 = 𝑥 2 (𝑛) b) 𝑦 𝑛 = 𝑛. 𝑥(𝑛) c) 𝑦 𝑛 = 𝑐𝑜𝑠𝑛. 𝑥(𝑛)
iv. Time invariance (time invariant vs time variant)
A system is called time invariant if its input- output characteristics do not
change with time.
❖ If the system is time invariant and 𝑦1 (𝑛) is the system output due to the
input 𝑥1 (𝑛) , then the shifted system input 𝑥1 (𝑛 − 𝑛𝑜 ) will produce a shifted
system output 𝑦1 (𝑛 − 𝑛𝑜 ) by the same amount of time 𝑛𝑜
38
Cont.…
39
Block Diagram representation of Discrete-Time System
40
Cont.…
A constant multiplier: This operation simply represents a scale factor on the
input x(n)
A unit delay element: a system that delays the signal passing through it by one
sample. If the input signal is x(n), the output is x(n-1)
A unit advance element: a system that moves the input x(n) by one sample in
time to yield x(n+1)
41
Analysis of LTI system
III Methods of analyzing LTI systems , Methods of
computing convolution, Properties of convolution
42
Analysis of Linear Time Invariant system
Methods of analyzing the behavior of discrete time LTI system to a given input signal
Method 1: Direct solution of the input-output equation for the system or solution of
difference equation
𝑦(𝑛) = 𝐹 [𝑦(𝑛 − 1), 𝑦(𝑛 − 2), … … 𝑦(𝑛 − 𝑀), 𝑥(𝑛), 𝑥(𝑛 − 1) … . . , 𝑥(𝑛 − 𝑀)
Difference equation written as
𝑦 𝑛 = −𝑎1 𝑦 𝑛 − 1 − ⋯ − 𝑎𝑁 𝑦 𝑛 − 𝑁 + 𝑏𝑜 𝑥(𝑛) + 𝑏1 𝑥(𝑛 − 1) + ⋯ . + 𝑏𝑀 𝑥(𝑛 − 𝑀)
Or N M
y (n) = − ai y (n − i ) + b j y (n − j )
i =1 j =0
Where 𝑎1 , ……, 𝑎𝑁 and 𝑏𝑜 , 𝑏1 ,……., 𝑏𝑀 are the coefficients of the difference equation.
𝑀 and 𝑁 are the memory lengths for input 𝑥(𝑛) and output 𝑦(𝑛), respectively.
Note that 𝑦 𝑛 is the current output which depends on the past output samples
𝑦 𝑛 − 1 , … , 𝑦 𝑛 − 𝑁 , the current sample 𝑥(𝑛), and the past input samples, 𝑥(𝑛 −
1), … , 𝑥(𝑛 − 𝑁) 43
Cont.…
Method 2: decompose or resolve the input signal into a weighted sum of
elementary signals first then analyze.
x (n ) = c k x k (n )
k
Where 𝑐𝑘 is set of amplitude (weighting coefficients)
Let 𝑦𝑘 𝑛 is the response of the system to the elementary signal 𝑥𝑘 𝑛 and
y 𝑛 total response of the system to the total signal x(𝑛)
𝑦 𝑛 = 𝑇[𝑥(𝑛)] = 𝑇 c k x k (n )
k
= c k 𝑇 𝑥𝑘 (𝑛)
k
= c k y k (n )
k
Elementary signals are select due to the response of the system to such
signals are easily determined.
44
Cont.…
Resolution of a Discrete-Time signal into impulses
Suppose we have an arbitrary signal 𝑥 𝑛 that we wish to resolve into a sum of
impulses.
Select the elementary signal, 𝑥𝑘 (𝑛) to decompose 𝑥 𝑛
𝑥𝑘 (𝑛) = 𝛿(𝑛 − 𝑘)
Where k represents the delay of the impulse sequence.
𝑥 𝑛 𝛿 𝑛 − 𝑘 = 𝑥(𝑘)𝛿(𝑛 − 𝑘) for delay 𝑛 = 𝑘
If we repeat this multiplication over all possible delays − ∞ < 𝑘 < ∞ The sum
of all possible products will give
x (n ) = x (k ) ( n − k)
k=−
y (n ) = x (k )h ( n , k )
k=−
Where ℎ(𝑛, 𝑘) = 𝑇[𝛿(𝑛 − 𝑘)] , 𝑛 is the time index and 𝑘 is a parameter showing the
location of the input impulse.
Note that the given equation considering only linearity property of the system
46
Cont.…
If, In addition the system is time invariant, the formula simplifies considerably
Let ℎ(𝑛) be the impulse response of LTI system and it called impulse response.
ℎ(𝑛) = 𝑇 [𝛿(𝑛)]
Then by the time invariance property, the response of the system to the delayed
impulse sequence 𝛿(𝑛 − 𝑘 ) is
ℎ(𝑛 − 𝑘) = 𝑇 [𝛿(𝑛 − 𝑘)]
Consequently the previous formula reduces to
y (n ) = x (k )h ( n − k )
k=−
This equation states that, the response 𝑦(𝑛) of a signal 𝑥(𝑛) by LTI system, is the
convolution sum of input signal 𝑥(𝑛) & unit impulse response ℎ(𝑛).
We say that input 𝑥(𝑛) is convolved with the impulse response ℎ 𝑛 to yield the
output 𝑦 𝑛 .
47
Cont.…
Symbol for convolution
𝑦 𝑛 =𝑥 𝑛 ∗ℎ 𝑛 = x (k )h ( n − k )
k=−
From a systems point of view, this property states that the system output is
the same when we interchange the role of 𝑥 𝑛 and ℎ 𝑛
50
Cont.…
b) Associative:
𝑥 𝑛 ∗ ℎ1 𝑛 ∗ ℎ2 𝑛 = 𝑥 𝑛 ∗ [ℎ1 𝑛 ∗ ℎ2 (𝑛)]
This property states that “if two systems with unit sample responses ℎ1 𝑛
and ℎ2 𝑛 are connected in cascade, an equivalent system is one that has a
unit sample response equal to the convolution of ℎ1 𝑛 and ℎ2 𝑛 ”
ℎ𝑒𝑞 𝑛 = ℎ1 𝑛 ∗ ℎ2 (𝑛)
51
Cont.…
c) Distributive:
𝑥 𝑛 ∗ ℎ1 𝑛 + ℎ2 𝑛 = 𝑥 𝑛 ∗ ℎ1 𝑛 + 𝑥 𝑛 ∗ ℎ2 (𝑛)
This property states that “if two systems with unit sample responses ℎ1 𝑛
and ℎ2 𝑛 are connected in parallel, an equivalent system is one that has a
unit sample response equal to the sum of ℎ1 𝑛 and ℎ2 𝑛 ”
ℎ𝑒𝑞 𝑛 = ℎ1 𝑛 + ℎ2 (𝑛)
52
Cont.…
53
Cont.…
Example
1. The impulse response of LTI system is
ℎ 𝑛 = 1, 2, 1, −1