Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
Fourier Analysis and
Image Processing
Earl F. Glynn
Scientific Programmer
Bioinformatics
Stowers Institute for Medical Research
14 Feb 2007
2
Fourier Analysis and
Image Processing
• History
• Periodic Signals
• Fourier Analysis
– Fourier Series
– Fourier Transform
– Discrete Fourier Transform (DFT)
– Fast Fourier Transform (FFT)
• 2D FFT and Image Processing
– Spatial Frequency in Images
– 2D Discrete Fourier Transform
– 2D FFT Examples
– Applications of FFTs in Image Processing
• Summary
3
History
Jean Baptiste Joseph Fourier
17681830
French Mathematician and Physicist
http://de.wikipedia.org/wiki/Kreiszahl
Outlined technique in memoir, On the Propagation of Heat in Solid Bodies, which was
read to Paris Institute on 21 Dec 1807. Controversial then: Laplace and Lagrange
objected to what is now Fourier series: “... his analysis ... leaves something to be desired on
the score of generality and even rigour...” (from report awarding Fourier math prize in 1811)
In La Theorie Analytique de la Chaleur (Analytic Theory of Heat) (1822) Fourier
• developed the theory of the series known by his name, and
• applied it to the solution of boundaryvalue problems in partial differential equations.
Sources:
www.me.utexas.edu/~me339/Bios/fourier.html and wwwgap.dcs.stand.ac.uk/~history/Biographies/Fourier.html
4
Periodic Signals
A continuoustime signal x(t) is periodic if:
x(t + T) = x(t)
Fundamental period, T
0
, of x(t) is smallest T satisfying
above equation.
Fundamental frequency: f
0
= 1/T
0
Fundamental angular frequency: ω
0
= 2π/T
0
= 2πf
0
5
Periodic Signals
x(t + T) = x(t)
Harmonics: Integer multiples of frequency of wave

1
.
0
0
.
0
1
.
0
t
s
i
n
(
t
)
0
π 2
π
3π 2
2π 3π 4π

1
.
0
0
.
0
1
.
0
t
s
i
n
(
4
t
)
0
π 2
π
3π 2
2π 3π 4π
T
0
Fundamental
frequency:
f
0
= 1/T
0
6
Periodic Signals
Biological time series can be quite complex, and will contain noise.
x(t + T) = x(t)

2

