Discrete Fourier Transformtwins.ee.nctu.edu.tw/courses/dsp_15/Class note/dsp8.pdfAfter computing DFT...
Transcript of Discrete Fourier Transformtwins.ee.nctu.edu.tw/courses/dsp_15/Class note/dsp8.pdfAfter computing DFT...
DSP (2015 Spring) Discrete Fourier Transform
NCTU EE 1
Discrete Fourier Transform
What is Discrete Fourier Transform (DFT)?
(Note: It’s not DTFT – discrete-time Fourier transform)
A linear transformation (matrix)
Samples of the Fourier transform (DTFT) of an aperiodic (with finite duration) sequence
Extension of Discrete Fourier Series (DFS)
Review: FT, DTFT, FS, DFS Time signal Transform Coeffs.
(periodic/aperiodic) Coeffs. (con-ti./discrete)
Analog aperiodic FT Aperiodic Continuous Analog periodic FT
FS Aperiodic Aperiodic
Continuous (impulse)Discrete
Discrete aperiodic DTFT Periodic Continuous Discrete periodic DFS Periodic Discrete Discrete finite-duration DFT
The Discrete Fourier Series
Properties of NW
kN
jk
NNj
N eWeW
2
2 thus,
-- NW is periodic with period N. (It is essentially cos and sin) : Nk
NNk
Nk
N WWW 2
--
1
0 if ,0
if ,N
k
lkN mNl
mNlNW
(Pf) (i) 1 , If 0 N
NmkN
lkN WWWNml
NWN
k
N
k
lkN
1
0
1
0
1
(ii) 1 , If lNWNml
0
1
11
1
1
1
0
l
Nl
N
NlN
N
k
lkN
WW
WW
--
1
0
1 N
k m
lkN mNlW
NlY
DSP (2015 Spring) Discrete Fourier Transform
NCTU EE 2
DFS for periodic sequences
][~ nx
n
NperiodrNnxnx ,~~
Its DFS representation is defined as follows:
Synthesis equation:
1
0
1 2~1~1~
N
k
knN
N
ok
knN
jWkX
NekX
Nnx
Analysis equation:
1
0
~~ N
n
knnWnxkX
Note: The tilde in x~ indicates a periodic signal.
][~
kX is periodic of period N.
Pf)
1
0
~1~N
k
knNWkX
Nnx
Pick an r ( Nr 0 )
rnNW rn
N
N
k
knN
rnN WWkX
NWnx
1
0
~1~
1
0
N
n
rX
rkXXX
WkXN
WWkXN
Wnx
N
n
nkrN
N
k
rnN
N
k
knN
N
n
N
n
rnN
~
1~
01~
00~
)~(1
~1~
1
0
)(1
0
1
0
1
0
1
0
That is,
1
0
~~ N
n
rnNWnxrX . QED
DSP (2015 Spring) Discrete Fourier Transform
NCTU EE 3
Example: Periodic Rectangular Pulse Train
4
0
10
4
10
510
10
10sin
2sin
1
1~
n
kj
k
kKn
k
k
eW
WWkX
Sampling the Fourier Transform Compare two cases:
(1) Periodic sequence ][~~ kXnx
(2) Finite duration sequence nx = one period of nx~
An aperiodic sequence:
k
N
j
j
eXkXIDFSnx
eXFTnx
2|~~
samples ?
Compare:
jeXDTFTnx
jXFTtx
? samples
DSP The Discrete Fourier Transform
NCTU EE 4
Example:
otherwiase
nnx
,0
40,1
integer
109105,0
10410,1~
r
rnr
rnrnx
r r
m
N
k
knN
kmN
N
k
knN
m
kmN
j
knN
kN
k m
mj
knN
kk
N
j
N
k
KnN
rNnxrNnnx
WWmxN
WemxN
WemxN
WeXN
WkXN
nx
) ge(Interchan 1
1
(FT) 1
(Sampling) 1
(IDFS) ~1~
1
0
1
0
2
2
2
1
0
DSP The Discrete Fourier Transform
NCTU EE 5
If x[n] has finite length and we take a sufficient number of equally spaced samples of its
Fourier Transform ( a number greater than or equal to the length of x[n]), then x[n] is re-
coverable from [n]x~ .
Two ways (equivalently) to define DFT: (1) N samples of the DTFT of a finite duration sequence nx
(2) Make the periodic replica of nx nx~
Take the DFS of nx~
Pick up one segment of ][~
kX
kXDFSnx
kXDFTnx
~~segment one periodic
][
DSP The Discrete Fourier Transform
NCTU EE 6
Properties of the Discrete Fourier Series
-- Similar to those of FT and z-transform
Linearity
kXbkXanxbnxakXnx
kXnx2121
22
11 ~~~~~~
~~
Shift
kXnx~~ ==>
lkXnxW
kXWmnxnl
N
kmN
~~
~~
Duality
Def:
1
0
1
0
)(#~~
(*)~1~
N
n
nkN
N
k
knN
WnxkX
WkXN
nx
kxNkX
kXnx~~
~~
Symmetry kXnx ~~
kXkXkXnxj
kXkXkXnx
o
e
*
*
~~2
1~~Im
~~2
1~~Re
kXjnxnxnx
kXnxnxnx
o
e
~Im~~
2
1~
~Re~~
2
1~
*
*
kXkXnx *~~ real, is ~ If .
kXkX
kXkX
kXkX
kXkX
~Im~Im
~Re
~Re
~~
~~
DSP The Discrete Fourier Transform
NCTU EE 7
Periodic Convolution
nxnx 21~,~ are periodic sequences with period N
1
021213
1
02121
~~1~~~
~~~~
N
l
N
m
lkXlXN
nxnxnx
kXkXmnxmx
Discrete Fourier Transform Definition nx : length N, 10 Nn
Making the periodic replica:
N
r
nx
Nnx
rNnxnx
modulo
~
1
0
~~ N
n
knNWnxkX
Keep one segment (finite duration)
otherwise ,0
10 ,~
NkkXkX That is, ]))[((~
NkXkX
This finite duration sequence ][kX is the discrete Fourier transform (DFT) of nx
DSP The Discrete Fourier Transform
NCTU EE 8
10,1
:
10, :
1
0
1
0
NnWkXN
nxeqnSynthesis
NkWnxkXeqnAnalysis
N
k
knN
N
n
knN
Remark: DFT formula is the same as DFS formula. Indeed, many properties of DFT are de-
rived from those of DFS.
DSP The Discrete Fourier Transform
NCTU EE 9
Properties of Discrete Fourier Transform Linearity
21
212122
11
,max
NNlength
kbXkaXnbxnaxkXnx
kXnx
Circular Shift
kXnx ==>
NN
kmNN
lkXnxW
kXWmnx
ln
(Pf) From the right side of the 2nd eqn.
mnxmnxmnx
kXekXekXW
NN
kmN
jkmN
jKm
N
~IDFS DFT
~22
QED
Remark: This is circular shift not linear shift. (Linear shift of a periodic sequence = circular
shift of a finite sequence.)
DSP The Discrete Fourier Transform
NCTU EE 10
Duality
1-Nk0 ,
NkNxnX
kXnx
Symmetry Properties
0 ,0Re
11 ,2
1
10 ,2
1
~
symmetric-conjugate periodic
*
*
nx
N-n nNxnx
N-n nxnx
nx
nx
NN
e
ep
DSP The Discrete Fourier Transform
NCTU EE 11
0 ,0Im
11 ,2
1
ricantisymmet-conjugate periodic
*
nx
N-nnNxnx
nxop
kXjnxkXnx opep Im Re
N
N
N
N
N
kXkX
kXkX
kXkX
kXkX
NkkXkX nx
ImIm
ReRe
10, real, If *
NNop
NNep
kXkXkXnx
kXkXkXnx
*
*
2
1Im
2
1Re
Circular Convolution
kXkXnxnx
mnxmx
nxnxnxN
mN
2121
1
0
213
N-point circular convolution
DSP The Discrete Fourier Transform
NCTU EE 12
Example: N-point circular convolution of two constant sequences of length N
2L-point circular convolution of two constant sequences of length L
DSP The Discrete Fourier Transform
NCTU EE 13
Linear Convolution Using DFT Why using DFT? There are fast DFT algorithms (FFT)
How to do it?
(1) Compute the N-point DFT of nx1 and nx2 separately
kX1 and kX 2
(2) Compute the product kXkXkX 213
(3) Compute the N-point IDFT of kX 3 nx3
Problems: (a) Aliasing
(b) Very long sequence
DSP The Discrete Fourier Transform
NCTU EE 14
Aliasing
nx1 , length L (nonzero values)
nx2 , length P
In order to avoid aliasing, 1 PLN
(What do we mean avoid aliasing? The preceding procedure is circular convolution but we
want linear convolution. That is, nx3 equals to the linear convolution of nx1 and nx2 )
DSP The Discrete Fourier Transform
NCTU EE 15
nx1 pad with zeros length N
nx2 pad with zeros length N
Interpretation: (Why call it aliasing?)
kX 3 has a (time domain) bandwidth of size 1 PL
(That is, the nonzero values of nx3 can be at most 1 PL )
Therefore, kX3 should have at least 1 PL samples. If the sampling rate is insuf-
ficient, aliasing occurs on nx3 .
DSP The Discrete Fourier Transform
NCTU EE 16
Very long sequence (FIR filtering)
Block convolution
Method 1 – overlap and add
Partition the long sequence into sections of shorter length.
For example, the filter impulse response nh has finite length P and the input data nx
is nearly “infinite”.
otherwise 0,
10 , whereLet
0
L-nrLnxnxrLnxnx r
rr
The system (filter) output is a linear convolution:
0
wherer
rrr nhnxnyrLnynhnxny
Remark: The convolution length is 1 PL . That is, the 1 PL point DFT is used. nyr
has 1 PL data points; among them, (P-1) points should be added
to the next section.
This is called overlap-add method.
(Key: The input data are partitioned into nonoverlapping sections the section outputs
are overlapped and added together.)
DSP The Discrete Fourier Transform
NCTU EE 17
Method 2 – overlap and save
Partition the long sequence into overlapping sections.
After computing DFT and IDFT, throw away some (incorrect) outputs.
For each section (length L, which is also the DFT size), we want to retain the correct data of length ))1(( PL points
Let nh , length P
nxr , length L (L>P)
Then, nyr contains (P-1) incorrect points at the beginning.
Therefore, we divide into sections of length L but each section overlaps the preceding
section by (P-1) points. 1-Ln0 ,11 PPLrnxnxr
This is called overlap-save method.