Beruflich Dokumente
Kultur Dokumente
1 1
− 2πiux
N −1
1
F(u) = ∑ f (x)e N
u = 0, 1, 2, ..., N-1
N x=0
Matlab: F=fft(f);
2πiux
N −1
f ( x) = ∑ F (u)e N x = 0, 1, 2, ..., N-1
u=0
Matlab: F=ifft(f);
Discrete Fourier Transform - Example
f(x) f(x) = f(x0 + x∆x)
f(x0+2∆x) f(x0+3∆x)
4 4
f(x0+∆x)
3 3
f(x0)
2 2
1 1
3 -2πi0x 3
F(0) = 1/4 Σ f(x) e
x=0
4 = 1/4 Σ f(x) 1
x=0
3 -4πix
F(2) = 1/4 Σ f(x) e
x=0
4 = 1/4 [2e0+3e-iπ +4e−2πi 4e-3πi] = -1
4 [-1-0i]= -1
4
3 -6πix
F(3) = 1/4 Σ f(x) e
x=0
4 = 1/4 [2e0+3e-i3π/2+4e−3πi 4e-i9π/2] = 14 [-2-i]
Fourier Spectrum:
|F(0)| = 3.25
|F(1)| = [(-1/2)2 + (1/4)2]0.5
|F(2)| = [(-1/4)2 + (0)2]0.5
|F(3)| = [(-1/2)2 + (-1/4)2]0.5
Discrete Fourier Transform - 2D
N −1 M − 1
ux vy
− 2πi( + )
∑ ∑ f (x, y)e
1
F(u,v) = N M u = 0, 1, 2, ..., N-1
MN x = 0 y = 0 v = 0, 1, 2, ..., M-1
Matlab: F=fft2(f);
Matlab: F=ifft2(f);
V
u=-2, v=2 u=-1, v=2 u=0, v=2 u=1, v=2 u=2, v=2
u=-2, v=1 u=-1, v=1 u=0, v=1 u=1, v=1 u=2, v=1
u=-2, v=0 u=-1, v=0 u=0, v=0 u=1, v=0 u=2, v=0
u=-2, v=-1 u=-1, v=-1 u=0, v=-1 u=1, v=-1 u=2, v=-1
u=-2, v=-2 u=-1, v=-2 u=0, v=-2 u=1, v=-2 u=2, v=-2
Fourier Transform - Image
u
Visualizing the Fourier Transform
Image using Matlab Routines
• F(u,v) is a Fourier transform of f(x,y) and it has
complex entries.
F = fft2(f);
• In order to display the Fourier Spectrum |F(u,v)|
– Cyclically rotate the image so that F(0,0) is in the
center:
F = fftshift(F);
– Reduce dynamic range of |F(u,v)| by displaying
the log:
D = log(1+abs(F));
Example:
|F(u)| = 100 4 2 1 0 0 1 2 4
Cyclic |F(u)| = 0 1 2 4 100 4 2 1 0
Display in Range([0..10]):
|F(u)|/10 = 0 0 0 0 10 0 0 0 0
Distributive (addition)
~ ~ ~
F[
F 1 f (x,y) + f2 (x,y)] = F [f 1 (x,y)] + F [f2(x,y)]
Linearity
~ ~
FF[a f(x,y)] = aFF [f(x,y)]
a f(x,y) a F(u,v)
Cyclic
F(u,v) = F(u+N,v) = F(u,v+N) = F(u+N,v+N)
F(x,y) = F(x+N,y+N)
DC (Average)
N-1 M-1
1 1
F(0,0) = N M Σ Σ
x=0 y=0
f(x) e0
Distributive: F{f + g} = ~
~ F{f } + ~
F{g}
f(x) |F(ω)|
x ω
g(x) |G(ω)|
x ω
f+g |F(ω)+G(ω)|
x ω
Cyclic and Symmetry of the Fourier
Transform - 1D Example
1 cycle
|F(u)|
Translation
-2πi(ux0+vy0)
f(x-x0,y-y0) F(u,v)e N
2πi(u0x+v0y)
f(x,y)e N F(u-u0,v-v0)
Rotation
Rotation of f(x,y) Rotation of F(u,v)
by θ by θ
Scale
1
f(ax,by) F(u/a,v/b)
|ab|
Change of Scale- 1D:
1 ω
if F{f (x )} = F(ω ) then F{f (ax )} = F
~ ~
a a
f(x) |F(ω)|
x ω
f(x) |F(ω)|
x ω
f(x) |F(ω)|
x ω
Change of Scale
f(x) F(ω)
x ω
x ω
f(x/2) 2 F(2ω)
x ω
Example - Rotation
N-1 N-1
1
F(u,v) = N Σ (Σ f(x,y) e-2πivy/n) e-2πiux/n
x=0 y=0
N-1
1
F(u,v) = N Σ
x=0
F(x,v) e-2πiux/n
Higher Dimensions:
Fourier in any dimension can be performed by
applying 1D transform on each dimension.
Fourier Transform Examples
Spatial Frequency
Domain Domain
Input f F
Output g G
Impulse
h
Response
Freq.
H
Response
Relationship g=f*h G=FH
The Convolution Theorem
g=f*h g=fh
implies implies
G=FH G=F*H
and likewise
x
-1 1
f(x) f(x)
h(x) = *
-0.5 0.5 -0.5 0.5
F(ω) F(ω)
H(ω) = .
=
Convolution Theorem -
2D Example
f(x,y) g(x,y) f * g (x,y)
ℑF-1
−F[F(u,v)
ℑ 1 G(u,v)]
Sampling the Image
f(x) |F(ω)|
^
F
x ω
*
g(x)
|G(ω)|
^
F
ω
x
T 1/T
^
F
ω
x -1/2T 1/2T
Undersampling the Image
f(x) |F(ω)|
^
F
x ω
g(x)
|G(ω)| *
^
F
ω
x
T 1/T
^
F
ω
x -1/2T 1/2T
Critical Sampling
• If the maximal frequency of f(x) is ωmax , it
is clear from the above replicas that ω max
should be smaller that 1/2T.
• Alternatively:
1
> 2ω max
T
ω
-1/2T 1/2T
Optimal Interpolation
• It is possible to fully reconstruct f(x)
from its samples:
f(x) |F(ω)|
^
F-1
ω
x -1/2T 1/2T
*
f(x) |F(ω)|
^
F-1
1
ω
x -1/2T 1/2T
f(x) |F(ω)|
^
F-1
ω
x -1/2T 1/2T
Fast Fourier Transform - FFT
− 2πiux
N −1
1
F (u) = ∑ f ( x)e N
u = 0, 1, 2, ..., N-1
N x=0
O(n 2) operations
−2πiu2x −2πiu(2x +1)
N / 2−1 N / 2−1
Even Odd
All sampling points sampling points sampling points
0 1 2 3 4 5 6 7 0 2 4 6 1 3 5 7
2
−2πiu
1 e
F (u + ) = F (u) −e
N
N
2
N o
F (u)
2 N / 2 N / 2
FFT
FFT
Image Transform
Filtered