The discrete Fourier Transform - KOCWcontents.kocw.net/KOCW/document/2014/korea/ohchanghun/9.pdf ·...
Transcript of The discrete Fourier Transform - KOCWcontents.kocw.net/KOCW/document/2014/korea/ohchanghun/9.pdf ·...
Fourier TransformChapter 11 The Discrete Fourier
Transform
The discrete transform formula
Continuous and periodic
discrete and non-periodic
discrete and periodic
discrete and periodic
The symbol , which we agree can assume only a finite number N of
consecutive integral value
cannot be negative
otherwise
tttv
0
25.025.02cos)(
Voltage waveform
timesamplingisT
NTtvf 1,...,2,1,0),()( 0
Samples 100mses intervals
Converted into f() of discrete time
Sampling interval is T and the first sample of interest occurs at t=t0
1,....,2,1,0),()( 0 NTtvf
No provision is made for cases where there is no starting point.The finish time must occur after finite time.
Discrete Fourier Transform
1
0
)/(21 )()(N
NjefNF
time frequency
Continuous case t fDiscrete case /N
/N is analogous to frequency measured in cycle per sampling interval
The symbol has been chosen in discrete case, instead of f, to
emphasize that the frequency integer is related to frequency but is
not the same as frequency f
Ex) N=8 =8f : =1 1/8 Hz
Inverse Discrete Fourier Transform
1
0
)/(2)()(N
NjeFf
)(
0)(
)(
)()(
1
0
1
1
0
))(/(21
0
1
)/(2)/(21
0
1
0
11
0
)/(2
f
NfN
efN
eefNeF
N
NNj
N
NjNjNNN
Nj
otherwise
Nee
otherwise
Ne
NNjNj
NNj
00
1
0
)/(2)/(21
0
))(/(2
A function defined by N measurements should be
representable after transformation by just N parameters
Magnitude(modulus)
phase
Sampling 시작의 위치에 따라서phase가 바뀜
=t0인 경우
1
0
)/(21 )()(N
NjefNF
12/
2/
)/(2)()(N
N
NjeFf
Transform pair
/N may be identified with frequency measured in cycles per sampling interval over the range
If the sampling interval is T, the frequency measured in hertz is /NT
NN2
1
2
1
Triangular autocorrelation
Rectangle function
Fourier transform of Triangular autocorrelation
Cyclic convolution
두 sequence의 길이가 m,n이라면 convolution(linear)한 sequence의길이는 m+n-1이 된다.
Cyclic convolution integral
2
0)()()( dgfh
Cyclic convolution (N element sequence)
1
0
)]([)()(N
NHgfh
Unit step function
1)(0100)(
1)(011)(
1)1(
NNHNandH
NNHNandH
NN
Example of discrete Fourier transform
}20{2
1}11{
}11{2
1}10{
}02{2
1}11{
}11{2
1}01{:2
N
}1012{4
1}1001{
}211211{4
1}1011{
}0004{4
1}1111{
}1012{4
1}1100{
}1012{4
1}0011{
}11{4
1}1000{
}1111{4
1}0100{
}11{4
1}0010{
}1111{4
1}0001{:4
ii
ii
ii
ii
ii
ii
N
}1111{8
1}00000100{
}
11{8
1}00000010{
}11111111{8
1}00000001{
}00000008{8
1}11111111{:8
)8/7/(2)8/6/(2)8/5/(2
)8/3/(2)8/2/(28/2
iiii
eee
eee
N
jjj
jjj
{0 1 0 0} 일 경우 discrete Fourier transform
3
0
1 1 1 1(0) ( ) 1 { (0) (1) (2) (3)} {0 1 0 0} {1}
4 4 4 4F f f f f f
3
2 (1/ 4) / 2 3 / 2
0
1 1(1) ( ) { (0) (1) (2) (3) }
4 4
1 1{0 ( ) 0 0} { }
4 4
j j j jF f e f f e f e f e
j j
32 (1/ 2) 2 3
0
1 1(2) ( ) { (0) (1) (2) (3) }
4 4
1 1{0 ( 1) 0 0} { 1}
4 4
j j j jF f e f f e f e f e
32 (3/ 4) 3 / 2 3 9 / 2
0
1 1(3) ( ) { (0) (1) (2) (3) }
4 4
1 1{0 ( ) 0 0} { }
4 4
j j j jF f e f f e f e f e
j j
Reciprocal property
If Fourier transformation applied twice in succession
)(])([ 1)/(21
0
)/(21
0
11
fNeefNN NjN
NjN
)()(
)()(
1
fNF
Ff
Oddness and evenness
Even f()=f(-) and odd f()=-f(-)
Examples : Oddness and evenness
Even : {5 4 3 2 1 0 0 0 0 0 0 0 1 2 3 4}Odd : {0 8 7 6 5 4 3 2 0 -2 -3 -4 -5 -6 -7 -8}
F(-) = F(N- )
Examples with special symmetry
real hermitianimaginary antihermitian
real and even real and evenreal and odd imaginary and odd
imaginary and even imaginary and evenimaginary and odd real and odd
even evenodd odd
Complex conjugates
Addition theorem
Reversal property
Shift theorem
Convolution theorem
Product theorem
Cross correlation
Autocorrelation
Sum of sequence
First value
Generalized Parseval-Rayleigh theorem
)()( Ff
)()( Ff
)()()()( 2121 FFff
)()()()( 0
)/(2)/(2 FfeandFeTf NTjNTj
)()()()( 2121 FNFff
1
0
2121 )()()()(N
FFff
)()()()( 21
1
0
21
FNFffN
2
1
1
0
11 )()()(
FNffN
1
0
)0()(N
NFf
1
0
)()0(N
vFf
1
0
21
0
2)()0(
NN
vFNf
Packing theorem
10
10)()(
)}({)}({
KNN
Nfg
gfPackk
The packing operator Packk packs given N number sequence f() with trailing zeros so as to increase the number of elements to KN
ExamplePack2{1 2 3 4} = {1 2 3 4 0 0 0 0}
If Packk{f()} G()Intermediate values: sinc interpolated
KKNKKvK
vF
KvG ,.....,2,,0),(
1)(
Similarity theorem
If Stretchk{f()} G()
: K-fold repetition
otherwise
KNKKNfg
0
)1(,....,2,,0)/()(
Example Stretch2{1 2 3 4} = {1 0 2 0 3 0 4 0}
Stretchk{f()} = {g()}
1,.........)1()1(1
......................
12,....,)(1
1,....,0)(1
)(
KNNKvNKvFK
NNvNvFK
NvvFK
vG
Fast Fourier Transform
Example of 88
Purpose : Reduce number of computation
12
/2
jN
Nj
eW
eW
Fourier transformNumber of computation : N2
Fast Fourier transformNumber of computation : Nlog2N
Element의 배열순서에 의해연산량이 줄어들 수 있다.
실제 연산을 하는 곳연산을 하지 않는 곳
DIP (Gonzalez, 2ed.) ReviewTHE FAST FOURIER TRANSFORM
Fast Fourier transform (FFT) algorithm
• N log2 N operations
3.4.1 FFT Algorithm
1
0
)(1
)(N
x
ux
NWxfN
uF
k
N
k
NN WWNjW 2
2],/2exp[
If N=2n=2M,
])12(1
)2(1
[2
1
])12(1
)2(1
[2
1
)(2
1)(
1
0
1
0
2
1
0
1
0
)12(
2
)2(
2
12
0
2
M
x
M
x
u
M
ux
M
ux
M
M
x
M
x
xu
M
xu
M
M
x
ux
M
WWxfM
WxfM
WxfM
WxfM
WxfM
uF
N점 DFT F(u)를 구할때, 수열 F(x)을 x를 짝수인 것과홀수인 것의 두 부수열로 나누어 N/2DFT를 구하는 알고리즘.
n이 짝수일 때는 n = 2x, 홀수일 때는 n = 2x + 1로 표시.
3.4.1 FFT Algorithm(2)
1
0
)2(1
)(M
x
ux
Meven WxfM
uF
])()([2
1)( 2
u
Moddeven WuFuFuF
1
0
)12(1
)(M
x
ux
Modd WxfM
uF
])()([2
1)( 2
u
Moddeven WuFuFMuF
,
u
M
Mu
M
u
M
Mu
M WWWW 22, since
Defining
Feven(u)와 Fodd(u) 를 구할 때 u=0, 1,…, (M) - 1에 대한 값만 산출하면, u= M, (M)+1, … , M에 대한 값은 자동적으로 알게 된다.
∴ 계산량은 현저히 감소함.
WMux는 u에 관하여 주기가 M인 주기함수
• Number of multiplications and additions required to
implement the FFT
m(n) = 2m(n-1)+2n-1 , n1 complex multiplication
a (n) = 2a(n-1) + 2n , n1 complex addition
where m(0) = 0, a(0) = 0
3.4.3 The Inverse FFT
1
0
/2
1
0
/2
*})(*{1
)(1
)(*1
)(*1
N
u
Nuj
N
u
Nuj
euFN
xfN
euFN
xfN
*}),(*{1
),(
),(*1
),(*
1
0
1
0
/)(2
1
0
1
0
/)(2
N
u
N
v
Nvyuxj
N
u
N
v
Nvyuxj
evuFN
yxf
evuFN
yxf
: 2 D
: 1 D
3.4.4 Implementation
Practical considerations
If N=60, compute : 60+4(zero padding), 68? 68+60(zero)
Where zero is placed? : tail, precede, two zeros at start and finish?Not important, only phase is affectedPhase is important? Find origin and use shift theorem
)2()]()([
2
)()]()([)(
)/()]()([)( 1
NfIIIfIIIfS
Nstartto
NfIIIfIIIfSfP
NtIIINtIIItvtp
Twice as closely in frequency
Is the discrete Fourier transform correct?
Sampling theorem and phenomenon of aliasing
aliasing
B
T<1/2B
Applications of the FFT
Image processing filteringConvolution in spatial domain multiplication in frequency domain
The output sequence close around the circle and overlap itself? Packing (adding zeros)
Two dimensional data
dxdyeyxfvuF vyuxj )(2),(),(
1
0
1
0
)//(2),(1
),(M N
NMjefMN
vuF
Sampling interval X,Y
YNyy
XMxx
Y
yy
X
xx
)1(
)1(
,
minmax
minmax
minmin