Chapter1 St-Đã G P
Chapter1 St-Đã G P
INTRODUCTION
Duration: 2 hr
Outline:
1. Signals
2. Digital Signal Processing (DSP)
3. Why DSP?
4. DSP applications
*******
Learning Digital Signal Processing is not something you accomplish; it’s a journey
you take.
R.G. Lyons, Understanding Digital Signal Processing
Signals
ECG
Speech signal
Color image
2-D image signals
Duration: 2 hr
Outline:
1. Signals
2. Digital Signal Processing (DSP)
3. Why DSP?
4. DSP applications
Discrete-time signal vs.
continuous-time signal
Continuous-time signal:
- define for a continuous duration of time
- sound, voice…
Discrete-time signal:
- define only for discrete points in time (hourly, every
second, …)
- an image in computer, a MP3 music file
- amplitude could be discrete or continuous
- if the amplitude is also discrete, the signal is digital.
Analog signal vs. digital signal
00 10 00 10 11
Performed by:
Special-purpose (custom) chips: application-specific integrated
circuits (ASIC)
Field-programmable gate arrays (FPGA)
General-purpose microprocessors or microcontrollers (μP/μC)
General-purpose digital signal processors (DSP processors)
DSP processors with application-specific hardware (HW)
accelerators
Digital Signal Processing
implementation
Digital Signal Processing
implementation
Digital Signals
Duration: 2 hr
Outline:
1. Signals
2. Digital Signal Processing (DSP)
3. Why DSP?
4. DSP applications
Advantages of Digital Signal
Processing
Duration: 2 hr
Outline:
1. Signals
2. Digital Signal Processing (DSP)
3. Why DSP?
4. DSP applications
Radar
Biomedical
Playback
Manipulation/mixing
Finger print recognition
Noise removal
Lecture 2: Analog-to-Digital and
Digital-to-Analog conversion
Duration: 2 hr
Outline:
1. A/D conversion
2. D/A conversion
ADC
Sampling
Analog Digital
Sampling
world world
Sampling
frequency
0 W 2W =fs 3W 4W
magnitude
frequency
0 W 2W =fs 3W 4W
Some examples of sampling frequency
0 1 2 3 4
Quantization step
Coding
Quantized sample N-bit code word
1.5V
1.1V
1.25V
1.0V
0.82V
0.5V
0.0V
Example of quantization and coding
Quantization
An analog voltage Range of analog
Digital code Level (V) inputs (V)
between -5V and 5V
100 -5.0 -5.0 -4.375
must be quantized
101
using 3 bits. Quantize
110
each of the following
111
samples, and record
000
the quantization error
001
for each:
010
-3.4V; 0V; .625V
011
Quantization parameters
Number of bits: N
Full scale analog range: R
Resolution: the gap between levels Q = R/2N
Quantization error = quantized value – actual value
Dynamic range: number of levels, in decibel
Dynamic range = 20log(R/Q) = 20log(2N) = 6.02N dB
Signal-to-noise ratio SNR = 10log(signal power/noise power)
Or SNR = 20log(signal amplitude/noise amplitude)
Bit rate: the rate at which bits are generated
Bit rate = N.fs
Noise removal by quantization
Error
Noise
Q/2
Q
A s (t ) 1
1 , 0 s1 ( t )
s 2 ( t ) 1 ln A A
1 ln(A s1 ( t ) ) s2(t)
1
, s1 ( t ) 1
1 ln A A 1.0
A=87.6
A=5
- 1.0 A=1
0 1.0 s1(t)
- 1.0
ITU G.711 A-law curve
1.0
1
7/8
2
6/8
3
5/8
4
4/8
5
3/8
6
2/8
7
1/8
8
0
1/16 1/8 1/4 1/2 1.0
ITU G.711 standard
Input range Step size Part 1 Part 2 No. code Decoding output
word
0-1 2 000 0000 0 1
... ... ... ...
30-31 1111 15 31
Code word: ?
Decoding value: ?
A quantized-sample’s value is -121
Code word: ?
Lecture 2: Analog-to-Digital and
Digital-to-Analog conversion
Duration: 2 hr
Outline:
1. A/D conversion
2. D/A conversion
DAC
Anti-imaging filter
magnitude
Anti-imaging Images
filter
0 W 2W =fs 4W = 2fs
frequency
Original two-sided
analog signal spectrum
Lecture 3
The concept of frequency in
CT & DT signals
Duration: 2 hrs
Outline:
1. CT sinusoidal signals
2. DT sinusoidal signals
3. Relations among frequency variables
Mathematical description of CT
sinusoidal signals
Functions:
x a ( t ) A cos( t ), t
A cos( 2f t ), t
xa(t)
Plot: Tp = 1/f
Acosθ
t
Properties of CT sinusoidal signals
For f = 0 Tp = ∞
For f = ∞ Tp = 0
Physical frequency: positive
Mathematical frequency: positive and negative
A j ( t ) A j ( t )
x a (t ) A cos( t ) e e
2 2
The frequency range for CT signal:
-∞ < f < +∞
Lecture 3
The concept of frequency in
CT & DT signals
Duration: 2 hrs
Outline:
1. CT sinusoidal signals
2. DT sinusoidal signals
3. Relations among frequency variables
Mathematical description of DT
sinusoidal signals
1.5
Plot: 0.5
Amplitude
-0 . 5
-1
-1 . 5
-2
0 5 10 15 20 25 30 35 40
T im e in d e x n
Properties of DT sinusoidal signals
x(n N) x(n) n
A cos[ 2F0 ( n N ) )] A cos( 2F0 n ) n
2F0 N 2k
k
F0
N
Properties of DT sinusoidal signals
(or )
or, equivalently, 1 1
F (or F )
2 2
Illustration for x (n ) cos(2 F0 n )
property 3
F = 1/8
0
F = 3/24
FF =03/12= 1/4
1 1
0.5 0.5
0 0
-0.5 -0.5
-1 -1
0 5 10 15 20 25 30 0 5 10 15 20 25 30
F = 1/2
F = 3/6 0
FF =03/4= 3/4
1 1
0.5 0.5
0 0
-0.5 -0.5
-1 -1
0 5 10 15 20 25 30 0 5 10 15 20 25 30
Duration: 2 hrs
Outline:
1. CT sinusoidal signals
2. DT sinusoidal signals
3. Relations among frequency variables
Sampling of CT sinusoidal signals
CT signals DT signals
2f 2F
f
f
F
/ T / T
fs 1 / 2 F 1 / 2
f s / 2 f f s / 2
Exercise 1
x(t ) 3 cos100 t , t[ s ]
Solution
x(t ) 3 cos100 t , t[ s ]
Exercise 2
T Ts /(log2 L)
(b) When is the equality sign valid?
HW – Problem 1 (20%)
1
n 0 1 2 3 4 5 6 7 8
Sample(V) 0.1111 0.6250 0.9555 3.4373 4.0500 2.8755 1.5625 2.7500 4.9676
A set of analog 2
Quantization
samples, listed in Range of analog
Digital code Level (V) inputs (V)
table 1, is digitized
using the 000 0.0 0.0 0.3125
quantization table 001 0.625 0.31250.9375
2. Determine the 010 1.250 0.93751.5625
digital codes, the
011 1.875 1.56252.1875
quantized level,
100 2.500 2.18752.8125
and the
quantization error 101 3.125 2.81253.4375
for each sample. 110 3.750 3.43754.0625
111 4.375 4.06255.0
HW – Problem 2 (20%)
Consider that you desire an A/D conversion system, such that the
quantization distortion does not exceed ±1% of the full scale
range of analog signal.
(a) If the analog signal’s maximum frequency is 4000 Hz, and
sampling takes place at the Nyquist rate, what value of sampling
frequency is required?
(b) How many quantization levels of the analog signal are needed?
(c) How many bits per sample are needed for the number of levels
found in part (b)?
(d) What is the data rate in bits/s?
HW – Problem 3 (20%)
a) x(t ) 3 cos(5t / 6)
b) x(n) 3 cos(5n / 6)
c) y (n) 2 exp[ j (n / 6) ]
d )h(n) cos(n / 8) cos(n / 8)
e) w(n) cos(n / 2) sin(n / 8) 3 cos(n / 4 / 3)
HW – Problem 5 (20%)
Consider the following continuous-time sinusoidal signal
xa (t ) sin 2 f 0 t , t
Its sampled version is described by values every T (s) as the formula below
f0
x ( n) xa ( nT ) sin 2 n, n
fs
where fs = 1/T is the sampling frequency.
a) Plot the signal x(n), 0 ≤ n ≤ 99 for fs = 5 kHZ and f0 = 0.5, 2, 3, and 4.5
kHz. Explain the similarities and differences among the various plots.
b) Suppose that f0 = 2 kHz and fs = 50 kHz.
(1) Plot the signal x(n). What is the frequency F0 of the signal x(n).
(2) Plot the signal y(n) created by taking the even-numbered samples of
x(n). Is this a sinusoidal signal? Why? If so, what is its frequency?
CHAPTER 2:
DISCRETE-TIME SIGNALS & SYSTEMS
1. Representations of DT signals
2. Some elementary DT signals
3. Simple manipulations of DT signals
4. Characteristics of DT signals
Sampled signals
-2T -T 0 T 2T 3T 4T 5T 6T 7T . . . nT
x a (t ) x a (nT) x (n ), n
t nT
Representations of DT signals
1. Functional representation
1, n 1,3
x[n ] 4, n 2
0, n
2. Tabular representation
n … -1 0 1 2 3 4…
x[n] … 0 0 1 4 1 0…
Representations of DT signals
3. Sequence representation
x[n] 0 , 1 , 4 , 1
4. Graphical representation 4
1 1
-1 0 1 2 3 4 5 n
Lecture #4
DT signals
1. Representations of DT signals
2. Some elementary DT signals
3. Simple manipulations of DT signals
4. Classification of DT signals
Some elementary DT signals
1 n 0
u[n]
0 n 0
1 1 1
-1 0 1 2 3 4 5 6 n
Time-shifted unit step
1, n n 0
u[ n n 0 ]
0, n n 0
For n0 > 0
1 1 1
0 -n0-1 n0 n0+1 n
Time-shifted unit step
1, n n 0
u[ n n 0 ]
0, n n 0
For n0 < 0
1 1 1
-n0-1 n0 n0+1 0 n
Unit impulse
1 n 0
[n]
0 n 0
-2 -1 0 1 2 n
Time-shifted unit impulse
1, n n 0
[ n n 0 ]
0, n n 0
For n0 > 0
0 n0-1 n0 n0+1 n
Time-shifted unit impulse
1, n n 0
[n n 0 ]
0, n n 0
n0-1 n0 n0+1 0 n
Relation between unit step and
unit impulse
n
u[n ] [k ]
k
[ n ] u[ n ] u[n 1]
x[n ][ n n 0 ] x[n 0 ][n n 0 ]
x[n ][n n
n
0 ] x[n 0 ]
Sinusoidal signal
x (n ) A cos( n ), n
A cos(2Fn ), n
1.5
0.5
-0 . 5
-1
-1 . 5
-2 0 -1 5 -1 0 -5 0 5 10 15 20
Exponential signal
n
x[n ] Ca
1. If C and a are real, then x[n] is a real exponential
a > 1 growing exponential
0 < a < 1 shrinking exponential
-1 < a < 0 alternate and decay
a < -1 alternate and grows
2. If C or a or both is complex, then x[n] is a complex
exponential
An example of real exponential signal
x[n] (0.2)(1.2) n
120
100
80
Amplitude
60
40
20
0
0 5 10 15 20 25 30 35
Tim e index n
An example of complex
exponential signal
1
j n
12 6
x[n] 2e
Re al part
2
-1
-2
0 5 10 15 20 25 30 35 40
Im aginary pa rt
2
-1
0 5 10 15 20 25 30 35 40
Periodic exponential signal
j 0 n
x[n ] Ce C cos( 0n ) j sin( 0n )
k 0 k
F0 or
N 2 N
Fundamental period
0 k # cycles
2 N # po int s
Examples
x3[n ] cos(2n )
Examples
x4 [n ] cos(1.2n )
Lecture #4
DT signals
1. Representations of DT signals
2. Some elementary DT signals
3. Simple manipulations of DT signals
4. Classification of DT signals
Simple manipulations of DT signals
Do it “point by point”
Can do using a table, or graphically, or by
computer program
Example: x[n] = u[n] – u[n-4]
n <=-1 0 1 2 3 >=4
x[n] 0 1 1 1 1 0
Time shifting a DT signal
x[n] 4
1 1
-1 0 1 2 3 4 n
4
x[n-2]
1 1
-1 0 1 2 3 4 n
Examples of time shifting
x[n] 4
1 1
-1 0 1 2 3 4 n
x[n+1] 4
1 1
-1 0 1 2 3 4 n
Time scaling a DT signal
x[n] 4
1 1
-1 0 1 2 3 4 n
x[2n+1] 4 x[2n]
-2 -1 0 1 2 n -1 0 1 2 n
Examples of time scaling
x[n] 4
n x[n] y[n]=x[n/2]
1 1 0 1 1
1 4 ??
?
-1 0 1 2 3 4 n
2 1 4
3 0 ??
?
-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7
w1[n] = x[2n]
-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7
x[n] x[-n]
x[n] 4
1 1
-1 0 1 2 3 4 n
x[-n] 4
-3 -2 -1 0 1 2 3 4 n
Combining time reversal and time shifting
Example 1
x[n]
Method 1
-1 0 1 2 3 4 5 n
Example – Method 2
Method 2
-1 0 1 2 3 4 5 n
Combining time shifting and time scaling
Example x[n] 1
Method 1
-1 0 1 2 3 4 5 n
x[-2n] = w[n]
-4 -3 -2 -1 0 1 2 3 4 5 n
-4 -3 -2 -1 0 1 2 3 4 5 n
Example – Method 2
y[n] = x[2n-3]??
n x[n] y[n]
-1 0 0
0 0 0
y[n] 1 1 1 0
2 4 1
-1 0 1 2 3 4 n 3 1 1
4 0 0
Exercise
x[n] 2
1
-1
0 1 2 3 4 5 n
-1
Lecture #4
DT signals
1. Representations of DT signals
2. Some elementary DT signals
3. Simple manipulations of DT signals
4. Characteristics of DT signals
Characteristics of DT signals
-4 -3 -2 -1 0 1 2 3 4 5 6 7 8
Find x[-n]
2
-6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6
Example
-4 -3 -2 -1 0 1 2 3 4 5 6 7 8
Find xe[n]
Example
Find x[n] - x[-n]
2
-4 -3 -2 -1 0 1 2 3 4 5 6 7 8
Find x0[n]
Energy and power signals
2
Define the signal energy: E x[n]
n
N
Define the signal power: 1 2
P lim
N 2 N 1
n N
x[ n ]
N N
1 2 1 2 N 1
P lim
N 2 N 1
n N
x[ n ] lim
N 2 N 1
n 0
1 lim
N 2 N 1
1/ 2 0
(1 / 2) n , n 0
a n0
(b) x[n ] n n if | a | 1
(2) , n 0 a 1 a
n n0 if | a | 1
Examples
(c) x[n ] cos n (u[n ] u[n 4])
4
cos n 0 n 3 2 2
x[ n ] 4 [n ] [n 1] [n 3]
0 2 2
otherwise
Lecture #5
DT systems
1. DT system
2. DT system properties
Input-output description of DT systems
y[n] = 1/5{x[n]+x[n-1]+x[n-2]+x[n-3]+x[n-4]}
1
Before
0 .5
filtering
0
0 20 40 60 80 1 00 1 20
0 .8
0 .6
After
filtering 0 .4
0 .2
0
0 20 40 60 80 1 00 1 20
Interconnection of DT systems
System1
T1{ }
x[n] y[n]
System2
Parallel T2{ }
connection
= T{x[n]}
Cascade connection
1. DT system
2. DT system properties
DT system properties
• Memory
• Invertibility
• Causality
• Stability
• Linearity
• Time-invariance
Memory
Ex:
a) y[n] = x[n] + 5:
b) y[n]=(n+5)x[n]:
c) y[n]=x[n+5]:
Invertibility
x[n] x[n]
T() Ti()
Ti[T(x[n])] = x[n]
Examples for invertibility
a) y[n] = x[-n]
b) y[n] = (n+1)x[n-1]
c) y[n] = x[(n-1)2]
d) y[n] = cos(w0n+x[n])
b) An accumulator
c) y[n] = cos(x[n])
d) y[n] = ln(x[n])
e) y[n] =exp(x[n])
Linearity
Scaling signals and adding them, then processing through the system
same as
Processing signals through system, then scaling and adding them
If you time shift the input, get the same output, but with the
same time shift
The behavior of the system doesn’t change with time
If T(x[n]) = y[n]
then T(x[n-n0]) = y[n-n0]
Examples for linearity and time-
invariance
Linear
Not time-invariant
Examples for linearity and time-
invariance
a) Memoryless ?
b) Invertible ?
c) Causal ?
Example for DT system properties
2
n 2.5
Given the system below: y[ n ] x[ n ]
n 1.5
c) Stable ?
Example for DT system properties
2
n 2.5
Given the system below: y[ n ] x[ n ]
n 1.5
d) time-invariant ?
e) Linear ?
Lecture #6
DT convolution
1. DT convolution formula
2. DT convolution properties
3. Computing the convolution sum
4. DT LTI properties from impulse response
Computing the response of DT LTI
systems to arbitrary inputs
Method 2:
We can describe any DT signal x[n] as: x[n] x[k ] [n k ]
k
Example: x[n]
-1 0 1 2 3 n
-1 0 1 2 n -1 0 1 2 n -1 0 1 2 n
Impulse response of DT systems
1. DT convolution formula
2. DT convolution properties
3. Computing the convolution sum
4. DT LTI properties from impulse response
Convolution sum properties
h[n]
x[n] y[n]
x[n]
h[n] y[n]
Associative law
h1[n] h2[n]
x[n] y[n]
h1[n]*h2[n]
x[n] y[n]
h2[n] h1[n]
x[n] y[n]
Distributive law
h1[n] + h2[n]
x[n] y[n]
h1[n]
x[n] y[n]
h2[n]
Lecture #6
DT convolution
1. DT convolution formula
2. DT convolution properties
3. Computing the convolution sum
4. DT LTI properties from impulse response
Computing the convolution sum
y[ n ] x[k ]h[n k ]
k
y[n0 ] x[k ]h[n
k
0 k]
Suppose:
Length of x[k] is Nx N1 ≤ k ≤ N1 + Nx – 1
Length of h[n-k] is Nh N2 ≤ n-k ≤ N2 + Nh – 1
N1 + N2 ≤ n ≤ N1 + N2 + Nx + Nh – 2
Length of y[n]:
Ny = Nx + Nh – 1
Example 1
x[n]
-1 0 1 2 3
h[n]
n
-1 0 1 2 3
Ex1 (cont)
x[k]
-1 0 1 2 3 k
h[k]
-1 0 1 2 3 k
h[-k]
y[0] = 6;
-2 -1 0 1 k
Ex1 (cont)
x[k]
-1 0 1 2 3 k
h[-k]
-2 -1 0 1 k
h[-1-k]
y[-1] = 2;
-4 -3 -2 -1 0 k
Ex1 (cont)
x[k]
-1 0 1 2 3 k
h[-k]
-2 -1 0 1 k
y[1] = ?
Ex1 (cont)
x[k]
-1 0 1 2 3 k
h[-k]
-2 -1 0 1 k
y[2] = ?
Ex1 (cont)
x[k]
-1 0 1 2 3 k
h[-k]
-2 -1 0 1 k
y[3] = ?
Ex1 (cont)
x[k]
-1 0 1 2 3 k
h[-k]
-2 -1 0 1 k
y[4] = ?
Example 2
Find y[n] = x[n]*h[n] where x[ n] a nu[ n] h[n] u[n]
Try it both ways (first flip x[n] and do the convolution and then flip
h[n] and do the convolution). Which method do you prefer?
n0
a
Remember! n if | a | 1
a 1 a
n n0 if | a | 1
n1 ( n1 n0 1)
n 1 an0
n n0
a a
1 a
Example 2
Factor out an to
First flip x[n] and do the convolution get form you know
Therefore a n 1 1
y[n ] u[n ]
a 1
Example 2
Therefore a n 1 1
y[n ] u[n ]
a 1
1. DT convolution formula
2. DT convolution properties
3. Computing the convolution sum
4. DT LTI properties from impulse response
Recall impulse response
h[n]*hi[n] = δ[n]
DT LTI properties from impulse response
1
y[n0 ] h[k ]x[n
k
0 k ] h[k ]x[n0 k ]
k 0
h[k ]x[n
k
0 k]
| x[n ] | M x
Take the
absolute:
| y[n ] | h[k ]x[n k ] | y[n] | h[k ]x[n k ]
k k
| y[n ] | M x h[k ]
k
The output is bounded if the impulse response satisfies:
h[n]
n
Examples
Stable Causal
General form:
N M
a k y[n k ] b r x[n r ], a 0 1
k 0 r 0
N, M: non-negative integers
N: order of equation
ak, br: real constant coefficients
Linear constant coefficient difference equations
a
k 0
k y[n k ] br x[n r ], a0 1
r 0
N M
y[n ] ak y[n k ] br x[n r ]
k 1 r 0
with initial condition y[-1] = 10, and with the input x[n] = 2u[n]
n x[n] y[n]
-1 0 10 (initial condition)
0 2 y[0] = x[-1]+2y[-1] = 20
1 2 y[1] = x[0]+2y[0] = 2+2(20) = 42
2 2 y[2] = x[1]+2y[1] = 2+2(42) = 86
Example 2
Find the 1st 3 terms of y[n+2] – y[n+1] +0.24y[n] = x[n+2] -2x[n+1]
n x[n] y[n]
-2 0 1 (initial condition)
-1 0 2 (initial condition)
0 0 y[n] = x[n]-2x[n-1]+y[n-1]-0.24y[n-2]
y[0] = 1.76
1 1 y[1] = 2.28
2 2 y[2] = 1.8576
Closed form solutions of difference equations
b0
x[n] y[n]
Z-1 Z-1
b1 -a1
Z-1 Z-1
b2 -a2
bM -aN
Lecture #8
Block diagram for DT LTI systems
b0
x[n] y[n]
Z-1 Z-1
b1 -a1
Z-1 Z-1
b2 -a2
bM -aN
Direct form II realization of a system
We observe that: these two delays contain the same input and hence
the same output these two delays can be merged into one delay
x[n] b0 y[n]
Z-1 Z-1
-a1 b1
Z-1 Z-1
-a2 b2
-aN bM
Direct form II realization of a system
x[n] b0 y[n]
Z-1
-a1 b1
Z-1
-a2 b2
Suppose
-aN bN M=N
Example of realization LTI system
CHAPTER 3:
THE Z-TRANSFORM & ITS APPLICATION TO
THE ANALYSIS OF LTI SYSTEMS
f (t )e
st
F ( s) dt
f (t )
sampling
f s (t )
f s (t ) f (t ) (t nT ) f (nT ) (t nT )
n n
From Laplace Transform to Z-Transform
st
L[ f s (t )] f (nT ) (t nT ) e dt f (nT ) (t nT )e st dt
n n
n
f (nT ) (t nT )e st dt
n
f (nT )e snT
Sum goes
X ( z ) ZT x[n] x[ n ] z n over all
integer
n
values
X ( z ) ZT x[n] x[ n ] z n
n
Poles pk X(pk) = ∞
Zeros zk X(zk) = 0
Sum goes
from n0 to
infinity
Right-sided signal
Egg Yolk!!!
Left-sided signal
If x[n] has values at some times > 0, then X(z) does not
converge at z = 0 we can’t include 0 in the ROC
Ex: x[n] = u[-n+1]
Donut!!!
n2 n2
x[n] x[k ] [n k ] X ( z ) x[ k ] z k
k n1 k n1
n 0 n 0 1
| az | 1
z
, |z||a|
za
Examples of Z-transform
Find the ZT of the right-sided and the left-sided sequences
a 1
z 1
| a z | 1
X 2 (z) a n z n (a z ) 1 a z
1 n 1
n 1 n 1 1
z | 1
| a
z
, |z||a|
za
n
Find the ZT of the two-sided signal x[n] a
Examples of Z-transform
x[n] =
Examples of Z-transform
Find the ZT of the right-sided-sided signal
x[n] r n sin(bn)u[n]
1 n jbn 1 n jbn
x (n ) r e u (n ) r e u (n )
2j 2j
1 1
(r e ) u (n ) (re jb ) n u (n )
jb n
2j 2j
1 z z
X(z) jb
2j z r e jb
zr e
Z rz sin b
r sin(bn )u (n )
n
, |z||r|
z 2rz cos b r
2 2
Lecture #9
Z-transform properties
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
6. Initial value
7. Final value
Linearity
Z
ax[n] by[n] aX ( z ) bY ( z )
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
8. Initial value
9. Final value
Time shifting
Z
x[n n0 ] z n0 X ( z )
1
w[n] (1) n (3) n 5 u[n 5]
4
Lecture #9
Z-transform properties
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
6. Initial value
7. Final value
Frequency scaling
Z
z
a x[n]
n
X
a
The new ROC is the scaled ROC{X(z)} with factor |a|
(bigger or smaller)
Proof:
ZT {a n x[n ]} a n
n
x[ n ] z n
n
z z
x[n ] X
n a a
Multiplication by an results in a complex scaling in the z-domain
Example of applying the
frequency-scaling property
x[n] a u[n]
n
Lecture #9
Z-transform properties
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
6. Initial value
7. Final value
Multiplication by n
Z dX ( z )
nx[n] z
dz
The new ROC is the same ROC{X(z)}
Proof:
dX ( z ) 1
X ( z) x[n]z
n
n
dz
nx[n ]z
n
n 1
nx[n ]z n
z n
dX ( z )
ZT {nx[n ]} nx[n]z
n
n
z
dz
Example of applying the
multiplication-by-n property
x[n] na nu[n]
Lecture #9
Z-transform properties
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
6. Initial value
7. Final value
Convolution in time
Z
y[n] x[n] h[n] X ( z ) H ( z )
Proof: Z
y[n] x[n] h[n] [ x[k ]h[n k ]]z n
n k
Switching the order of
the summation:
Y ( z)
x[ k
k
] h[ n k ]
n
z n
x[k ]z
k
k
h[ n
n k
k ] z ( n k )
X ( z ).H ( z )
Application of the convolution property
ZT
x[n] X(z)
ZT-1
x[n]*h[n]
ZT
h[n] H(z)
Example
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
6. Initial value
7. Final value
Initial value theorem
If x[n] is causal then x[0] is the initial value of the function x[n]
x[0] lim X ( z )
z
Proof:
X ( z ) x[n]z n x[0] x[1]z 1 x[2]z 2 ...
n 0
Obviously, as z , z n 0
Initial value theorem
x[n0 ] lim[ z X ( z )]
n0
z
Proof:
X ( z) x[ n
n n0
] z n
x[ n0 ] z n0
x[ n0 1] z ( n0 1)
x[ n0 2 ] z ( n0 2 )
...
1. Linearity
2. Time shifting
3. Frequency scaling
4. Multiplication by n
5. Convolution in time
6. Initial value
7. Final value
Final value theorem
Proof: Exercise
Examples
Ex1: unit step u[n]
𝑧
𝑍𝑇 𝑢 𝑛 =
𝑧−1
𝒛
⇒ lim 𝒛 − 𝟏 . = 1=> Ok !
𝒛→𝟏 𝒛−𝟏
1 1 if z 0
n 1
I z dz
2j C 0 if z 0
Z: complex variable
1
x[n ] z ( l n ) 1
dz
n 2 j C
x[l ]
Inverse ZT formula
1
n 1
x[n ] X(z)z dz
2j C
Y ( z)
Distinct poles: rk ( z pk )
z z pk
Partial fraction expansion
Repeated poles:
Z-Transform table
1 (n ) 1
2 (n m) z m
z
3 a u[n ]
n
za
az
4 na u[n ]
n
(z a ) 2
az (z a )
5 n a u[n ]
2 n
(z a ) 3
z ( z a cos )
6 a cos(n)u[n] 2
n
z 2az cos a 2
az sin
7 a sin(n)u[n] 2
n
z 2az cos a 2
Examples of partial fraction expansion
2 z 5z
2
Distinct poles X ( z) z 3
( z 2)( z 3)
Divide X(z) by z, to “save” z for later
X(z) 2z 5 (z 2) (z 3)
z (z 2)(z 3) (z 2)(z 3)
1 1
, | z | 3
z 3 z 2
x (n ) (3n 2 n )u (n )
Examples (cont)
2z
Repeated poles X( z ) , z 2
(z 2)(z 1) 2
X( z ) 1 A B C
, | z | 2
2z (z 2)(z 1) 2
z 2 z 1 (z 1) 2
z 2az cos a 2
(0.5)z sin
4 3
X(z) x | z | 0.5
3 z 2 2(0.5)z cos (0.5) 2
3
4
x (n ) (0.5) sin n u (n )
n
3 3
Examples (cont)
z 4
Time-shift W ( z) 2 z 3
property z 2z 3
W(z) z 5 z 5 14 1
5
2 4
z
z z 2z 3 (z 1)(z 3) z 1 z 3
1 n 5 1 n 5
w[n ] (1) u[n 5] (3) u[n 5]
4 4
Examples (cont)
1 a n 1
y[n ] u[n ]
1 a
Examples (cont)
Find the output y(n) to an input x(n) = u(n) and an LTI
system with impulse response h(n) = -3nu(-n-1)
1 3 n
y[n] u[n] (3) u[n 1]
2 2
Lecture #10
Inversion of Z-transform
1 2
X ( z) ... a2 z a1 z a0 z a1 z a2 z ...
2 1 0
an x[n]
Examples of power series expansion
1 2
X ( z ) 1 2 z 3z ROC : | z | 0
x (0) 1
x (1) 2
x (2) 3
x (n )(n 0,1,2) 0
Examples (cont)
1
X( z) 1
, ROC : z a
1 az
1 2 2 3 3
Long division X(z) 1 az a z a z ...
x (0) 1
x (1) a
x ( 2) a 2
x (3) a 3
...
x (n )(n 0) 0
Lecture #11
Analysis of LTI systems in the Z-domain
1. Transfer function
2. LTI system properties from transfer function
3. Unilateral Z-transform
4. Using unilateral Z-Transform to solve the difference
equations
Transfer function
(1) Find the difference equation, then find H(z) from equation
(2) Put X(z) as input, then directly find Y(z) from block diagram
Transfer function from difference equation
N M
a
k 0
k y[n k ] b r x[n r ]
r 0
ZT
N M
-Linear
a
k 0
k z Y( z ) b r z X( z )
k
r 0
r
-Time-shift M
Y(z) r
b z r
a
X(z) k
k z
k 0
Transfer function from difference equation
Suppose M = N
M N
Y ( z) b z r
r
b z r
r
H ( z) r 0
N
r 0
N
k k
X ( z) k k
a z a z
k 0 k 0
Example
For the α-filter:
y(n) (1 ) y(n 1) x(n)
M
Its transfer function: r
b z r
H ( z) r 0
N
1 (1 ) z 1
k
a
k 0
z k
0.1z
H ( z)
z 0.9
Transfer function from block diagram
D
x[n] y[n]
Z-1
X(z) Y(z)
Transfer function from block diagram
Find the transfer function of this feedback system
w[n]
x[n] H1(z) y[n]
H2(z)
Y ( z) H1 ( z )
H ( z)
X ( z ) 1 H1 ( z ).H 2 ( z )
Lecture #11
Analysis of LTI systems in the Z-domain
1. Transfer function
2. LTI system properties from transfer function
3. Unilateral Z-transform
4. Using unilateral Z-Transform to solve the difference
equations
Causality
Recall:
Causal system h[n] 0 n 0
h(n) is right-sided signal ROC of transfer function is
| z | rmax
An LTI system is causal if and only if the ROC of the transfer
function is the exterior of a circle of radius rmax < ∞
including the point z = ∞
Causality (cont)
h[n ] u[n 1]
z
H ( z) ROC :| z | 1
z 1
Recall:
Stable system h[n]
n
p = roots(den)
1. |z|>1.2: causal, unstable
2. 0.8<|z|<1.2: non-causal, stable
3. 0.5≠|z|<0.8: non-causal, unstable
Examples
Ex2: A LTI system is characterized by:
3 4 z 1 z ( 3 z 4) z 2z
H ( z) 1 2
2
1 3.5z 1.5z z 3.5z 1.5 z 0.5 z 3
Specify the ROC of H(z) and find h[n] for the following conditions:
1. The system is stable
2. The system is causal
3. The system is anticausal
Examples
Ex2: A LTI system is characterized by:
3 4 z 1 z ( 3 z 4) z 2z
H ( z) 1 2
2
1 3.5z 1.5z z 3.5z 1.5 z 0.5 z 3
Invertibility
H(z).Hi(z) = 1
Hi(z) = 1/H(z)
X(z) X(z)
H(z) Hi(z)
Invertibility
Hi(z) is stable: all poles (zeros of H(z)) lie inside the unit circle.
1. Transfer function
2. LTI system properties from transfer function
3. Unilateral Z-transform
4. Using unilateral Z-Transform to solve the difference
equations
Unilateral Z-Transform
1. It does not contain information about the signal x[n] for n<0
1. Transfer function
2. LTI system properties from transfer function
3. Unilateral Z-transform
4. Using unilateral Z-Transform to solve the
difference equations
Using Z-transform to solve the
difference equation
N M
a
k 0
k
y[n k ] br x[n r ]
r 0
9 z3
1 z 1
Y(z)
9 z 3 1 3z 2z
1 2
1 z z2
Y(z)
9 z 3 z 2 3z 2
Example
a) x[n ] 4 u[n 1] ,
1 n
h[n ] [1 ( ) ]u[n ]
1 n
2
∞ 𝑛
b) 𝑥 = 𝑛=4 0.2
∞ 𝑛 cos(0.2n)
c) 𝑥 = 𝑛=0 0.2
Homework 3
T
x(t)
2
a e
j nt
Fourier series: x (t ) n
T
t
n
T /2 2
1 j nt
Fourier coefficients: an
T
T / 2
x (t )e T
dt
Power density spectrum of periodic signal
A periodic signal has infinite energy and finite average power, which is
T /2 T /2
1 1
Px | x (t ) | dt x(t ). x * (t )dt
2
T T / 2
T T / 2
2
1
T /2
nt
x (t ) an e
j
dt
* T
T T / 2 n
* 1
T /2
j
2
an dt | an |2
nt
n T
T / 2
x (t )e T
n
T /2
1
Parseval’s relation: Px
T | x ( t ) |2
dt n
| a
n
|2
T / 2
Lecture #13
Review of CTFT and Sampling
X( ) x (t )e
jt
dt FT x (t )
x (t )
1
X ( )e
jt
d FT 1
X ( )
2
Fourier transform properties
F
Linearity: ax(t) by(t) aX ( ) bY ( )
F
- j
Time shift: x (t ) e X ( )
F
Time reverse: x ( t ) X ( )
F
Convolution in
time domain:
x (t ) * y (t ) X ( ).Y ( )
F 1
Multiplication in x (t ). y (t ) X ( ) * Y ( )
time domain: 2
Energy density spectrum of aperiodic signal
Let x(t) be finite energy signal, which is
Ex dt x(t ). x * (t )dt
2
| x ( t ) |
1
x (t ) X * ( )e
jt
d dt
2
1
1
X * ( ) x (t )e dt d | X ( ) |
jt
2
d
2 2
1
Parseval’s relation: E x | x(t ) | dt
2
| X ( ) |2
d
2
Lecture #13
Review of CTFT and Sampling
x(t )
xs (t )
sampling
xs (t ) x(t ) (t nT ) x(nT ) (t nT )
n n
p(t ) (t
n
nT )
FT
P( ) 2an ( ns )
n
1 T /2 1
an (t )e dt
T T / 2
jt
T
P( ) ( n )
n
s s
1
X s ( ) X ( ) * s ( ns )
2 n
s
1
2
n
X ( ns ) X ( ns )
T n
The effect of sampling is an infinite sum of scaled, shifted
copies of the continuous time signal's Fourier Transform
Lecture #13
Review of CTFT and Sampling
0 ωb ωs
Aliasing (cont)
Avoid
aliasing:
sampling faster
than twice the
highest
frequency
component –
The Nyquist-
Shannon
sampling
theorem
Examples
Examples
Examples
Examples
Lecture #14
Discrete-Time Fourier Transform (DTFT)
X() DTFTx[n ] x[n] e j n
n
x[n ]e
n
jn
x[n ]e
n
jn
x[n ] e
n
jn
x[n ]
absolutely
summable
n
Examples
j
1 e
X() a e n jn
(ae )
j n
j
DTFT nexists
0 when: n 0 1 ae j
e a
if |a| < 1
Examples
0
1 a
Y() a e
n
n jn
(a e )
n 0
1 j n
1 a e
1 j
j
e a
if |a| > 1
Examples
n 0
Recall ZT of x(t):
X( z) x[n]z
n
n
X( z )
z e j
x[n]e
n
j n
X()
From ZT to DTFT
X () X ( z )
z e j
If the ROC of the ZT contains the unit circle, we can get the
DTFT from the ZT by substitution z = ejΩ
Example
z
X ( z) ROC :| z || a |
za
DTFT exists when ROC includes the unit circle, which
means |a| < 1:
e j
X ( ) X ( z ) j
z e j e a
Lecture #14
Discrete-Time Fourier Transform (DTFT)
1
X ( ) k 2
2 | sin( / 2) |
e j e j / 2 .e j / 2 e j / 2
X () j j / 2 j / 2 j / 2 (2k 1)
e 1 e (e e ) 2 cos( / 2)
1
X ( ) (2k 1)
2 | cos( / 2) |
1 1
j n j l
2
j l
X()e d
2 n
x[n ]e
e d
1 j ( l n )
x[n ] e d x[l]
n 2
1
j n
x[n ] X() e d
2
Examples
1, c
Ex1. Find x(n) from its DTFT X(Ω): X ( )
0, c
1 c
1 jn c sin c n
x[n ] 1.e d
jn c
.e c
2 c
2jn c n
0.7
0.6
0.5
0.4
0.3
0.2
0.1
-0.1
-π -Ωc 0 Ωc π Ω -0.2
-20 -15 -10 -5 0 5 10 15 20
Examples
X () e e
2 4 2 4
1 1 1
x[n ] [n 2] [n ] [n 2]
4 2 4
1 0.5
0.9 0.45
0.8 0.4
0.7 0.35
0.6 0.3
0.5 0.25
0.4 0.2
0.3 0.15
0.2 0.1
0.1 0.05
0 0
-2 0 2 -5 0 5
Examples
e j
Ex3. Find x(n) from its DTFT X(Ω): X()
e j 2
z
X(z) | z | 2
z2
x[n ] 2 u[n 1]
n
SUMMARY
Lecture #15
DTFT properties
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Linearity
DTFT
ax[n ] by[n] aX() bY()
a n 0
n
1
n
a n0 a
z z 1
X ( z) ROC :| a || z |
z a z 1/ a |a |
j j j j
e e e ae
X () j j j j
e a e 1 / a e a ae 1
1 a2 1 a2
j j
1 ae ae a 2
1 2a cos a 2
Example (cont)
1 For a = 0.8
0.5
0
-20 -15 -10 -5 0 5 10 15 20
10
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Lecture #15
DTFT properties
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Time shifting
DTFT
x[n n 0 ] e j n 0
X()
Proof: infer from the shifting property of ZT, then
evaluate ZT on the unit circle
ZT
x[n n 0 ] z X(z) n 0
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Frequency shifting and modulation
DTFT
e j 0 n
x[n ] X ( 0 )
DTFT
1 1
cos(0 n ) x[n ] X ( 0 ) X ( 0 )
2 2
Proof:
DTFT
e j 0 n
x[n] (e
n
j 0 n
x[n])e jn
x[ n
n
]e j ( 0 ) n
X ( 0 )
1 j 0 n 1 j 0 n
cos( 0 n) e e ...
2 2
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Differentiation in the frequency domain
DTFT dX ()
nx[n] j
d
Z dX ( z )
nx[n ] z
dz
j dX () j dX () dX ()
DTFT
nx[n ] e j
e j
j
d (e ) je d d
Lecture #15
DTFT properties
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Convolution in time domain
DTFT
x1[n ] x 2 [n] X1 ().X2 ()
Proof:
j
e
H () j
e a
j
e a j
H i() j
1 ae
e
hi [n ] [n ] a [n 1]
Lecture #15
DTFT properties
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Convolution in frequency domain
DTFT
1 1
x1[n ].x 2 [n ]
2 2
X1 ()X 2 ( )d X1 () X 2 ()
2
DTFT
x1[n ].x 2 [n ] 1
( x
n
[ n ].x 2
[ n ])e jn
Multiplication
1
in time X ( ) e j n
d 2
x [ n ]e jn
n 2 2
1
1 x [n ] e j( ) n d
X ( ) 2
2 2 n
1
1
2 2
X1
( ) X 2
( ) d Convolution in
frequency
Lecture #15
DTFT properties
1. Linearity
2. Time shifting
3. Frequency shifting and modulation
4. Differentiation in the frequency domain
5. Convolution in time domain
6. Convolution in frequency domain
7. Symmetry
Symmetry properties
Consider x[n] and X(Ω) are complex-valued functions
X () x[
n
n ]e jn
(x
n
R [n ] jx I [n ])(cos n j sin n )
X R () jX I ()
X R() (x
n
R [n ] cos n xI [n ] sin n )
X I() ( xR [n ] sin n x I [n ] cos n )
n
Symmetry properties
Consider x[n] and X(Ω) are complex-valued functions
1
jn
x[n ] X ( ) e d
2
1
2
[ X R () jX I ()](cos n j sin n )d
xR [n ] jx I [n ]
1
xR [n ]
2 [ X
R () cos n X I () sin n ]d
1
x I [n ]
2 [ X
R () sin n X I () cos n ]d
Real signal
x[n ] xR [n ] and x I [n ] 0
X R() x[n] cos n X
n
( ) : even
R
X I() x[n ] sin n X I( ) : odd
n
X * () X ( )
| X () | X 2 () X 2 () | X ( ) |: even
R i
X I ()
X () arctg X ( ) : odd
X R ()
Real signal (cont)
x[n ] even :
X R () x[0] 2 x[n ] cos n; X I () 0
n 1
1
x[n ]
X
0
R () cos n d
x[n ] odd :
X I () 2 x[n ] sin n; X R () 0
n 1
1
x[n ]
X
0
I () sin n d
x[ n ] X ()
Symmetry x * [n ] X * ( )
properties x * [ n ]
X * ()
x R [n ] X e ()
jx I [n ] X o ()
xe [ n ] X R ()
xo [n ] jX I ()
X () X * ( )
any real signal | X () || X ( ) |
X () X ( )
real and even real and even
real and odd imaginary and odd
Lecture #16
Frequency spectrum of DT signals
1. Frequency spectrum
2. Amplitude spectrum and phase spectrum
3. Energy spectral density (ESD)
4. Bandwidth
Frequency spectrum
1. Frequency spectrum
2. Amplitude spectrum and phase spectrum
3. Energy spectral density (ESD)
4. Bandwidth
Amplitude spectrum and phase spectrum
j ( )
X () X () e
Amplitude spectrum Phase spectrum
X ( ) x[n]e
n
jn
; X ( ) x[n]e
n
jn
X ( ) X ( )
*
0
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
-2
-4
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Phase spectrum
Lecture #16
Frequency spectrum of DT signals
1. Frequency spectrum
2. Amplitude spectrum and phase spectrum
3. Energy spectral density (ESD)
4. Bandwidth
Energy spectral density (ESD)
1
E | x[n] | x[n]x [n] x[n]
2 *
X
*
()e jn
d
n n n 2
1
jn 1
E X () x[n ]e d X() d
* 2
2 2
n
Energy spectral density
Example
2.5
mat do pho nang luong
E
S 1.5
D
1
0.5
0
-3 -2 -1 0 1 2 3
tan so omega
Lecture #16
Frequency spectrum of DT signals
1. Frequency spectrum
2. Amplitude spectrum and phase spectrum
3. Energy spectral density (ESD)
4. Bandwidth
Bandwidth of a signal
Low-frequency High-frequency
signal signal
Ω Ω
Ω Ω
Lecture #17
Frequency-domain characteristics of LTI systems
1 0.3e j
H ()
1 0.1e j 0.85e j 2
Example of amplitude and phase responses
1
H()
1 0.4e j
Example of amplitude and phase responses
1
H()
1 0.4e j
2
1.5
0.5
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0.5
-0.5
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Example of moving average filter
1
y[n ] ( x[n 1} x[n ] x[n 1])
3
1 j j 1
H () ( e 1 e ) (1 2 cos )
3 3
Hence
1
| H () | | 1 2 cos |
3
0, 0 2 / 3
H ()
, 2 / 3
Example of moving average filter
1
0.5
0
0 0.2 0.4 0.6 0.8 1
0
0 0.2 0.4 0.6 0.8 1
Lecture #17
Frequency-domain characteristics of LTI systems
x[n] Ae j0 n
, n y[n ] h[k] x[n k]
k
y[n] h[ k
k
] Ae j 0 ( n k )
A h[k ] e
j 0 k j 0 n
e
k
j 0 n
( Ae ) H ( 0 ) x[n]H ( 0 )
2 j26.6 2A
j n j n 26.60
y[n ] x[n ]H Ae . e
0
2
2
e
2 5 5
Response to sinusoidal signals
A j n A j n
x[n ] A cos(0 n ) e e 0
, n 0
2 2
A j0n A j0n
y[ n ] e H ( 0 ) e H ( 0 )
2 2
A j0n jH ( 0 ) A j0n
e | H (0 ) | e e | H (0 ) | e jH ( 0 )
2 2
A
| H (0 ) | e e
2
j0n jH ( 0 )
e j0n jH ( 0 )
e
y[n] A | H (0 ) | cos0n H (0 )
Example
x[n] 5 12 sin n 20 cos n , n
2 4
One more example
b
H ( )
1 ae j
The amplitude response and phase response are:
One more example
1 a 0.1
| H () |
1 a 2 2a cos 1.81 1.8 cos
0.9 sin
H () 0 arctg
1 0.9 cos
One more example
b) 1
0.5
0
0 0.2 0.4 0.6 0.8 1
-0.5
-1
-1.5
0 0.2 0.4 0.6 0.8 1
One more example
c) The amplitude and phase response at Ω=0, π/2, and π
respectively:
The output:
Lecture #17
Frequency-domain characteristics of LTI systems
n 1 j ( n 1)
Aa e A
y[n ] a y[1]
n 1
e jn
e jn
, n0
1 ae j 1 ae j
n 1 j ( n 1)
Aa e A
y[n ] a y[1]
n 1
e jn
e jn
1 ae j
1 ae j
M M
x[n ] A k z n
k yss[n ] A k H(z k )z n
k
k 1 k 1
Lecture #17
Frequency-domain characteristics of LTI systems
Y ( ) X ( ) H ( ) For 0 :
| Y () || X (
. ) || H ( ) | | Y (0 ) || X (0 ) || H (0 ) |
Y () X () H () Y (0 ) X (0 ) H (0 )
1
ESD | Y () | 2
1.6 2
1.4
X(Ω) 1.5 H(Ω)
1.2
1
1
0.8 0.5
0 0.5 1 0 0.5 1
3 80
Y(Ω) 60 ESD
2
40
1
20
0 0
0 0.5 1 0 0.5 1
Lecture #18
Digital filters
1. Digital filters
2. Ideal filters
Filters
.
Example of signal after highpass filtering
.
Lecture #18
Digital filters
1. Digital filters
2. Ideal filters
Ideal digital filters
Cx[n n 0 ], 1 2
y[n ]
0 ,
Y() CX()e j n 0
X()H(), 1 2
Ce j n , 1 2
0
H ( )
0,
| H() | C, 1 2 - Constant gain
() n 0 , 1 2 - Linear phase
Amplitude responses for some
ideal digital filters
| H() | | H() |
c c
| H() | | H() |
a b a b
Ideal digital lowpass filters
1, c
Frequency response: H L ( )
0, c
c
1 c sin c n
1.e
jn
hL [n] d
2 c
c n
0.7
0.6
0.5
0.4
0.3
0.2
0.1
-0.1
-π -Ωc 0 Ωc π Ω -0.2
-20 -15 -10 -5 0 5 10 15 20
Ideal digital highpass filters
Frequency response: 1, c
H H ( )
0, c
sin n c sin c n
H H () H L 2 () H L1 () h[n]
n c n
0.4
HL1
HL2
0.3
0.2
0.1
-0.1
-π -Ωc 0 Ωc π Ω -0.2
-0.3
-20 -15 -10 -5 0 5 10 15 20
Ideal digital bandpass filters
Frequency response: 1, c1 c 2
H B ( )
0, elsewhere
HL1 0.08
HL2 0.06
0.04
0.02
-0.02
-0.04
-0.08
-20 -15 -10 -5 0 5 10 15 20
Ideal digital bandstop filters
1, c1
Frequency response:
H B () 0, c1 c 2
1, c 2
c1 sin c1n c 2 sin c 2n
H H () H L () H H () h[n] [n ]
c1n c 2 n
0.6
HH HL 0.5
0.4
0.3
0.2
0.1
-π -Ωc2 0 Ωc1 π Ω 0
-0.1
-20 -15 -10 -5 0 5 10 15 20
Amplitude responses for some actual digital filters
CHAPTER 5:
DISCRETE FOURIER TRANSFORM (DFT)
1 2
x[n] a e
k N
k
jk0 n
; ak
N
x[n]e
n N
jk 0 n 0
N
. . . -2N -N 0 N 2N . . . . .
N 1 2
p[n] ak e
jk n
N
k 0
1 N1 1
a k p[n ]e jk 2 n / N
N n 0 N
Lecture #19
DTFT of periodic signals
F
x[n ] X() 2 a k ( k0 )
k
Example of calculating DTFT of
periodic signals
Height = 1
Spacing = N
. . . -2N -N 0 N 2N . . . . . . . . n
2 2
P() 2 a k k0 k
k N k N
2π/N 2π/N 2π/N 2π/N 2π/N Height = 2π/N
Spacing = 2π/N
0 N-1
x[n] 0 n N 1
x0 [n]
0 otherwise
Another approach (cont)
x[n] 0 n N 1
x0 [n]
0 otherwise
x[n] x [n kN ] x [n] [n kN ] x [n] [n kN ]
k
0
k
0 0
k
p(n) in previous
example
F
x[n] x0 [n] p[n] X 0 () P() X ()
Another approach (cont)
F
x[n] x0 [n] p[n] X 0 () P() X ()
2 2
X () X 0 ()
N k
( k )
N
2 2 2
N k
X 0 (k
N
) ( k
N
)
Step 1:
Start with x0(n) – one period of x(n), with zero everywhere else
Step 2:
Find the DTFT X0(Ω) of the signal x0[n] above
Step 3:
Find X0(Ω) at N equally spacing frequency points X0(k2π/N)
Step 4:
2 2 2
Obtain the DTFT of x(n): X ()
N
k X 0 (k N ) ( k N )
Example of calculating DTFT of
periodic signals
0 1 2 3
3
X 0 () x0 (n)e jn
1 e j
2e j 3
n 0
Discrete time
signal x(n)
window
Discrete time
signal x0(n)
Finite length
Building the DFT formula (cont)
Continuous time
signal x(t)
sample
Discrete time
signal x(n)
N 1
window X 0 () 0
x [ n
n
]e jn
0
x [
n 0
n ]e jn
DTFT
Discrete time
signal x0(n)
Finite length
Building the DFT formula (cont)
Continuous time
signal x(t)
Discrete Fourier Transform DFT X(k)
Discrete + periodic with period N
sample
Sample
Discrete time at N
signal x(n) values
around
window the unit
circle
DTFT
Discrete time X0(Ω)
signal x0(n) Continuous + periodic
Finite length with period 2π
Notation conventions
Notation conventions (cont)
DFT and inverse DFT formulas
2
j
Notation WN e N
k = 0 X(k) = X(0) = N
k ≠ 0 X(k) = 0
DFT and IDFT examples
fs 2
f
N N
The choice of N determines the resolution of the frequency
spectrum, or vice-versa
0
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0 1 2 3 4 5 6 7 8 9 10
0
0 5 10 15 20 25 30
Examples of N = 15 and N = 30
6
0
0 0.5 1 1.5 2 2.5 3 3.5 4
0
0 5 10 15 20 25 30
0
0 10 20 30 40 50 60
Lecture #21
DFT properties
X(k)
N periodic extension Xp(k)
Finite length
Periodic
truncate
DFT properties
X(k)
N periodic extension Xp(k)
Finite length
Periodic
truncate
Periodicity
DFT
a1 x1[n] a2 x2 [n] a1 X 1[k ] a2 X 2 [k ]
Proof:
DFT
x[n m] W X[k ] km
Proof:
Infer from the relation between DFT and DTFT
DTFT
x[n m] e jm X ()
2
k :
N
2
jk m
e jm X () e N
X [k ] W km X [k ]
x(n)
Circular
xp(n)
time
xp(n+2)
shift
x(n+2)
DFT
ln
x[n]W X [k l ]
Proof:
Similar to the circular time shift property
Lecture #21
DFT properties
DFT N 1
X 1[k ]. X 2 [k ] x1[n] x2 [n] x1[ p]x2 [n p]
p 0
0 1
2 3 1 4 2 0 2 4
2 3
3 3
y(0) = 16 y(1) = 18
Example (cont)
2 3
2 1 3 4 2 2 0 4
0 1
3 3
y(2) = 16 y(3) = 10
Another method to calculate circular convolution
DFT N 1
1 1
x1[n]. x2 [n] X 1[k ] X 2 [k ]
N N
X [l ] X [ k l ]
l 0
1 2
N 1 N 1
1
n 0
x[n] y * [n]
N
X [k ]Y * [k ]
k 0
Special case:
N 1 N 1
1
n 0
| x[n] |
2
N
|
k 0
X [ k ] |2
Parseval’s theorem example
N 1
|
n 0
x[ n ] |2
12
2 2
32
12
15
N 1
1 1 2 60
N
k 0
| X [k ] | (7 2 1 1 2 1 )
2
4
2 2 2 2 2
4
15
Lecture #22
Fast Fourier Transform (FFT)
1. What is FFT?
2. The decomposition-in-time Fast Fourier
Transform algorithm (DIT-FFT)
3. The decomposition-in-frequency Fast
Fourier Transform algorithm (DIF-FFT)
Recall DFT and IDFT definition
N 1
X[k ] x[n ]W nk
N 0 k N 1 Nth complex
root of unity:
n 0
2
j
1 N 1 WN e
x[n ] X[k ]WN nk
N
0 n N 1
N n 0
Using some "tricks" and choosing the appropriate N value, the DFT
can be implemented in a very computationally efficient way – this is
the Fast Fourier Transform (FFT) - which is the basis of lots of
contemporary DSP hardware
Fast Fourier Transform (FFT)
N
log N complex multiplications
2
N 2 2
Comparison of DFT and FFT efficiency
10000
Complex multiplication numbers
8000
6000
4000
2000
FFT
0
N
-2000
0 10 20 30 40 50 60 70 80 90 100
Comparison of DFT and FFT efficiency
4 16 4 4.0
8 64 12 5.3
16 256 32 8.0
32 1,024 80 12.8
64 4,096 192 21.3
128 16,384 448 36.6
256 65,536 1,024 64.0
512 262,144 2,304 113.8
1024 1,048,576 5,120 204.8
FFT (cont)
Some properties of W can be exploited in performing
nk
N
FFT:
W
k ( N n)
N
W N
kn
*
W kn , complex conjugate symmetry
N
k ( n N ) (k N )n
W N W N
kn
W N
, periodicit y in n and k
W N , if n odd
kn
N N
W
2 kn kn
W N
N
2
Lecture #22
Fast Fourier Transform (FFT)
1. What is FFT?
2. The decomposition-in-time Fast
Fourier Transform algorithm (DIT-FFT)
3. The decomposition-in-frequency Fast
Fourier Transform algorithm (DIF-FFT)
DIT-FFT with N as a 2-radix number
X [k ]
neven
x[n]W kn x[n]W kn
nodd
m0 m0
N 1 N 1
2 2
= x[2 m](W 2 mk
) W k
x[2 m 1](W )
2 mk
m0 m0
Note: W e
2
N
j2 / N 2
e j 2 /( N / 2 )
WN / 2
N
1 N
1
X (k ) g[m]W h[m]W
2 2
W G(k ) W N H (k )
mk k mk k
N /2 N N /2
m 0 m 0
X [k ]4 G[k ]2 W H [k ]2
4
k
x[0]
X [0] G[0] W40 H [0]
X [0] G[0] W40 H [0]
X [1] G[1] W41H [1] W0
DFT
X [2] G[0] W H [0]
4
2
W1
# multiplications are
reduced: 22 = 4 0;
just 2 additions!!! x[1] -1 X[1]
Example
DFT
of N=4
8-point
FFT
DFT
N=4
0
H[0]
W0 W
FFT DFT N = 2
H[1]
W2
(cont) W0 H[2]
W4
DFT N = 2
H[3]
W6
Second step: split each of 4-point DFT into two 2-point DFTs
W0 W0
Example
W2 W1
of
W4 W2
8-point W6 W3
W0 W0 W4
FFT
W2 W5
(cont) W0
W4 W6
W6 W7
Third step: combine all signal flow graphs of step 1 and step 2
Wr -1
Wr+N/2 = -Wr
The
overall
signal
flow
graph
for
8-point
DIT-FFT
Now the overall computation is reduced to:
N
log N complex multiplications
2
N 2 2
In-place computation
a A
b B
Wr -1
1. What is FFT?
2. The decomposition-in-time Fast Fourier
Transform algorithm (DIT-FFT)
3. The decomposition-in-frequency Fast
Fourier Transform algorithm (DIF-FFT)
DIF-FFT with N as a 2-radix number
We divide X(k) in half – first half and second half
( N / 2 ) 1 N 1
X (k )
n 0
x(n)W kn
N x ( n )
n ( N / 2 )
W kn
N , k 0,1,..., N 1
N x n WN
kn k2
x ( n )W
n ( N / 2 ) n 0 2 n 0 2
Since: k N2 j ( k 2 / N )( N / 2 ) j
e e ( 1)
k
W N
then
x(n) (1)
( N / 2 ) 1
X (k ) k
x(n N / 2) WNkn , k 0,1,..., N 1
n 0
DIF-FFT (cont)
Decompose X(k) into two frequency sequences, even and odd:
( N / 2 ) 1
then,
( N / 2 ) 1
x[0] + x[2]
x[0] X[0]
x[1] X[2]
x[1] + x[3] -1
(x[0] - x[2])W40
-1
x[2] X[1]
W40
-1
x[3] X[3]
W41 (x[1] - x[3])W41 -1
Lecture #23
DFT applications
0.5
Ts = 1s
0
0 0.5 1 1.5 2 2.5 3
n
3
%Error of sample 1 = 50%
magnitude
0
0 1 2 3 4 5
omega
Example
1
f(t) = rect[(t-1)/2]
F(ω) = 2sinc(ω)e-jω
f[n]
0.5
Ts = 0.2s
0
0 5 10 15
n
3
%Error of sample 1 = 10%
magnitude
0
0 5 10 15 20 25 30
omega
Example
1 f(t) = rect[(t-1)/2]
F(ω) = 2sinc(ω)e-jω
f[n]
0.5 Ts = 0.1s
0
0 5 10 15 20 25 30 35
n
3
%Error of sample 1 = 5%
magnitude
0
0 10 20 30 40 50 60 70
omega
Windowing
Source of error: truncation or “windowing” of the periodic
extension of the DT sequence implied in the DFT development
Windowing = multiplying the periodic extension of x[n] by a
rectangular function with duration N.T DFT involves a convolution
DFT = sampled(DTFT*sinc)
This multiplication causes spectrum-leakage distortion
To reduce the affect of spectrum-leakage distortion:
- Increase the sampling frequency
- Increase the number of samples
- Choose an appropriate windowing function (Hamming, Hanning)
Lecture #23
DFT applications
y[n] x1[n] * x2 [n] x [ p]x [n p]
p
1 2
N 1
y[n] x1[n] x2 [n] x1[ p]x2 [n p]
p 0
Zero padding
x1(n) x’1(n) DFT
(N2-1) zeros
N1 samples IDFT
Zero padding x1(n)*x2(n)
x2(n) x’2(n) DFT
(N1-1) zeros
N2 samples
Example of calculation of the linear convolution
x1(n) = [ 1 2 3 4 ]; x2(n) = [ 0 1 2 3 ]
x’1(n) = [ 1 2 3 4 0 0 0 ]; x’2(n) = [ 0 1 2 3 0 0 0 ]
X’1(k) = [ 10, -2.0245-j6.2240, 0.3460+j2.4791, 0.1784-
j2.4220, 0.1784+j2.4220, 0.3460-j2.4791, -2.0245-j6.2240 ];
X’2(k) = [ 6, -2.5245-j4.0333, -0.1540+j2.2383, -0.3216-
j1.7950, -0.3216+j1.7950, -0.1540-j2.2383, -2.5245+j4.0333];
Y’(k) = [ 60, -19.9928+j23.8775, -5.6024+j0.3927, -5.8342-
j0.8644, -4.4049+j0.4585, -5.6024-j0.3927, -19.9928
+j23.8775 ]
IDFT{Y’(k)} = y’(n) = [ 0 1 4 10 16 17 12 ]
Lecture #24
Using DFT/FFT in filtering
h(n)
x(n)
Example of overlap-add technique
x0(n)
x1(n)
x2(n)
Example (cont)
y0(n)
y1(n)
y2(n)