Digital Signal Processing
Dr Zohaib Ahmad Khan
SAEE
Demo
https://youtu.be/LznjC4Lo7lE
Discrete-Time Systems
• Discrete-Time Sequence is a mathematical operation that
maps a given input sequence x[n] into an output sequence
y[n]
y[n] = T{x[n]} x[n] T{.} y[n]
• Example Discrete-Time Systems
– Moving (Running) Average
y[n] = x[n] + x[n − 1] + x[n − 2] + x[n − 3]
– Maximum
y[n] = maxx[n], x[n − 1], x[n − 2]
– Ideal Delay System
y[n] = x[n − no ]
Memoryless System
• Memoryless System
– A system is memoryless if the output y[n] at every value of n
depends only on the input x[n] at the same value of n
• Example Memoryless Systems
– Square
y[n] = (x[n])
2
– Sign
y[n] = signx[n]
• Counter Example
– Ideal Delay System
y[n] = x[n − no ]
Linear Systems
• Linear System: A system is linear if and only if
T{x1[n] + x2[n]} = Tx1[n] + Tx2[n] (additivity)
and
Tax[n] = aTx[n] (scaling)
• Examples
– Ideal Delay System
y[n] = T {x[n]} = x[n − no ]
T{x1[n]+ x2[n]} = x1[n - no ]+ x2[n - no ]
T{x2[n]}+ Tx1[n] = x1[n - no ]+ x2[n - no ]
Tax[n] = ax[n- no ]
aTx[n] = ax[n- no ]
Time-Invariant Systems
• Time-Invariant (shift-invariant) Systems
– A time shift at the input causes corresponding time-shift at output
y[n] = T{x[n]} y[n − no ] = Tx[n − no ]
• Example
– Square
y1 n = (x[n − no ])
2
Delay the input the output is
y[n] = (x[n])
2
yn - no = (x[n − no ])
2
Delay the output gives
• Counter Example
– Compressor System
Delay the input the output is y1 n = x[Mn − no ]
y[n] = x[Mn]
Delay the output gives yn - no = xM(n − no )
Time-Invariant Systems
• Time-Invariant (shift-invariant) Systems
– A time shift at the input causes corresponding time-shift at output
y[n] = T{x[n]} y[n − no ] = Tx[n − no ]
• Example
– Square
y1 n = (x[n − no ])
2
Delay the input the output is
y[n] = (x[n])
2
yn - no = (x[n − no ])
2
Delay the output gives
• Counter Example
– Compressor System
Delay the input the output is y1 n = x[Mn − no ]
y[n] = x[Mn]
Delay the output gives yn - no = xM(n − no )
Causal System
• Causality
– A system is causal it’s output is a function of only the current and
previous samples
• Examples
– Backward Difference
y[n] = x[n] − x[n − 1]
• Counter Example
Any examples?
– Forward Difference
y[n] = x[n + 1] + x[n]
Causal System
• Causality
– A system is causal it’s output is a function of only the current and
previous samples
• Examples
– Backward Difference
y[n] = x[n] − x[n − 1]
• Counter Example
– Forward Difference
y[n] = x[n + 1] + x[n]
Linear-Time Invariant System
• Special importance for their mathematical tractability
• Most signal processing applications involve LTI systems
• LTI system can be completely characterized by their impulse
response
x[n] T{.} y[n]
• Represent any input xn = xk n − k
k = −
yn = T xk n − k = xk T n − k = xk hn − k
k =− k =− k = −
• From time invariance we arrive at convolution
yn = xk hn − k = xk hk
k = −
Linear-Time Invariant System
• Represent any input xn = xk n − k
k = −
Linear-Time Invariant System
• Special importance for their mathematical tractability
• Most signal processing applications involve LTI systems
• LTI system can be completely characterized by their impulse
response
[n-k] T{.} h[n-k] x[n] T{.} y[n]
• Represent any input xn = xk n − k
k = −
yn = T xk n − k = xk T n − k = xk hn − k
k =− k =− k = −
• From time invariance we arrive at convolution
yn = xk hn − k = xk hk
k = −
LTI System Example
¥
y [ n] = å x [k ] h [n - k ]
k=-¥
Properties of LTI Systems
• Convolution is commutative
xk hk = xk hn − k = hk xn − k = hk xk
k = − k = −
x[n] h[n] y[n] h[n] x[n] y[n]
• Convolution is distributive
xk (h1 k + h2 k ) = xk h1 k + xk h2 k
h1[n]
x[n] + y[n] x[n] h1[n]+ h2[n] y[n]
h2[n]
Properties of LTI Systems
• Cascade connection of LTI systems
x[n] h1[n] h2[n] y[n]
x[n] h2[n] h1[n] y[n]
x[n] h1[n]h2[n] y[n]
Stable and Causal LTI Systems
• An LTI system is (BIBO) stable if and only if
– Impulse response is absolute summable
hk
k = −
– Let’s write the output of the system as
yn = hk xn − k hk xn − k
k = − k = −
– If the input is bounded
x[n] Bx
– Then the output is bounded by
yn Bx hk
k = −
– The output is bounded if the absolute sum is finite
• An LTI system is causal if and only if
hk = 0 for k 0
Linear Constant-Coefficient Difference Equations
• An important class of LTI systems of the form
N M
a yn − k = b xn − k
k =0
k
k =0
k
• The output is not uniquely specified for a given input
– The initial conditions are required
– Linearity, time invariance, and causality depend on the initial
conditions
– If initial conditions are assumed to be zero system is linear, time
invariant, and causal
• Example
– Moving Average
y[n] = x[n] + x[n − 1] + x[n − 2] + x[n − 3]
– Difference Equation Representation
0 3
a yn − k = b xn − k
k =0
k
k =0
k where ak = bk = 1
Eigenvalues-Eigenvectors
Blue Arrow = Eigenvector
Eigenvalue = Vector’s length
Eigenfunctions of LTI Systems
• Complex exponentials are eigenfunctions of LTI systems:
xn = e jn
• Let’s see what happens if we feed x[n] into an LTI system:
yn = hk xn − k = hk
e j(n −k )
k = − k = −
eigenfunction
yn = hk e − jk jn
e = H e j e jn ( )
k = −
eigenvalue
• The eigenvalue is called the frequency response of the system
( ) = hk e
j − jk
He
k = −
• H(ej) is a complex function of frequency
– Specifies amplitude and phase change of the input
Discrete-Time Fourier Transform
• Many sequences can be expressed as a weighted sum of
complex exponentials as (another picture)
xn =
1
2 −
X e j
e ( )
jn
d (inverse transform)
• Where the weighting is determined as
( ) = xne
j − jn
Xe (forward transform)
n = −
• X(ej) is the Fourier spectrum of the sequence x[n]
– It specifies the magnitude and phase of the sequence
• The frequency response of a LTI system is the DTFT of the
impulse response
( ) = hk e 1
( )
He j − jk
and hn = H e j
e jn
d
k = − 2 −
Existence of DTFT
• For a given sequence the DTFT exist if the infinite sum
convergence
( ) = xne
j − jn
Xe
n = −
• Or
( )
X e j for all
( ) = xne
Xe j
n = −
− jn
xn e
n = −
− jn
= xn
n = −
• So the DTFT exists if a given sequence is absolute summable
• All stable systems are absolute summable and have DTFTs
Absolute and Square Summability
• Absolute summability is sufficient condition for DTFT
• Some sequences may not be absolute summable but only
square summable
xn
2
n = −
Example: Generalized DTFT
• DTFT of xn = 1
• Not absolute summable
• Not even square summable
• But we define its DTFT as a pulse train
( ) = 2( + 2r )
j
Xe
r = −
• Let’s place into inverse DTFT equation
xn =
1
2 −
X e j
( )
e jn
d
1 jn
= 2 ( + 2r ) e d
2 r = −
−
()e jnd = e j0n = 1
= −
Fourier Transform Theorems
Sequence DTFT
x[n] X(ej)
y[n] Y(ej)
ax[n]+by[n] aX(ej)+bY(ej)
x[n-nd] ( )
e− jnd X e j
x[-n] X(e-j)
nx[n]
j
dX e j ( )
d
x[n]y[n] X(ej)Y(ej)
x[n]y[n] 1
2 −
X e ( )(
j
Y e j( − )
)d
1
( )
Parseval' s Theorem : xn =
2 2
j
X e d
n = − 2 −
1
( ) ( )
Parseval' s Theorem : xny n =
*
X e j
Y *
e j
d
n = − 2 −
Fourier Transform Pairs
Sequence DTFT
[n-no] e− jno
1 2( + 2k )
k = −
1
anu[n] |a|<1
1 − ae− j
1
u[n] − j
+ ( + 2k )
1−e k = −
sin(cn) 1 c
n
( )
X e j =
0 c
1
xn =
0nM sin(M + 1) / 2 − jM / 2
e
0 otherwise sin( / 2)
e jon 2( −
k = −
o + 2k )
e ( −
cos(on+)
j
o + 2k ) + e− j( + o + 2k )
k = −