DTFT DFT FS Ch8
DTFT DFT FS Ch8
DTFT DFT FS Ch8
o Introduction
o DTFS & Properties
o FT of periodic signals
o Summary
Dr. Aishy Amer
Concordia University
Electrical and Computer Engineering
Figures and examples in these course slides are taken from the following sources:
•A. Oppenheim, A.S. Willsky and S.H. Nawab, Signals and Systems, 2nd Edition, Prentice-Hall, 1997
•A.V. Oppenheim, R.W. Schafer and J.R. Buck, Discrete-Time Signal Processing
•M.J. Roberts, Signals and Systems, McGraw Hill, 2004
•J. McClellan, R. Schafer, M. Yoder, Signal Processing First, Prentice Hall, 2003
•Slides 2-22 are from http://metalab.uniten.edu.my/~zainul/images/Signals&Systems
Periodic DT Signals
Time N 1
X [k ] x[n]e j0 kn X ( e j ) x[n]e
n
j n
n 0
5
Overview of Fourier Analysis
Methods
Variable Period Continuous Discrete
Frequency Frequency
DT x[n] n N k
k 2k / N
CT x(t) t T k
k 2k / T
• DT-FS: Discrete in time; Periodic in time; Discrete in Frequency; Periodic in Frequency
• DT-FT: Discrete in time; Aperiodic in time; Continous in Frequency; Periodic in Frequency
• CT-FS: Continuous in time; Periodic in time; Discrete in Frequency; Aperiodic in Frequency
• CT-FT: Continuous in time; Aperiodic in time; Continous in Frequency; Aperiodic in Frequency
6
Negative frequency?
7
Negative Frequency?
8
Negative Frequency?
9
Outline
o Introduction
o DTFS & properties
o DTFT of periodic signals
o DFT: Sampling of the DTFT
o DTFT, DTFS, DFT, DFS, FFT, ZT: numerical (Matlab)
o Summary
10
Discrete-Time Fourier Series (DTFS)
~ 1 ~
The FS can be written as x[n] Xk e j2 / Nkn
N k
(Recall: the FS of continuous-time periodic signals require infinite many complex exponentials)
Not that for DT periodic signals we have
~ N 1
~
Xk x[n]e j2 / N kn
n0
11
DTFS Pair
Analysis equation ~
N 1
Xk ~
x[n]W kn
N
n0
~ 1 N 1 ~
Synthesis equation x[n] Xk WNkn
N k 0
12
Concept of DTFS
13
The DTFS
14
The DTFS
15
The DTFS
16
The DTFS
17
The DTFS
18
The DTFS
19
Example: periodic square
20
Example: periodic square
- We know that
21
Example: periodic square
22
Example: periodic square
23
Example: periodic square
24
Example: periodic impulse train
~
1 n rN
DFS of a periodic impulse train x[n] n rN
r 0 else
25
Properties of DTFS
~ ~
x1 n DFS
X1 k
~ ~
x n
2 DFS
X2 k
Linearity ~ ~
a~
x1 n b~
x2 n aX1 k bX2 k
DFS
~ ~
x n DFS
Xk
Shifting ~ ~
x n m e j2 km / NXk
DFS
~
e j2 nm / N~
x n DFS
Xk m
Duality
~ ~
x n DFS
Xk
~
Xn DFS
N~
x k
26
Properties of DTFS
27
Summary of Properties
28
Symmetry Properties
29
Periodic Convolution
Take two periodic sequences
x1 n X 1 k
~ ~
DFS
x2 n X 2 k
~ ~
DFS
31
Outline
o Introduction
o DTFS & properties
o DTFT of periodic signals
o DFT: Sampling of the DTFT
o DTFT, DTFS, DFT, DFS, FFT, ZT: numerical (Matlab)
o Summary
32
The DTFT
DT Fourier Transform: • DTFT represents a DT aperiodic signal as
a sum of infinitely many complex
DT CT P 2
exponentials, with the frequency varying
continuously in (-π, π)
j
X (e ) x[n]e
n
jn
• DTFT is periodic
only need to determine it for
InverseDT Fourier Transform:
CT P 2 DT
1
j jn
x[n] X ( e ) e d
2 2
33
The DTFT X ( e j ) x[ n
n
]e jn
34
FS versus FT
2N X~ k 2Nk
~
X e j
k
36
The FT of Periodic Signals
The inverse transform can be written as
2 ~ 2k jn
1 2 ~ 1 2
2
0
X e j e jn d
2
0
k N
X k
N
e d
2k
2 2k jn N 1
1
~
1
X k e
~ j n
N k
X k 0
N
e d
N k 0
N
2N X~ k 2Nk
N 1 2k ~
X e j
k e
1 ~ j n
FT Pair:
~
X [ n] X N
k
N k 0
Example:
37
Example
~
Consider the periodic impulse train p[n] n rN
r
Therefore the FT is
~
P k 1 for all k
38
Finite-length x[n] & Periodic Signals
40
Example
Consider
1 0 n 4
x[n]
0 else
The FT is
sin5 / 2
X e j e j2
sin / 2
The DFS
coefficients
~ sink / 2
Xk e j4 k / 10
41 sink / 10
Outline
42
Sampling the DTFT:
Sampling in frequency domain
In the DTFT
j
X (e ) x[ n
n
]e jn
X c j
-N N
X s j s>2
- N
3s 2s s -N N s 2s 3s
X s j s<2
44 3s - N
2s s -N N s 2s 3s
Sampling the DTFT:
Sampling in frequency domain
~
X k could be the DFS of a sequence
The corresponding sequence is
N 1
~
x [ n]
1
~
X k e j 2 / N kn
; 0 n N 1 and 0 k L 1
N k 0
45
Sampling the DTFT
X k X e j
~
2 / N k
X e j 2 / N k
We can also write it in terms of the z-transform
X k X z z e 2 / N k X e j 2 / N k
~
46
Sampling the DTFT
47
x [n] xn n rN
~
xn rN
r r
Sampling the DTFT
48 FS are still samples of the FT; But, one period is no longer identical to x[n]
Sampling the DTFT
DFS coefficients of a periodic sequence obtained
through summing periodic replicas of aperiodic original
sequence x[n]
If x[n] is of finite length & we take sufficient number of
samples of its DTFT, x[n] can be recovered by
~x n 0 n N 1
xn
0 else
No need to know the DTFT at all frequencies, to recover
x[n]
DFT: Representing a finite length sequence by
samples of DTFT
49
Sampling in the frequency domain
~
The relationship between x[n ] and one period of x [n] in the
under-sampled case is considered a form of time domain
aliasing
Time domain aliasing can be avoided only if x[n] has finite
length
just as frequency domain aliasing can be avoided only for
signals being band-limited
If x[n] has finite length N and we take a sufficient number L
of equally spaced samples of its FT, then
the FT is recoverable from these samples
equivalently x[n] is recoverable from ~
x [ n]
Sufficient number L means: L>=N
We must have at least as many frequency samples as the
50 signal’s length
The DFT
Consider a finite length sequence x[n] of length N
xn 0 outside of 0 n N 1
For x[n] associate a periodic sequence
The DFS coefficients of the periodic sequence are samples of the
DTFT of x[n]
x n xn rN
~
r
X k 0 k N 1
~
X k X k mod N X k N
~
X k
51 0 else
The DFT
N 1
X k ~
~
x [n]e j 2 / N kn
n 0
N 1
Consider the DFS pair ~
x [ n]
1
k e j 2 / N kn
~
X
N k 0
0 else 0 else
N 1
1 N 1
X k x[n]e j 2 / N kn
x[n] X k e j 2 / N kn
n 0 N k 0
0 k L 1, L N 0 k L 1, where L N
52
The DFT pair X k x[n]
DFT
DFT: x[n] finite duration
53
DFT: Example 1
n0
1 e j2 k
1 e j2 k / 5
5 k 0,5,10,...
0 else
54
DFT: Example 1
Let L=2N=10
We get a different set
of DFT coefficients
Still samples of the
DTFT but in different
places
x[n] = Inverse X[k]
depends on relation L
&N
55
DFT: Example 1
summary
The larger the DFT size K, the more details of the INVERSE DFT,
i.e., x[n ] can be seen
56
DFT: example 2
0 k L 1, where L N
57
DFT: example 3
0 k L 1, where L N
58
DFT: example 3
59
Properties of DFT (very similar to that of DTFS)
xn DFT
Xk
Duality
Xn DFT
Nx k N
60
Example: Duality
61
Circular Shift property
63
64
Circular Shift property
65
Circular Convolution Property
x3 [n] x1[n] N x2 [n]
~
x [ n]
0 n N 1
Linear convolution : y[n] x[n]* h[n], so Y e j X e j H e j
- Circular convolution : w[n] x[n] N h[n] , so W(k) X(k)H(k)
- DFT from Y e j is Y(k) Y e j 2 / N k , so Y (k ) X (k ) H (k )
67
Circular Convolution Linear Convolution with time aliasing
Circular Convolution:
example 1
Circular convolution of two
finite length sequences
x1[n] [n n0 ] x1[n] [n n0 ]
X 1[k ] WNkn0
X 3 [k ] WNkn0 X 2 [k ]
N 1
x3 n x1 mx2 n m N
m 0
N 1
x3 n x2 mx1 n m N
m 0
68
Example 2: L=N
Multiplication of DFTs
N 2 k 0
X 3 k X 1 k X 2 k
0 else
Inverse DFT
N 0 n N 1
x3 n
69
0 else
Example 2: L=2N
Multiplication of DFTs
2
j
2 Lk
1 e N
X3 k 2 k
1e Nj
70
x[n] = Inverse DFT X[k] is not unique; depends on L and N
Circular convolution example
71
72
Symmetry Property
73
Symmetry Properties
74
Outline
75
Discrete-time signal transforms
76
Numerical Calculation of FT
77
Matlab examples: DTFT
Suppose that:
78
Matlab examples: DTFT
79
Matlab examples: DFT
Close form X(ej) not always easy
To plot |X(ej)|, we sampled from 0 to 2
In code: w and X are vectors
Small step size 0.001 to simulate continuous frequency
Workaround: DFT
Uniform L-samples from DTFT from 0 to 2
Takes discrete values and returns discrete values
No need to find |X(ej)| analytically
Fast implementation using the fast Fourier transform (FFT)
Matlab: fft(x,L)
• L: number of samples to take
• More L more resolution
• Default L is N=length(x)
80
Matlab examples: DFT
81
Matlab examples: DFT
Notes:
Default L=32 gives bad
resolution
information lost
x-axis not useful
82
Matlab examples: DFT
• L=64
• L-128
83
Matlab examples: DFT
Obtaining the frequency (x-axis)
Spike at 3/8=1.17
Spike at 2-3/8 = 5.11
FFT calculates from 0 to 2
More familiar to shift using
fftshift
84
Matlab examples: DFT
85
Matlab examples: DFT
Sometimes we want
frequency in Hz
86
Matlab examples: DFT
88
Matlab examples: z-Transform
Suppose that:
89
Matlab examples: z-Transform
90
Matlab examples: z-Transform
91
Matlab examples: z-Transform
92
Matlab examples: z-Transform
93
Outline
94
FFT: Fast Fourier transform
95
FFT
1 N 1
x[n] Xk e j2 / Nkn
N k 0
N 1
The DFT pair was given as Xk x[n]e j2 / Nkn
n0
Baseline for computational complexity:
Each DFT coefficient requires
• N complex multiplications
• N-1 complex additions
All N DFT coefficients require
• N2 complex multiplications
• N(N-1) complex additions
Complexity in terms of real operations
• 4N2 real multiplications
96 • 2N(N-1) real additions
FFT
Most fast methods are based on symmetry
properties
Conjugate symmetry
e j2 / Nk Nn e j2 / NkNe j2 / Nk n e j2 / Nkn
Periodicity in n and k
e j2 / Nkn e j2 / Nk nN e j2 / Nk Nn
The Second Order Goertzel Filter
• Approximately N2 real multiplications and 2N2 real additions
• Do not need to evaluate all N DFT coefficients
Decimation-In-Time FFT Algorithms
(N/2)log2N complex multiplications and additions
97
Symmetry and periodicity of complex
exponential
Complex conjugate symmetry
Periodicity in n and k
For example
Re{x[n]}Re{WNkn} Re{x[ N n]}Re{WNk [ N n ]}
(Re{x[n]} Re{x[ N n]}) Re{WNkn}
99
Overview of signal transforms
Variable Period Continuous Discrete
Frequency Frequency
DT x[n] n N
k
k 2k / N
CT x(t) t T k
k 2k / T
• DT-FS: Discrete in time; Periodic in time; Discrete in Frequency; Periodic in Frequency
• DT-FT: Discrete in time; Aperiodic in time; Continous in Frequency; Periodic in Frequency
• CT-FS: Continuous in time; Periodic in time; Discrete in Frequency; Aperiodic in Frequency
• CT-FT: Continuous in time; Aperiodic in time; Continous in Frequency; Aperiodic in Frequency
• DFT: Discrete in time; Aperiodic in time; Discrete in Frequency; Periodic in Frequency;
finite-duration x[n]
• DFS: Discrete in time; Periodic in time (make finite-duration x[n] periodic);
100 Discrete in Frequency; Periodic in Frequency;
Relationships between signal transforms
Sample in time
Continuous-time Sampling period = Ts Discrete-time
analog signal analog sequence
x(t) C x [n] D
st n =
x(t) e dt
n = - n=0 D
- f z 0 2 0 k N 1
- s
j
ze
s = j Sample in
2f =2f
frequency,
= Ts,
= 2n/N,
scale
N = Length
101 amplitude
C Continuous-variable D Discrete-variable of sequence
by 1/Ts
Fourier versus Cosine Transform
1 n 1
(2t 1) f
Xf Cf xt cos
2 t 0
2n
where
1 n = size
, f 0
Cf 2 x = signal
1, f 0
X = transform coefficients
103