7- 1 chapter 7: fourier analysis fourier analysis = series + transform ◎ fourier series -- a...
TRANSCRIPT
7-1
Chapter 7: Fourier Analysis
Fourier analysis = Series + Transform
◎ Fourier Series -- A periodic (T) function f(x) can be written
as the sum of sines and cosines of varying
amplitudes and frequencies
01
( ) / 2 cos sinn nn
f x a a n x b n x
/ 2 / 2
0 / 2 / 2
/ 2
/ 2
1 2( ) , ( )cos
2 2, ( )sin
T T
nT T
T
n T
a f x dx a f x n xdxT T
b f x n xdxT T
7-2
○ Some function is formed by a finite number
of sinuous functions
( ) sin (1/3)sin 2 (1/ 5)sin 4f x x x x
7-3
Some function requires an infinite number of sinuous functions to compose
1 1 1 1( ) sin sin3 sin5 sin 7 sin9
3 5 7 9f x x x x x x
7-4
• Spectrum
The spectrum of a periodic function is discrete, consisting of components at dc, 1/T, and its multiples, e.g.,
( ) sin (1/3)sin 2 (1/ 5)sin 4f x x x x
For non-periodic functions, i.e.,
or 0T The spectrum of thefunction is continuous
7-5
○ In complex form: ( ) exp( )nn
f x c jn x
/ 2
/ 2
1( )exp( )
T
n Tc f x jn x dx
T
0 01
, ( ) / 222 [ ], 2 [ ]
n n n
n e n n m n
c a c a jb
a R c b I c
01
( ) / 2 cos sinn nn
f x a a n x b n x
Compare with2
, : periodTT
7-6
Euler’s formula: cos sinjxe x j x cos sinjxe x j x
7-7
7-8
7-9
0( ) [ ( )cos ( )sin ] ( )
1 1( ) ( )cos , ( ) ( )sin
j xf x a x b x d c e d
a f x xdx b f x xdx
1( ) ( ( ) ( ))
21
( )[cos sin ]2
1 ( )
2j x
c a jb
f x x j x dx
f x e dx
Continuous case
7-10
Discrete case:
1( ) ( )exp( )
2
( ) ( )exp( )
F f x j x dx
f x F j x d
1
0
2exp( ), 0,1, , 1
N
x u
u
j xuf F x N
N
1
0
1 2exp( ), 0,1, , 1
N
u x
x
j xuF f u N
N N
◎ Fourier Transform
7-11
Matrix form
F f
0 1 1
0 1 1
Input sequence: { , , , }
DFT sequence: { , , , }
N
N
f f f
F F F
f
F1
0
1 2exp( ),
0,1, , 1
N
u x
x
j xuF f
N N
u N
,1 2
exp( ),m nj mn
N N
, 0,1, , 1m n N
Let2
exp( )j
N
,1 mn
m nN
7-12
2
1 2 3 ( 1)
2 4 6 2( 1)
3 6 9 3( 1)
( 1) 3( 1) 2( 1) ( 1)
1 1 1 1 1
1
11
1
1
N
N
N
N N N N
N
。 Example: f = {1,2,3,4}. Then, N = 4,
2exp( ) cos( ) sin( )
4 2 2
jj j
7-13
2 3
2 4 6
3 6 9
1 1 1 1 1 1 1 1
1 ( ) ( ) ( ) 1 11 1
1 1 1 14 41 ( ) ( ) ( )
1 11 ( ) ( ) ( )
j j j j j
j j j
j jj j j
1 1 1 1 1 10
1 1 2 2 21 1
1 1 1 1 3 24 4
1 1 4 2 2
j j j
j j j
F f
7-14
○ Inverse DFT1
0
2exp( )
N
x u
u
j xuf F
N
1f F
2
1 2 3 ( 1)
2 4 6 2( 1)1
3 6 9 3( 1)
( 1) 3( 1) 2( 1) ( 1)
1 1 1 1 1
1
1
1
1
N
N
N
N N N N
21/ exp( )
j
N
Let
7-15
。 Example:1
1/ jj
2 31
2 4 6
3 6 9
1 1 1 1 1 1 1 11 ( ) ( ) ( ) 1 1
1 1 1 11 ( ) ( ) ( )1 11 ( ) ( ) ( )
j j j j j
j j jj jj j j
1
1 1 1 1 10 1
1 1 2 2 21
1 1 1 1 2 34
1 1 2 2 4
j j j
j j j
f F
7-16
◎ Properties
○ Linearity:
e.g., Noise removal
f’ = f + n, n: additive noise,
( ) ( ) ( )
( ) ( )
f g f g
kf k f
( ) ( ) ( ) ( )f f n f n
8-17
Fourier spectrum noise
Corresponding spatial noise
1( ) : ( ) exp( )
21
( ) exp( ) ( )2
af x jux dx
a f x jux dx aF u
( ) : ( ) exp( )
( ) exp( ) ( )
aF u jux du
a F u jux du af x
( ) ( )af x aF u
( ) ( ),af x aF u○ Scaling :1
( ) ( )u
f ax Fa a
| |
Show:
7-19
○ Periodicity: ( ) ( )F u F N u
1
0
212
0
21
0
21
0
1 2 ( )( ) ( )exp( )
1 ( )
1 ( )(cos2 sin 2 )
1 ( ) ( )
N
x
j xuNj x N
x
j xuNN
x
j xuNN
x
j x N uF N u f x
N N
f x e eN
f x x j x eN
f x e F uN
1
0
1 2( ) ( )exp( )
N
x
j xuF u f x
N N
7-20
0 1 1 { , , , },f Nf f f 0 1 1 { , , , }NF F F F
0 1 2 3 2 1 { , , , , , , }f N Nf f f f f f
/ 2 1 0 / 2 1 { , , , , , }N N NF F F F F
0 0Let / 2 exp( 2 / ) exp( )
(e ) (cos sin ) ( 1)j x x x
u N j u x N j x
j
0( ) ( )exp( 2 / ) ( 1) ( )xf x f x j u x N f x
○ Shifting:
0 0
0 0
( )exp( 2 / ) ( )
( ) ( )exp( 2 / )
f x j u x N F u u
f x x F u j ux N
7-21
。 Example:
{2 3 4 5 6 7 8 1}f
{36 - 9.6569 4 - 4 - 4 1.6569 - 4
4 1.6569 4 - 4 4 -9.6569 - 4 }
i i i
i i i
F
{2 - 3 4 - 5 6 - 7 8 -1}f
{ 4 1.6569 4 - 4 4 - 9.6569 - 4
36 - 9.6569 4 - 4 - 4 1.6569 - 4 }
i i i
i i i
F
7-22
◎ Convolution:
( ) ( ) ( ) ( ) ( )h x f x g x d f x g x d
h f g g f
Convolution theorem:
( ) ( ) ( ) ( ), ( ) ( ) ( ) ( )f x g x F u G u f x g x F u G u
Correlation theorem*( ) ( ) ( ) ( )f x g x F u G u
*( ) ( ) ( ) ( )f x g x F u G u
◎ Correlation *( ) ( ) ( ) ( )f x g x f g x d
7-23
。 Discrete Case:1
0
( ) ( ) ( ) ( ) ( )N
e e e en
h k f n g k f n g n k
1
0
( ) ( ) ( ) ( ) ( )N
e e e en
h k f k g k f n g k n
1N A B
A = 4, B = 5, A + B – 1 = 8, 8N
e.g.,
7-24
* Convolution can be defined in terms of polynomial product
Extend f, g to if f, g have different
numbers of sample points
Let
Compute
The coefficients of to form
the result of convolution
0 1 1 { , , , },f Nf f f
2 10 1 2 1( ) N
NP x f f x f x f x
2 10 1 2 1( ) N
NQ x g g x g x g x
0 1 1 { , , , }g Ng g g
( ) ( )(1 )NP x Q x xNx 2 1Nx
f g
,e ef g
7-25
。 Example:
Let
The coefficients of form
the convolution
{1, 2, 3, 4},f
2 3( ) 1 2 3 4 ,P x x x x 2 3( ) 5 6 7 8Q x x x x 4 2 3 4
5 6 7 8 9 10
( ) ( )(1 ) 5 16 34 60 66
68 66 60 61 52 32
P x Q x x x x x x
x x x x x x
{5, 6, 7, 8}g
{66, 68, 66, 60} f g
4 5 6 7, , ,x x x x
4N
( , 2 1) (4, 7)N N
7-26
1
0
( ) ( ) ( )N
n
h k f k n g n
{1, 2, 3, 4},f {5, 6, 7, 8}g
3
0
4, ( ) ( ) ( )n
N h k f k n g n
3
0
(0) ( ) ( )
(0) (0) ( 1) (1) ( 2) (2) ( 3) (3)
(0) (0) (3) (1) (2) (2) (1) (3)
1 5 4 6 3 7 2 8 5 24 21 16 66
(1) 68, (2) 66, (3) 60
n
h f n g n
f g f g f g f g
f g f g f g f g
h h h
7-27
○ Fast Fourier Transform (FFT) -- Successive doubling method
7-28
7-29
。 Time complexity
: the length of the input sequence
FT: FFT:
Times of speed increasing:
2nN 2 2(2 ) 2n n 2nn
2 /n nN FT FFT Ratio
4 16 8 2.0 8 84 24 2.67 16 256 64 4.0 32 1024 160 6.4 64 4096 384 10.67 128 16384 896 18.3 256 65536 2048 32.0 512 262144 4608 56.91024 1048576 10240 102.4
7-30
1
0
1( ) ( ) exp[ 2 / ]
N
x
F u f x j ux NN
1
0
( ) ( ) exp[ 2 / ]N
u
f x F u j ux N
1
* *
0
1 1( ) ( ) exp[ 2 / ]
N
u
f x F u j ux NN N
*( )F u*( ) /f x N
○ Inverse FFT
← Given
← compute
i. Input into FFT. The output is
ii. Taking the complex conjugate and
multiplying by N , yields the f(x)
7-31
◎ 2D Fourier Transform
○ FT:
IFT:
1 1
0 0
1( , ) ( , )exp[ 2 ( )]
M N
x y
xu yvF u v f x y j
MN M N
( , ) ( ( , ))F u v f x y
1( , ) ( ( , ))f x y F u v
1 1
0 0
( , ) ( , )exp[ 2 ( )]M N
u v
xu yvf x y F u v j
M N
7-32
◎ Properties
○ Filtering: every F(u,v) is obtained by
multiplying every f(x,y) by a fixed
value and adding up the results. DFT
can be considered as a linear filtering1 1
0 0
1( , ) ( , )exp[ 2 ( )]
M N
x y
xu yvF u v f x y j
MN M N
○ DC coefficient:1 1 1 1
0 0 0 0
1 1(0,0) ( , )exp(0) ( , )
M N M N
x y x y
F f x y f x yMN MN
7-33
○ Separability:
exp[ 2 ( )] exp( 2 )exp( 2 )xu yv xu yv
j j jM N M N
1 1
0 0
1 1
0 0
1
0
1( , ) ( , )exp[ 2 ( )]
1 1 exp( 2 ) ( , )exp( 2 )
1 ( , )exp( 2 )
M N
x y
M N
x y
M
x
xu yvF u v f x y j
MN M N
xu vyj f x y j
M M N N
xuF x v j
M M
7-34
○ Conjugate Symmetry: F(u,v) = F*(-u,-v)
1 1
0 0
1( , ) ( , )exp[ 2 ( )]
M N
x y
ux vyF u v f x y j
MN M N
1 1
0 0
1, ( , )exp[ 2 ( )]
M N
x y
ux vyF u v f x y j
MN M N
( )=
1 1* *
0 0
1( , ) ( , ){exp[ 2 ( )]}
M N
x y
ux vyF u v f x y j
MN M N
1 1
0 0
1( , )exp[ 2 ( )]
N N
x y
ux vyf x y j
MN M N
( , )F u v
7-35
0 0
0 0
0 0
0 0
( , )exp[ 2 ( / / )]
( , )
( , )
( , )exp[ 2 ( / / )]
f x y j u x M v y N
F u u v v
f x x y y
F u v j ux M vy N
○ Shifting
7-36
○ Rotation
Polor coordinates:
cos , sinu w v w
( , ) ( , ),f x y f r ( , ) ( , )F u v F w
0 0( , ) ( , )f r F w
cos , sinx r y r
7-37
log(1 ( , ) )F u v
( , )F u v
○ Display: effect of log
operation
7-38
7-39
◎ Image Transform
7-40
◎ Filtering in Frequency Domain
○ Low pass filtering
1 ( , )( , )
0 ( , )
u v Dm u v
u v D
1( ( ) )I m I FT
m IFT
7-41
D = 5 D = 30
○ High pass filtering
7-42
Different Ds
7-43
◎ Butterworth Filtering
2
1( )
1 ( / ) nf xx D
○ Low pass filter ○ High pass filter
2
1( )
1 ( / ) nf xD x
2
2
When : small; / : small; 1 ( / ) : small;
1/(1 ( / ) ): large
n
n
x x D x D
x D
7-44
○ Low pass filter
○ High pass filter
7-45
◎ Homomorphic Filtering
-- Deals with images with large variation of illumination, e.g., sunshine + shadows
-- Both reduce intensity range and increases local contrast
○ Idea:
I = LR, L: illumination, R: Reflectance
logI = logL + logR
(log ) (log ) (log )I L R low frequencyhigh frequency
(log )L(log )R
7-46
1
(log ) (log ) (log )
exp( ( (log )))
H I H L H R
I H I
7-47
7-48
○ Fast Fourier Transform (FFT) -- Successive doubling method
1
0
1 2exp( )
N
u x
x
j xuF f
N N
1
0
1,
Nux
u x N
x
F f WN
2exp( )N
jW
N
Assume 12 nM
Let
2nN
Let N = 2M.
7-49
2 1
20
1( ) ( )
2
M uxM
xF u f x W
M
0 22 2 2
1[ (0) (1) (2)
2u u
M M Mf W f W f WM
( 1)2 2( ) ( 1)Mu M u
M Mf M W f M W (2 -1)
2(2 -1) M uMf M W
-1
0
1 1[ (2 )
2
M
xf x
M 2
2xu
MW-1
0
1(2 1)
M
xf x
M (2 1)
2x u
MW
22
xuMW
2 222[ ] [ ]
j jxu xuM Me e
xuMW
(2 +1) 22 2 2 2
x u xu u xu uM M M M MW W W W W
= ]
=
]
7-50
1 1
0 0
1 1 1( ) [ (2 ) (2 1) ]
2
M Mux ux u
M M Mx x
F u f x W f x W WM M
1
0
1( ) (2 )
Mux
even Mx
F u f x WM
1
0
1( ) (2 1)
Mux
odd Mx
F u f x WM
2
1 ( ) [ ( ) ( ) ]
2u
even odd MF u F u F u W
Let
--------- (B)
Consider
21
( ) [ ( ) ( ) ]2
u Meven odd MF u M F u M F u M W
7-51
2 2 2
2 2 22 ( ) ( ) ( )
j j ju M u M u MM M MMW e e e
2 2( 1)u uM MW W
21
( ) [ ( ) ( ) ]2
ueven odd MF u M F u M F u M W
2 2 2
( ) ( ) ( )j j j
u M u M u MM M MMW e e e
(1)u uM MW W
7-52
1( )
0
1( ) (2 )
Mu M x
even Mx
F u M f x WM
1
0
1(2 ) ( )
Mux
M evenx
f x W F uM
1( )
0
1( ) (2 1)
Mu M x
odd Mx
F u M f x WM
1
0
1(2 1) ( )
Mux
M oddx
f x W F uM
21
( ) [ ( ) ( ) ]2
ueven odd MF u M F u F u W ---- (C)
7-53
21
[ ( ) ( ) ]2
ueven odd MF u F u W
21
[ ( ) ( ) ]2
ueven odd MF u F u WF(u+M) =
Recursively divide F(u) and F(u+M),
○ Analysis : The Fourier sequence F(u), u = 0 , … , N-1 of f(x), x = 0 , … , N-1 can be formed from sequences
F(u) =
Eventually, each contains one element
F(w), i.e., w = 0, and F(w) = f(x).
u = 0 , …… , M-1
7-54
7-55
1
0
1( ) (2 )
Mux
even Mx
F u f x WM
1
0
1( ) (2 1)
Mux
odd Mx
F u f x WM
○ Example:
needs { f(0), f(2), f(4), f(6) }
needs { f(1), f(3), f(5), f(7) }
Computing
Computing
Computing
Input { f(0), f(1), ……, f(7) }
7-56
Reorder the input sequence into{f(0), f(4), f(2), f(6), f(1), f(5), f(3), f(7)}
Computing
* Bit-Reversal Rule