1
0
1
2
t
x
(
t
)
0
π 2
π
3π 2
2π 3π 4π
“Biological” Time Series
T
0
7
Periodic Signals
Periodicity in Biology and Medicine
Photograph taken at Reptile Gardens, Rapid City, SD, June 2003,www.reptilegardens.com
Somitogenesis: A vertebrate’s body plan: a segmented
pattern. Segmentation is established during somitogenesis,
which is studied by Pourquie Lab.
Intraerythrocytic Developmental
Cycle of Plasmodium falciparum
From Bozdech, et al, Fig. 1A, PLoS Biology, Vol 1, No 1, Oct 2003, p 3.
Electrocardiogram (ECG): Measure of the dipole moment caused by
depolarization and repolarization of heart muscle cells.
From http://www.ecglibrary.com/norm.html
XRay Computerized Tomography. Tomogram (“slice”) produced
by 2D FFT of digitally filtered xray data.
From www.csun.edu/~jwadams/Image_Processing.pdf#search=%22fft%20medical%20
image%20processing%22
8
Fourier Analysis
• Fourier Series
Expansion of continuous function into weighted sum of sines and
cosines, or weighted sum of complex exponentials.
• Fourier Transform
Maps one function to another: continuoustocontinuous mapping.
An integral transform.
• Discrete Fourier Transform (DFT)
Approximation to Fourier integral. Maps discrete vector to another
discrete vector. Can be viewed as a matrix operator.
• Fast Fourier Transform (FFT)
Special computational algorithm for DFT.
9
Fourier Series
www.science.org.au/nova/029/029img/wave1.gif
Trigonometric Fourier Series
Expansion of continuous function into weighted sum of sines and cosines.
[ ]
∑
∞
·
⋅ + ⋅ + ·
1
0 0
0
) ( sin ) ( cos
2
) (
k
k k
t k t k t x
b a
a
ω ω
∫
⋅ ·
T
dt t k t x
T
ak
0
) cos( ) (
2
0
0
ω
∫
⋅ ·
T
dt t k t x
T
bk
0
) sin( ) (
2
0
0
ω
f
T
0
0
0
2
2
π
π
ω
· ·
If x(t) is even, i.e., x(t) = x(t) like cosine, then b
k
= 0.
If x(t) is odd, i.e., x(t) = x(t) like sine, then a
k
= 0.
Source: Schaum’s Theory and Problems: Signals and Systems, Hwei P. Hsu, 1995, pp. 211213
10
Complex Math Review
Solutions to x
2
= 1:
Complex Plane
Euler’s Formula:
Operators: +, , *, /
u + v = (a + ib) + (c + id) = (a + c) + i(b + d)
u × v = (a + ib) (c + id) = (ac – bd) + i(ad + bc)
DeMoivre’s Theorem:
u* = a  ib
11
Fourier Series
f
T
0
0
0
2
2
π
π
ω
· ·
Source Schaum’s Theory and Problems: Signals and Systems, Hwei P. Hsu, 1995, pp. 211213
∑
∞
−∞ ·
⋅ ⋅ ⋅
·
k
t k i
k e c
t x
ω0
) (
∫
⋅ ⋅ ⋅ −
⋅ ·
T
dt t x
e
T
c
t k i
k
0
0
) (
1
0
ω
Notes:
• If x(t) is real, c
k
= c
k
*
.
• For k = 0, c
k
= average value of x(t) over one period.
• a
0
/2 = c
0
; a
k
= c
k
+ c
k
; b
k
= i · (c
k
 c
k
)
Complex Exponential Fourier Series
Expansion of continuous function into weighted sum of complex exponentials.
12
Source: Schaum’s Theory and Problems: Signals and Systems, Hwei P. Hsu, 1995, pp. 211213
Fourier Series
Complex Exponential Fourier Series
Coefficients can be written as product:
e c c
k
i
k k
φ
⋅ ·
• c
k
are known as the spectral coefficients of x(t)
• Plot of c
k
 versus angular frequency ω is the amplitude spectrum.
• Plot of φ
k
versus angular frequency is the phase spectrum.
• With discrete Fourier frequencies, k·ω
0
, both are discrete spectra.
13
Fourier Series
selected
Approximate any function as truncated Fourier series
Given: x(t) = t
Fourier Series:
,
_
¸
¸
− + − · ...
3
3 sin
2
2 sin
sin 2 ) (
t t
t t x
,
_
¸
¸
− + − · ...
3
3 sin
2
2 sin
sin 2 ) (
t t
t t x
0.0 0.2 0.4 0.6 0.8 1.0
0
.
0
0
.
2
0
.
4
0
.
6
0
.
8
1
.
0
t
x
(
t
)
14
Fourier Series
selected
Approximate any function as truncated Fourier series
Given: x(t) = t Fourier Series:
,
_
¸
¸
− + − · ...
3
3 sin
2
2 sin
sin 2 ) (
t t
t t x
,
_
¸
¸
− + − · ...
3
3 sin
2
2 sin
sin 2 ) (
t t
t t x

1
.
0

0
.
5
0
.
0
0
.
5
1
.
0
1
.
5
2
.
0
Fourier Terms in Expansion of x(t) = t
t
F
o
u
r
i
e
r
T
e
r
m
s
0
π 4 π 2 3π 4
π
1
2
3
4
5
6
Fourier Series Approximation
t
x
(
t
)
First Six Series Terms
0
π 4 π 2 3π 4
π
0
1
2
3
15
Fourier Series
selected
Approximate any function as truncated Fourier series
Given: x(t) = t Fourier Series:
,
_
¸
¸
− + − · ...
3
3 sin
2
2 sin
sin 2 ) (
t t
t t x
,
_
¸
¸
− + − · ...
3
3 sin
2
2 sin
sin 2 ) (
t t
t t x
Fourier Series Approximation
t
x
(
t
)
0
π 4 π 2 3π 4
π
0
1
2
3
100 terms
200 terms
16
Fourier Series
Periodogram
Decomposition
Time Series
Reconstruction
Filtered Series
Remove
High Frequency
Component
0
selected
“Remove” high frequency noise by zeroing a term in series expansion
Noise Removal
17
Fourier Transform
Maps one function to another: continuoustocontinuous mapping.
Fourier transform of x(t) is X(ω):
(converts from time space to frequency space)
∫
∞
∞ −
−
⋅ · · dt t x t x X
e
t iω
ω ) ( )} ( { ) ( F
Fourier inverse transform of X(ω) recovers x(t):
(converts from frequency space to time space)
∫
∞
∞ −
⋅ · · ω ω
π
ω
ω
d X X t x
e
t i
) (
2
1
)} ( { ) (
F
1 
The Fourier Transform is a special case of the Laplace Transform, s = i ·ω
x(t) and X(ω) form a Fourier transform pair: x(t) ↔X(ω)
Source: Schaum’s Theory and Problems: Signals and Systems, Hwei P. Hsu, 1995, pp. 214218
18
Fourier Transform
Properties of the Fourier Transform
From http://en.wikipedia.org/wiki/Continuous_Fourier_transform
Also see Schaum’s Theory and Problems: Signals and Systems, Hwei P. Hsu, 1995, pp. 219223
19
Discrete Time Signal

1
.
0

0
.
5
0
.
0
0
.
5
1
.
0
sinθ
θ
s
i
n
θ
0 π 2 π 3π 2 2π 3π 4π
A discretetime signal x[n] is periodic if:
x[n + N] = x[n]
Fundamental period, N
0
, of x[n] is smallest integer N
satisfying above equation.
Fundamental angular frequency: Ω
0
= 2π/N
0
N
0
20
Discrete Fourier Transform (DFT)
The Eight Eighth Roots of Unity
http://math.fullerton.edu/mathews/
c2003/ComplexAlgebraRevisitedMod.html
e
N kn i
N
n
n x n x k X
) / 2 (
1
0
] [ ]} [ { ] [
π −
−
·
∑
⋅ · · DFT
Sources: Schaum’s Theory and Problems: Signals and Systems, Hwei P. Hsu, 1995, pp. 305
and http://en.wikipedia.org/wiki/Fast_Fourier_transform
Given discrete time sequence, x[n], n = 0, 1, …, N1
Discrete Fourier Transform (DFT)
k = 0, 1, …, N1
N
th
root of unity
Inverse Discrete Fourier Transform (IDFT)
e
N kn i
N
n
k X
N
k X n x
) / 2 (
1
0
] [
1
]} [ { ] [
π
∑
−
·
⋅ · · IDFT
• Onetoone correspondence between x[n] and X[k]
• DFT closely related to discrete Fourier series and the Fourier Transform
• DFT is ideal for computer manipulation
• Share many of the same properties as Fourier Transform
• Multiplier (1/N) can be used in DFT or IDFT. Sometimes 1/SQRT(N) used in both.
21
For N = 4, the DFT becomes:
Discrete Fourier Transform (DFT)
1
1
1
1
1
]
1
¸
1
1
1
1
1
]
1
¸
·
1
1
1
1
1
]
1
¸
− ⋅ − ⋅ − ⋅ −
⋅ − ⋅ − ⋅ − ⋅ −
⋅ − ⋅ − ⋅ − ⋅ −
⋅ − ⋅ − ⋅ − ⋅ −
x
x
x
x
e e e e
e e e e
e e e e
e e e e
X
X
X
X
i i i i
i i i i
i i i i
i i i i
3
2
1
0
2 / 9 2 / 6 2 / 3 2 / 0
2 / 6 2 / 4 2 / 2 2 / 0
2 / 3 2 / 2 2 / 1 2 / 0
2 / 0 2 / 0 2 / 0 2 / 0
3
2
1
0
π π π π
π π π π
π π π π
π π π π
1
1
1
1
1
]
1
¸
1
1
1
1
]
1
¸
− −
− −
− −
·
1
1
1
1
1
]
1
¸
x
x
x
x
X
X
X
X
i i
i i
3
2
1
0
3
2
1
0
1 1
1 1 1 1
1 1
1 1 1 1
e
N kn i
N
n
n x n x k X
) / 2 (
1
0
] [ ]} [ { ] [
π −
−
·
∑
⋅ · · DFT
n
k
k
k = 0, 1, …, N1
22
For N = 4, the DFT is:
Discrete Fourier Transform (DFT)
1
1
1
1
1
]
1
¸
1
1
1
1
]
1
¸
− −
− −
− −
·
1
1
1
1
1
]
1
¸
x
x
x
x
X
X
X
X
i i
i i
3
2
1
0
3
2
1
0
1 1
1 1 1 1
1 1
1 1 1 1
x = [1, 0, 1, 0] X = [2, 0, 2, 0]
x = [0, 3, 0, 3] X = [6, 0, 6, 0]
x = [1, 1, 1, 1] X = [4, 0, 0, 0]
x = [0, 0, 0, 0] X = [0, 0, 0, 0]
x = [0, 0, 1, 1] X = [2, 1+i, 0, 1i]
x = [1, 1, 0, 0] X = [2, 1 i, 0, 1+i]
X[0]/N = mean
23
Discrete Fourier Transform (DFT)
x = [1, 0, 1, 0] DFT(x) = [2, 0, 2, 0]
x = [0, 1, 0, 1] DFT(x) = [2, 0, 2, 0]
Periodogram = DFT(x)
2
/ N
(excluding first term, which is the mean)
Discrete Sequence
Time
x
(
t
)
1 2 3 4
0
.
0
0
.
5
1
.
0
0
.
0
0
.
6
Periodogram
1/Time
S
p
e
c
t
r
a
l
P
o
w
e
r
0.25 0.5 0.75
Fundamental Frequency
1
st
Harmonic
24
Discrete Fourier Transform (DFT)
x = [0, 0, 1, 1] X = [2, 1+i, 0, 1i]
x = [1, 1, 0, 0] X = [2, 1 i, 0, 1+i]
Why so much spectral “power” in 2
nd
Harmonic?
Discrete Sequence
Time
x
(
t
)
1 2 3 4
0
.
0
0
.
5
1
.
0
0
.
0
0
.
3
Periodogram
1/Time
S
p
e
c
t
r
a
l
P
o
w
e
r
0.25 0.5 0.75
2
nd
Harmonic 1
st
Harmonic Fundamental Frequency
?
25
Discrete Fourier Transform (DFT)
x = [0, 0, 1, 1] X = [2, 1+i, 0, 1i]
x = [1, 1, 0, 0] X = [2, 1 i, 0, 1+i]
Nyquist frequency is a consequence of Shannon Sampling Theorem
Discrete Sequence
Time
x
(
t
)
1 2 3 4
0
.
0
0
.
5
1
.
0
0
.
0
0
.
3
Periodogram
1/Time
S
p
e
c
t
r
a
l
P
o
w
e
r
0.25 0.5 0.75
2
nd
Harmonic 1
st
Harmonic Fundamental Frequency
ΔT = 1
f
Nyquist
=1/(2ΔT)
Also see: http://en.wikipedia.org/wiki/NyquistShannon_sampling_theorem
26
Sampling and Aliasing
The top signal is sampled at the Nyquist limit and is not aliased.
The bottom signal is sampled beyond the Nyquist limit and is aliased.
Aliasing occurs when higher frequencies are folded into lower frequencies.
From: http://www.siggraph.org/education/materials/HyperGraph/aliasing/alias3.htm
27
Fast Fourier Transform (FFT)
e
N kn i
N
n
n x n x k X
) / 2 (
1
0
] [ ]} [ { ] [
π −
−
·
∑
⋅ · · DFT
Source: http://en.wikipedia.org/wiki/Fast_Fourier_transform
Discrete Fourier Transform (DFT)
k = 0, 1, …, N1
• The FFT is a computationally efficient algorithm to compute the
Discrete Fourier Transform and its inverse.
• Evaluating the sum above directly would take O(N
2
) arithmetic
operations.
• The FFT algorithm reduces the computational burden to
O(N log N) arithmetic operations.
• FFT requires the number of data points to be a power of 2
(usually 0 padding is used to make this true)
• FFT requires evenlyspaced time series
28
Fast Fourier Transform (FFT)
What’s the “Trick” to the Speedup?
e
N kn i
N
n
n x n x k X
) / 2 (
1
0
] [ ]} [ { ] [
π −
−
·
∑
⋅ · · DFT
Discrete Fourier Transform (DFT)
k = 0, 1, …, N1
The Eight Eighth Roots of Unity
http://math.fullerton.edu/mathews/
c2003/ComplexAlgebraRevisitedMod.html
Use “Divide & Conquer” by splitting
polynomial evaluation into “even”
and “odd” parts, recursively:
p(x) = p
0
x
0
+ p
1
x
1
Split: p(x) = p
even
+ p
odd
p(x) = p
0
x
0
+ x · p
1
x
0
29
Fast Fourier Transform (FFT)
Software
www.fftw.org
FFTW is a C subroutine library for computing the discrete Fourier transform
(DFT) in one or more dimensions, of arbitrary input size
IDL (see Signal Processing Demo for Fourier Filtering)
R
MatLab: Signal Processing/Image Processing Toolboxes
Mathematica: Perform symbolic or numerical Fourier analysis
30
Fast Fourier Transform (FFT)
1D FFT in IDL Software
IDL Run Demo, Data Analysis, Signal Processing, Filtering Demo
31
Fast Fourier Transform (FFT)
1D FFT in ImageJ: Fourier Shape Analysis
Source: http://imagejdocu.tudor.lu/Members/tboudier/plonearticle.20060712.6904098144/20060714.2969642786/image
This is an application of Fourier analysis NOT involving a time series …
32
2D FFT and Image Processing
• Spatial Frequency in Images
• 2D Discrete Fourier Transform
• 2D FFT Examples
• Applications of FFT
– Noise Removal
– Pattern / Texture Recognition
– Filtering: Convolution and Deconvolution
33
1 Cycle
Frequency = 1 Frequency = 2
2 Cycles
Spatial Frequency in Images
34
2D Discrete Fourier Transform
Source: Seul et al, Practical Algorithms for Image Analysis, 2000, p. 249, 262.
2D FFT can be computed as two discrete Fourier transforms in 1 dimension
I[m,n] F[u,v]
Fourier
Transform
Spatial Domain Frequency Domain
(0,0)
(0,0)
(0,N/2)
(0,N/2)
(M/2,0) (M/2,0)
(M,N)
∑ ∑
−
·
,
_
¸
¸
+ −
−
·
⋅ ·
1
0
2
1
0
] , [
1
] , [
M
m
N
vn
M
um
i
N
n
e
n m I
MN
v u F
π
M pixels
S
M
units
N
p
i
x
e
l
s
S
N
u
n
i
t
s
35
2D Discrete Fourier Transform
I[m,n] F[u,v]
Fourier
Transform
Spatial Domain Frequency Domain
(0,0)
(0,0)
(0,N/2)
(0,N/2)
(M/2,0) (M/2,0)
(M,N)
M pixels
S
M
units
N
p
i
x
e
l
s
S
N
u
n
i
t
s
Edge represents highest frequency,
smallest resolvable length (2 pixels)
Center represents lowest frequency,
which represents average pixel value
36
2D FFT Example
FFTs Using ImageJ
Spatial Domain Frequency Domain
ImageJ Steps: (1) File  Open, (2) Process  FFT  FFT
(0,0) Origin
(0,0) Origin
37
2D FFT Example
FFTs Using ImageJ
Spatial Domain Frequency Domain
ImageJ Steps: Process  FFT  Swap Quadrants
(0,0) Origin
(0,0) Origin
Regularity in image manifests itself in the degree of order or randomness in FFT pattern.
Default display is to swap quadrants
38
2D FFT Example
FFTs Using ImageJ
Overland Park Arboretum and Botanical Gardens, June 2006
Spatial Domain Frequency Domain
ImageJ Steps: (1) File  Open, (2) Process  FFT  FFT
Regularity in image manifests itself in the degree of order or randomness in FFT pattern.
39
Application of FFT in Image Processing
Noise Removal
Source: www.mediacy.com/apps/fft.htm, Image Pro Plus FFT Example. Last seen online in 2004.
FFT
Inverse
FFT
Edit FFT
Four Noise
Spikes Removed
Noise Pattern
Stands Out as
Four Spikes
40
Application of FFT
Pattern/Texture Recognition
Source: Lee and Chen, A New Method for Coarse Classification of Textures and Class Weight Estimation
for Texture Retrieval, Pattern Recognition and Image Analysis, Vol. 12, No. 4, 2002, pp. 400–410.
41
Application of FFT
Source: http://www.rpgroup.caltech.edu/courses/PBL/size.htm
Could FFT of Drosophila eye be used to identify/quantify subtle phenotypes?
The Drosophila eye is a great example a cellular crystal with
its hexagonally closedpacked structure. The absolute
value of the Fourier transform (right) shows its hexagonal
structure.
Pattern/Texture Recognition
42
Application of FFT
Filtering in the Frequency Domain: Convolution
Source: Gonzalez and Woods, Digital Image Processing (2
nd
ed), 2002, p. 159
I[m,n]
Raw Image
I’[m,n]
Enhanced Image
Fourier Transform
F[u,v]
Filter Function
H[u,v]
Inverse
Fourier Transform
Pre
processing
Post
processing
F[u,v] H[u,v] · F[u,v]
FFT{ I[u,v] } FFT
1
{ H[u,v] · F[u,v] }
43
Application of FFT
Filtering: IDL Fourier Filter Demo
IDL Run Demo, Data Analysis, Image Processing, Image Processing Demo
44
Application of FFT
Filtering: IDL Fourier Filtering Demo
IDL Run Demo, Data Visualization, Images, Fourier Filtering
45
The Point Spread Function (PSF) is the Fourier transform of a filter.
(the PSP says how much blurring there will be in trying to image a point).
Source: http://www.reindeergraphics.com/index.php?option=com_content&task=view&id=179&Itemid=127
Hubble image and measured PSF
Dividing the Fourier transform of the PSF into
the transform of the blurred image, and
performing an inverse FFT, recovers the
unblurred image.
Application of FFT
Deblurring: Deconvolution
FFT(Unblurred Image) * FFT(Point Spread Function) = FFT(Blurred Image)
Unblurred Image = FFT
1
[ FFT(Blurred Image) / FFT(Point Spread Function) ]
46
The Point Spread Function (PSF) is the Fourier transform of a filter.
(the PSP says how much blurring there will be in trying to image a point).
Source: http://www.reindeergraphics.com/index.php?option=com_content&task=view&id=179&Itemid=127
Hubble image and measured PSF
Deblurred image
Dividing the Fourier transform of the PSF into
the transform of the blurred image, and
performing an inverse FFT, recovers the
unblurred image.
Application of FFT
Deblurring: Deconvolution
47
Summary
• Fourier Analysis is a powerful tool even when periodicity is not
directly a part of the problem being solved.
• Discrete Fourier Transforms (DFT) are wellsuited for computation
by computer, especially when using Fast Fourier Transform (FFT)
algorithms.
• Fourier Analysis can be used to remove noise from a signal or
image.
• Interpretation of the complex Fourier Transform is not always
straightforward.
• Convolution and Deconvolution are “simple” in Fourier transform
space to restore or enhance images.
• There are many other image processing uses of Fourier Analysis,
such as image compression [JPGs use the Discrete Cosine
Transform (DCT), which is a special kind of DFT]
Fourier Analysis and Image Processing
• History • Periodic Signals • Fourier Analysis
– – – – – – – – Fourier Series Fourier Transform Discrete Fourier Transform (DFT) Fast Fourier Transform (FFT) Spatial Frequency in Images 2D Discrete Fourier Transform 2D FFT Examples Applications of FFTs in Image Processing
2
• 2D FFT and Image Processing
• Summary
History
Jean Baptiste Joseph Fourier 17681830
French Mathematician and Physicist
http://de.wikipedia.org/wiki/Kreiszahl
Outlined technique in memoir, On the Propagation of Heat in Solid Bodies, which was read to Paris Institute on 21 Dec 1807. Controversial then: Laplace and Lagrange objected to what is now Fourier series: “... his analysis ... leaves something to be desired on
the score of generality and even rigour...” (from report awarding Fourier math prize in 1811)
In La Theorie Analytique de la Chaleur (Analytic Theory of Heat) (1822) Fourier • developed the theory of the series known by his name, and • applied it to the solution of boundaryvalue problems in partial differential equations.
Sources: www.me.utexas.edu/~me339/Bios/fourier.html and wwwgap.dcs.stand.ac.uk/~history/Biographies/Fourier.html
3
Periodic Signals
A continuoustime signal x(t) is periodic if: x(t + T) = x(t) Fundamental period, T0, of x(t) is smallest T satisfying above equation. Fundamental frequency: f0 = 1/T0 Fundamental angular frequency: ω0 = 2π/T0 = 2πf0
4
0 1.0 0 π 2 π 3π 2 2π t 3π 4π Harmonics: Integer multiples of frequency of wave 5 .0 T0 0 π 2 π 3π 2 2π t 3π 4π sin(4t) 1.0 sin(t) 0.Periodic Signals x(t + T) = x(t) Fundamental frequency: f0 = 1/T0 1.0 0.0 1.
Periodic Signals x(t + T) = x(t) “Biological” Time Series x(t) 0 2 1 1 2 T0 0 π 2 π 3π 2 2π t 3π 4π Biological time series can be quite complex. 6 . and will contain noise.
Rapid City.www. No 1.edu/~jwadams/Image_Processing. PLoS Biology. From www. XRay Computerized Tomography.ecglibrary. June 2003. p 3. Vol 1. Tomogram (“slice”) produced by 2D FFT of digitally filtered xray data. which is studied by Pourquie Lab. Oct 2003.reptilegardens. Photograph taken at Reptile Gardens.com/norm.pdf#search=%22fft%20medical%20 image%20processing%22 7 . Fig. 1A.com Intraerythrocytic Developmental Cycle of Plasmodium falciparum From Bozdech.html Somitogenesis: A vertebrate’s body plan: a segmented pattern. SD.Periodic Signals Periodicity in Biology and Medicine Electrocardiogram (ECG): Measure of the dipole moment caused by depolarization and repolarization of heart muscle cells.csun. From http://www. et al. Segmentation is established during somitogenesis.
• Discrete Fourier Transform (DFT) Approximation to Fourier integral. • Fast Fourier Transform (FFT) Special computational algorithm for DFT.Fourier Analysis • Fourier Series Expansion of continuous function into weighted sum of sines and cosines. or weighted sum of complex exponentials. An integral transform. Maps discrete vector to another discrete vector. 8 . Can be viewed as a matrix operator. • Fourier Transform Maps one function to another: continuoustocontinuous mapping.
then bk = 0.Fourier Series Trigonometric Fourier Series Expansion of continuous function into weighted sum of sines and cosines. i. If x(t) is odd.gif 0 0 If x(t) is even. x(t ) = a + ∑ [ a ⋅ cos (k ω 2 ∞ 0 k k =1 0 t ) + bk ⋅ sin (k ω 0 t ) ] ak = bk = T ∫T 0 2 0 x(t ) ⋅ cos(k ω 0 t ) dt x(t ) ⋅ sin(k ω 0 t ) dt ∫T T 0 2 0 ω0 = 2π T = 2π f www. Hsu. then ak = 0.au/nova/029/029img/wave1... x(t) = x(t) like cosine.e. x(t) = x(t) like sine.e. pp. 1995. Hwei P.org.science. i. 211213 9 . Source: Schaum’s Theory and Problems: Signals and Systems.
/ Euler’s Formula: DeMoivre’s Theorem: 10 .Complex Math Review Solutions to x2 = 1: Complex Plane u* = a . . *.ib u + v = (a + ib) + (c + id) = (a + c) + i(b + d) u × v = (a + ib) (c + id) = (ac – bd) + i(ad + bc) Operators: +.
ck) Source Schaum’s Theory and Problems: Signals and Systems. Hsu. ak = ck + ck. pp.Fourier Series Complex Exponential Fourier Series Expansion of continuous function into weighted sum of complex exponentials. 211213 11 . Hwei P. bk = i · (ck . • For k = 0. 1995. x (t ) = k = −∞ ∑c e k k ∞ i ⋅k ⋅ ω 0 ⋅t ω 0 ⋅t c = ∫T T 0 1 x(t ) ⋅ e 0 − i ⋅k ⋅ dt ω0 = 2π T = 2π f 0 0 Notes: • If x(t) is real. ck = ck*. ck = average value of x(t) over one period. • a0/2 = c0.
1995. pp. both are discrete spectra. Hsu. • Plot of φkversus angular frequency is the phase spectrum. Hwei P. 211213 12 .Fourier Series Complex Exponential Fourier Series Coefficients can be written as product: c k = c k i ⋅e φ k • ck are known as the spectral coefficients of x(t) • Plot of ck versus angular frequency ω is the amplitude spectrum. Source: Schaum’s Theory and Problems: Signals and Systems. k·ω0. • With discrete Fourier frequencies.
8 1..8 0.4 t 0.0 0. x (t ) = 2 sin t − 2 3 Fourier Series Given: x(t) = t 1.2 0.sin 2t sin 3t + − ..0 x(t) 0.2 0..4 0.. 2 3 Approximate any function as truncated Fourier series selected 13 .6 0.6 0.0 0.0 Fourier Series: sin 2t sin 3t x(t ) = 2 sin t − + − .
0 1.0 0 π 2 t 3π 4 π 0 π 4 π 2 t 3π 4 π Approximate any function as truncated Fourier series selected 14 .0 0.sin 2t sin 3t + − .... 2 3 Fourier Series Approximation First Six Series Terms 3 Fourier Terms in Expansion of x(t) = t 2.0 2 3 4 5 6 1. x (t ) = 2 sin t − 2 3 Fourier Series Given: x(t) = t Fourier Series: sin 2t sin 3t x(t ) = 2 sin t − + − .5 0.5 1 2 x(t) 0 π 4 1 Fourier Terms 0..5 1.
.. 2 3 Fourier Series Approximation 100 terms 200 terms 3 x(t) 0 1 2 0 π 4 π 2 t 3π 4 π Approximate any function as truncated Fourier series selected 15 ..sin 2t sin 3t + − . x (t ) = 2 sin t − 2 3 Fourier Series Given: x(t) = t Fourier Series: sin 2t sin 3t x(t ) = 2 sin t − + − ..
Fourier Series Noise Removal Time Series Periodogram Filtered Series Remove High Frequency Component 0 Reconstruction selected Decomposition “Remove” high frequency noise by zeroing a term in series expansion 16 .
Fourier transform of x(t) is X(ω): (converts from time space to frequency space) X (ω ) = F{x (t )} = ∞ −∞ ∫ x(t ) ⋅ e − iω t dt Fourier inverse transform of X(ω) recovers x(t): (converts from frequency space to time space) 1 x(t ) = F { X (ω )} = 2π 1 ∞ −∞ ∫ X (ω ) ⋅ e iω t dω x(t) and X(ω) form a Fourier transform pair: x(t) ↔ X(ω) The Fourier Transform is a special case of the Laplace Transform. 214218 17 . 1995. s = i ·ω Source: Schaum’s Theory and Problems: Signals and Systems. Hsu. pp.Fourier Transform Maps one function to another: continuoustocontinuous mapping. Hwei P.
wikipedia. Hwei P. pp.org/wiki/Continuous_Fourier_transform Also see Schaum’s Theory and Problems: Signals and Systems. 219223 18 .Fourier Transform Properties of the Fourier Transform From http://en. 1995. Hsu.
5 . of x[n] is smallest integer N satisfying above equation.0 0.5 N0 0 π 2 π 3π 2 2π θ 3π 4π A discretetime signal x[n] is periodic if: x[n + N] = x[n] Fundamental period. Fundamental angular frequency: Ω0 = 2π/N0 19 1. N0.0 0.0 sinθ 0.Discrete Time Signal sinθ 1.
1.wikipedia. N1 Nth root of unity Inverse Discrete Fourier Transform (IDFT) 1 x[n] = IDFT{ X [k ]} = N ∑ X [k ] ⋅ e n=0 N −1 i ( 2πkn / N ) • Onetoone correspondence between x[n] and X[k] • DFT closely related to discrete Fourier series and the Fourier Transform • DFT is ideal for computer manipulation • Share many of the same properties as Fourier Transform • Multiplier (1/N) can be used in DFT or IDFT. x[n]. 305 and http://en. N1 Discrete Fourier Transform (DFT) X [k ] = DFT{x[ n]} = ∑ x[n] ⋅ e n=0 N −1 − i ( 2πkn / N ) k = 0.html 20 .fullerton.Discrete Fourier Transform (DFT) Given discrete time sequence. n = 0.org/wiki/Fast_Fourier_transform The Eight Eighth Roots of Unity http://math. …. 1.edu/mathews/ c2003/ComplexAlgebraRevisitedMod. 1995. …. Hsu. Sometimes 1/SQRT(N) used in both. pp. Hwei P. Sources: Schaum’s Theory and Problems: Signals and Systems.
Discrete Fourier Transform (DFT) X [k ] = DFT{x[n]} = ∑ x[n] ⋅ e n=0 N −1 − i ( 2πkn / N ) k = 0. the DFT becomes: k k X 0 e − 0 ⋅ iπ / 2 X 1 = e X 2 − 0 ⋅ iπ / 2 e− 0⋅iπ / 2 X 3 e −0 ⋅iπ / 2 e e e e −0 ⋅iπ / 2 −1⋅iπ / 2 − 2 ⋅ iπ / 2 − 3⋅ i π / 2 e e e e −0 ⋅iπ / 2 − 2 ⋅ iπ / 2 − 4 ⋅ iπ / 2 − 6 ⋅ iπ / 2 e e e e x0 − 3⋅ i π / 2 x1 − 6 ⋅ iπ / 2 x 2 − 9 iπ / 2 x3 −0 ⋅iπ / 2 n X 0 1 1 1 1 x 0 1 − i −1 i x1 X 1 = X 2 1 − 1 1 − 1 x 2 1 i − 1 − i x3 X 3 21 . 1. N1 For N = 4. ….
1i] X = [2. 1. 0. 0] X = [4. 1. 1+i. 6. 1. 0] X = [6.i. 0. 0. 1. 0. 1. 0. 1+i] 22 X[0]/N = mean . 0] X = [2. 2. 0] x = [0. 0. 0. 0. 0. 0. 0. 0. 0] X = [0. 0] X = [2.Discrete Fourier Transform (DFT) For N = 4. 3] x = [1. the DFT is: X 0 1 1 1 1 x 0 1 − i −1 i x1 X 1 = X 2 1 − 1 1 − 1 x 2 i − 1 − i x3 X 3 1 x = [1. 0] x = [0. 0. 3. 1] x = [0. 0. 1] x = [1. 1.
0] DFT(x) = [2.0 0.0 DFT(x) = [2. which is the mean) 23 .5 1.0 0. 0] Discrete Sequence x(t) 1 2 Time 3 4 Spectral Power Periodogram 0. 0.6 0.75 Fundamental Frequency 1st Harmonic Periodogram = DFT(x)2 / N (excluding first term. 0] x = [0. 2. 1. 1.25 0.5 1/Time 0. 0. 0. 0.Discrete Fourier Transform (DFT) x = [1. 1] 0. 2.
0] 0. 1] x = [1.i. 1. 0. 0.5 1/Time Fundamental Frequency 1st Harmonic 2nd Harmonic Why so much spectral “power” in 2nd Harmonic? 24 . 0.0 0.0 0.75 0.Discrete Fourier Transform (DFT) x = [0. 1. 1i] X = [2. 0. 1+i] Discrete Sequence x(t) 1 2 Time 3 4 Spectral Power Periodogram 0. 1+i.0 X = [2. 1.3 ? 0.5 1.25 0.
Discrete Fourier Transform (DFT) x = [0.75 Fundamental Frequency 1st Harmonic 2nd Harmonic Nyquist frequency is a consequence of Shannon Sampling Theorem Also see: http://en. 1i] X = [2.wikipedia. 1. 1+i. 0] 0.org/wiki/NyquistShannon_sampling_theorem 25 . 1+i] Discrete Sequence ΔT = 1 1 2 Time 3 4 x(t) Spectral Power fNyquist =1/(2ΔT)Periodogram 0.0 0.5 1/Time 0.5 1. 1.0 0.25 0. 0.0 X = [2. 1] x = [1. 1.3 0.i. 0. 0. 0.
Aliasing occurs when higher frequencies are folded into lower frequencies. 26 From: http://www.htm .Sampling and Aliasing The top signal is sampled at the Nyquist limit and is not aliased.siggraph.org/education/materials/HyperGraph/aliasing/alias3. The bottom signal is sampled beyond the Nyquist limit and is aliased.
• FFT requires the number of data points to be a power of 2 (usually 0 padding is used to make this true) • FFT requires evenlyspaced time series Source: http://en.org/wiki/Fast_Fourier_transform 27 .Fast Fourier Transform (FFT) Discrete Fourier Transform (DFT) X [k ] = DFT{x[ n]} = ∑ x[n] ⋅ e n=0 N −1 − i ( 2πkn / N ) k = 0. ….wikipedia. • Evaluating the sum above directly would take O(N2) arithmetic operations. N1 • The FFT is a computationally efficient algorithm to compute the Discrete Fourier Transform and its inverse. • The FFT algorithm reduces the computational burden to O(N log N) arithmetic operations. 1.
html .Fast Fourier Transform (FFT) What’s the “Trick” to the Speedup? Discrete Fourier Transform (DFT) X [k ] = DFT{x[ n]} = ∑ x[n] ⋅ e n=0 N −1 − i ( 2πkn / N ) k = 0. recursively: p(x) = p0x0 + p1x1 Split: p(x) = peven + podd p(x) = p0x0 + x · p1x0 28 The Eight Eighth Roots of Unity http://math.fullerton. 1. N1 Use “Divide & Conquer” by splitting polynomial evaluation into “even” and “odd” parts. ….edu/mathews/ c2003/ComplexAlgebraRevisitedMod.
fftw. of arbitrary input size IDL (see Signal Processing Demo for Fourier Filtering) MatLab: Signal Processing/Image Processing Toolboxes Mathematica: R Perform symbolic or numerical Fourier analysis 29 .Fast Fourier Transform (FFT) Software www.org FFTW is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions.
Fast Fourier Transform (FFT) 1D FFT in IDL Software IDL Run Demo. Signal Processing. Data Analysis. Filtering Demo 30 .
tudor.20060712.Fast Fourier Transform (FFT) 1D FFT in ImageJ: Fourier Shape Analysis Source: http://imagejdocu.lu/Members/tboudier/plonearticle.2969642786/image This is an application of Fourier analysis NOT involving a time series … 31 .6904098144/20060714.
2D FFT and Image Processing • • • • Spatial Frequency in Images 2D Discrete Fourier Transform 2D FFT Examples Applications of FFT – Noise Removal – Pattern / Texture Recognition – Filtering: Convolution and Deconvolution 32 .
Spatial Frequency in Images Frequency = 1 Frequency = 2 1 Cycle 2 Cycles 33 .
N) (0. 262.0) M pixels SM units M −1 N −1 m =0 n =0 ∑ ∑ I [m. v] = MN (0.0) (M/2. 2000.N/2) F[u.2D Discrete Fourier Transform 1 F [u.v] Frequency Domain Source: Seul et al. 249. 2D FFT can be computed as two discrete Fourier transforms in 1 dimension 34 . p.0) (0. Practical Algorithms for Image Analysis. n] ⋅ e um vn −i 2π + M N (0.n] Spatial Domain (M.N/2) N pixels SN units Fourier Transform I[m.0) (M/2.
2D Discrete Fourier Transform Edge represents highest frequency.v] Frequency Domain Center represents lowest frequency.N) (0.0) (M/2.0) (0.n] Spatial Domain (M.0) M pixels SM units (0. 35 which represents average pixel value .N/2) F[u.0) (M/2. smallest resolvable length (2 pixels) (0.N/2) N pixels SN units Fourier Transform I[m.
0) Origin (0.0) Origin Spatial Domain Frequency Domain 36 . (2) Process  FFT  FFT (0.2D FFT Example FFTs Using ImageJ ImageJ Steps: (1) File  Open.
2D FFT Example FFTs Using ImageJ ImageJ Steps: Process  FFT  Swap Quadrants (0.0) Origin Default display is to swap quadrants Spatial Domain Frequency Domain 37 Regularity in image manifests itself in the degree of order or randomness in FFT pattern. .0) Origin (0.
.2D FFT Example FFTs Using ImageJ ImageJ Steps: (1) File  Open. (2) Process  FFT  FFT Overland Park Arboretum and Botanical Gardens. June 2006 Spatial Domain Frequency Domain 38 Regularity in image manifests itself in the degree of order or randomness in FFT pattern.
Last seen online in 2004. 39 .mediacy.htm. Image Pro Plus FFT Example.com/apps/fft.Application of FFT in Image Processing Noise Removal FFT Inverse FFT Noise Pattern Stands Out as Four Spikes Four Noise Spikes Removed Edit FFT Source: www.
Application of FFT Pattern/Texture Recognition Source: Lee and Chen. 2002. 400–410. 40 . Vol. pp. 12. 4. No. A New Method for Coarse Classification of Textures and Class Weight Estimation for Texture Retrieval. Pattern Recognition and Image Analysis.
The absolute value of the Fourier transform (right) shows its hexagonal structure. Source: http://www.Application of FFT Pattern/Texture Recognition The Drosophila eye is a great example a cellular crystal with its hexagonally closedpacked structure.edu/courses/PBL/size.rpgroup.caltech.htm Could FFT of Drosophila eye be used to identify/quantify subtle phenotypes? 41 .
v] · F[u.Application of FFT Filtering in the Frequency Domain: Convolution I[m. p.v] · F[u. 159 42 . 2002.v] F[u.n] Enhanced Image Preprocessing Postprocessing FFT{ I[u.v] } FFT1{ H[u.v] Source: Gonzalez and Woods.v] Filter Function H[u.n] Raw Image I’[m.v] } Fourier Transform F[u. Digital Image Processing (2nd ed).v] Inverse Fourier Transform H[u.
Image Processing. Data Analysis.Application of FFT Filtering: IDL Fourier Filter Demo IDL Run Demo. Image Processing Demo 43 .
Application of FFT Filtering: IDL Fourier Filtering Demo IDL Run Demo. Fourier Filtering 44 . Images. Data Visualization.
Application of FFT Deblurring: Deconvolution The Point Spread Function (PSF) is the Fourier transform of a filter. (the PSP says how much blurring there will be in trying to image a point).com/index. FFT(Unblurred Image) * FFT(Point Spread Function) = FFT(Blurred Image) Unblurred Image = FFT1[ FFT(Blurred Image) / FFT(Point Spread Function) ] Source: http://www.reindeergraphics. Hubble image and measured PSF Dividing the Fourier transform of the PSF into the transform of the blurred image. recovers the unblurred image. and performing an inverse FFT.php?option=com_content&task=view&id=179&Itemid=127 45 .
Application of FFT Deblurring: Deconvolution The Point Spread Function (PSF) is the Fourier transform of a filter. recovers the unblurred image. Deblurred image Source: http://www.php?option=com_content&task=view&id=179&Itemid=127 46 . and performing an inverse FFT. (the PSP says how much blurring there will be in trying to image a point).reindeergraphics. Hubble image and measured PSF Dividing the Fourier transform of the PSF into the transform of the blurred image.com/index.
especially when using Fast Fourier Transform (FFT) algorithms. such as image compression [JPGs use the Discrete Cosine Transform (DCT). • Discrete Fourier Transforms (DFT) are wellsuited for computation by computer. • Interpretation of the complex Fourier Transform is not always straightforward. • Fourier Analysis can be used to remove noise from a signal or image.Summary • Fourier Analysis is a powerful tool even when periodicity is not directly a part of the problem being solved. • Convolution and Deconvolution are “simple” in Fourier transform space to restore or enhance images. which is a special kind of DFT] 47 . • There are many other image processing uses of Fourier Analysis.
This action might not be possible to undo. Are you sure you want to continue?
Use one of your book credits to continue reading from where you left off, or restart the preview.