Microsoft PowerPoint - Lect03 (Compatibility Mode)
Microsoft PowerPoint - Lect03 (Compatibility Mode)
Spring 2008
New Mexico Tech
Outline
► Fourier Transform
04-Dec-11 2
Fourier Series and Fourier Transform: History
► Jean Baptiste Joseph Fourier, French mathematician and physicist
(03/21/1768-05/16/1830) http://en.wikipedia.org/wiki/Joseph_Fourier
Permanent
Orphaned: at nine
Secretary of the
French Academy of
Egyptian expedition Sciences: 1822
with Napoleon I:
1798 Théorie analytique
Governor of Lower de la chaleur :
Egypt 1822
(The Analytic
Theory of Heat)
04-Dec-11 3
Fourier Series and Fourier Transform: History
► Fourier Series
Any periodic function can be expressed as the sum of sines
and /or cosines of different frequencies, each multiplied by
a different coefficients
► Fourier Transform
Any function that is not periodic can be expressed as the
integral of sines and /or cosines multiplied by a weighing
function
04-Dec-11 4
Fourier Series: Example
04-Dec-11 5
Preliminary Concepts
| C |= R 2 + I 2 and θ = arctan( I / R )
C =| C | (cos θ + j sin θ )
Using Euler's formula,
C =| C | e jθ
04-Dec-11 6
Fourier Series
∑ce
j t
f (t ) = n
T
n =−∞
where
2π n
1 T /2 −j t
cn = ∫ f (t )e T
dt for n = 0, ±1, ±2,...
T −T /2
04-Dec-11 7
Impulses and the Sifting Property (1)
A unit impulse of a continuous variable t located
at t =0, denoted δ (t ), defined as
∞ if t = 0
δ (t ) =
0 if t ≠ 0
and is constrained also to satisfy the identity
∞
∫ −∞
δ (t )dt = 1
∞
∑ δ ( x) = 1
x =−∞
∞
The sifting property ∑
x =−∞
f ( x)δ ( x − x0 ) = f ( x0 )
∞
∑
x =−∞
f ( x)δ ( x) = f (0)
04-Dec-11 9
Impulses and the Sifting Property (3)
04-Dec-11 10
Fourier Transform: One Continuous Variable
04-Dec-11 11
Fourier Transform: One Continuous Variable
∞ W /2
F (µ ) = ∫ f (t )e − j 2πµ t
dt = ∫ Ae − j 2πµt dt
−∞ −W /2
−A − j 2πµ t W /2 A
= e = e jπµW − e − jπµW
j 2πµ −W /2 j 2π W
sin(πµW )
= AW
(πµW )
04-Dec-11 12
Fourier Transform: Impulses
= e − j 2πµ 0
=1
The Fourier transform of a unit impulse located at t = t0 :
∞
F ( µ ) = ∫ δ (t − t0 )e − j 2πµt dt
−∞
= e − j 2πµt0
=cos(2πµ t0 ) − j sin (2πµ t0 )
04-Dec-11 13
Fourier Transform: Impulse Trains
∞
Impulse train s∆T (t ), s∆T (t ) = ∑ δ (t − n∆T )
n =−∞
∑c
j t
s∆T (t ) = n e ∆T
n =−∞
where
2π n
1 ∆T /2 −j t
cn =
∆T ∫−∆T /2
s∆T (t )e ∆T
dt
04-Dec-11 14
Fourier Transform: Impulse Trains
1 0 1
= e = n )t
∞ − j 2π ( µ −
∆T ∆∆TT n
=∫ e dt = δ ( µ − )
−∞ ∆T
2π n n ∞
2π n n
ℑ δ ( µj −∆T t ) 1= ∫ δ ( µj − t )e j 2πµt du
−∞
1 ∞
s∆T (t ) = ∑c n e ∆T= ∑ −∞ e ∆T ∆T
n =−∞2π nt ∆T n =−∞
j
= e ∆T
04-Dec-11 15
Fourier Transform: Impulse Trains
Let S ( µ ) denote the Fourier transform of the
periodic impulse train S∆T (t )
2π n
1 ∞
∑e
j t
S ( µ ) = ℑ{S ∆T (t )} = ℑ ∆T
∆T n =−∞
1 ∞ j 2∆πTn t
= ℑ ∑ e
∆T n =−∞
1 ∞ n
= ∑
∆T n =−∞
δ (µ −
∆T
)
04-Dec-11 16
Fourier Transform and Convolution
The convolution of two functions is denoted
by the operator
∞
f (t ) h(t ) = ∫ f (τ )h(t − τ )dτ
−∞
∞ ∞
ℑ{ f (t ) h(t )} = ∫ ∫ f (τ )h(t − τ )dτ e− j 2πµt dt
−∞
−∞
∞ ∞
= ∫ f (τ ) ∫ h(t − τ )e − j 2πµt dt dτ
−∞ −∞
∞
=∫ f (τ ) H ( µ )e− j 2πµτ dτ
−∞
∞
=H ( µ ) ∫ f (τ )e− j 2πµτ dτ
−∞
=H ( µ ) F ( µ )
04-Dec-11 17
Fourier Transform and Convolution
f (t ) h(t ) ⇔ H ( µ ) F ( µ )
f (t )h(t ) ⇔ H ( µ ) F ( µ )
04-Dec-11 18
Fourier Transform of Sampled Functions
fɶ (t ) = f (t ) s∆T (t )
∞
= ∑
n =−∞
f (t )δ (t − n∆T )
04-Dec-11 19
Fourier Transform of Sampled Functions
{ }
Fɶ ( µ ) = ℑ fɶ (t ) = ℑ{ f (t ) s∆T (t )} = F ( µ ) ? S ( µ )
∞
Fɶ ( µ ) = F1( µ )∞ S ( µ ) = ∫n F (τ ) S ( µ − τ )dτ
S (µ ) = ∑
∆1T n =−∞
∞
δ ( µ −
∞ ∆T
−∞
)
n
= ∫ F (τ ) ∑ δ ( µ − τ − )dτ
∆T −∞
n =−∞ ∆T
1 ∞ ∞ n
= ∑
∆T n =−∞ ∫ −∞
F (τ )δ ( µ − τ −
∆T
)dτ
1 ∞ n
= ∑
∆T n =−∞
F (µ −
∆T
)
04-Dec-11 20
Question
1. Continuous
2. Discrete
04-Dec-11 21
Fourier Transform of Sampled Functions
► A bandlimited signal is a signal whose Fourier transform
is zero above a certain finite frequency. In other words, if
the Fourier transform has finite support then the signal is
said to be bandlimited.
x(t ) = sin(2π ft + θ )
04-Dec-11 22
Fourier Transform of Sampled Functions
− µ max µmax
Over-sampling
1
> 2 µmax
Fɶ ( µ ) = ∆T
∞
1 n
∆T
∑ F (µ −
∆T
) Critically-sampling
n =−∞ 1
= 2 µmax
∆T
under-sampling
1
< 2µmax
04-Dec-11 ∆T 23
Nyquist–Shannon sampling theorem
1
► Sufficient separation is guaranteed if > 2 µmax
∆T
Sampling theorem: A continuous, band-limited function
can be recovered completely from a set of its samples if
the samples are acquired at a rate exceeding twice the
highest frequency content of the function
04-Dec-11 24
Nyquist–Shannon sampling theorem
?
∞
f (t ) = ∫ F ( µ )e j 2πµt d µ
−∞
04-Dec-11 25
Aliasing
04-Dec-11 26
Aliasing
04-Dec-11 27
Aliasing
04-Dec-11 28
Function Reconstruction from Sampled Data
F ( µ ) = H ( µ ) Fɶ ( µ )
f (t ) = ℑ −1
{F ( µ )}
=ℑ −1
{H (µ ) Fɶ (µ )}
= h(t ) fɶ (t )
∞
f (t ) = ∑ f (n∆T )sinc [ (t − n∆T ) / n∆T ]
n =−∞
04-Dec-11 29
The Discrete Fourier Transform (DFT) of One
Variable
M −1
F ( µ ) = ∑ f ( x)e − j 2πµ x / M , µ =0,1,..., M − 1
x =0
M −1
1
f ( x) =
M
∑ F
µ =0
( µ ) e j 2πµ x / M
, x = 0,1, 2,..., M − 1
04-Dec-11 30
2-D Impulse and Sifting Property: Continuous
∞ if t = z = 0
The impulse δ (t , z ), δ (t , z ) =
0 otherwise
∞ ∞
and ∫ ∫ −∞ −∞
δ (t , z )dtdz = 1
04-Dec-11 31
2-D Impulse and Sifting Property: Discrete
1 if x = y = 0
The impulse δ ( x, y ), δ ( x, y ) =
0 otherwise
∑∑
x =−∞ y =−∞
f ( x, y )δ ( x, y ) = f (0, 0)
and
∞ ∞
∑∑
x =−∞ y =−∞
f ( x, y )δ ( x − x0 , y − y0 ) = f ( x0 , y0 )
04-Dec-11 32
2-D Fourier Transform: Continuous
∞ ∞
F ( µ ,ν ) = ∫ ∫ f (t , z )e − j 2π ( µ t +ν z )
dtdz
−∞ −∞
and
∞ ∞
f (t , z ) = ∫ ∫ f ( µ ,ν )e j 2π ( µ t +ν z )
d µ dν
−∞ −∞
04-Dec-11 33
2-D Fourier Transform: Continuous
∞ ∞
F ( µ ,ν ) = ∫ ∫ f (t , z )e − j 2π ( µt +ν z ) dtdz
−∞ −∞
T /2 Z /2
=∫ ∫ Ae − j 2π ( µt +ν z ) dtdz
−T /2 − Z /2
sin(πµT ) sin(πν T )
= ATZ πν T
πµ T
04-Dec-11 34
2-D Sampling and 2-D Sampling Theorem
2 − D impulse train:
∞ ∞
s∆T ∆Z (t , z ) = ∑ ∑ δ (t − m∆T , z − n∆Z )
m =−∞ n =−∞
04-Dec-11 35
2-D Sampling and 2-D Sampling Theorem
04-Dec-11 37
Aliasing in Images: Example
In an image system, the
number of samples is fixed at
96x96 pixels. If we use this
system to digitize checkerboard
patterns …
Under-sampling
04-Dec-11 38
Aliasing in Images: Example
Re-sampling
04-Dec-11 39
Aliasing in Images: Example
Re-sampling
04-Dec-11 40
Moiré patterns
http://en.wikipedia.org/wiki/Moiré_pattern
04-Dec-11 41
Moiré patterns
04-Dec-11 42
Moiré patterns
04-Dec-11 43
Moiré patterns
A moiré pattern
formed by
incorrectly down-
sampling the
former image
04-Dec-11 44
2-D Discrete Fourier Transform and Its
Inverse
DFT:
M −1 N −1 − j 2π ( µ x / M +ν y / N )
F ( µ ,ν ) = ∑ ∑ f ( x, y )e
x =0 y =0
IDFT:
M −1 N −1 j 2π ( µ x / M +ν y / N )
1
f ( x, y ) =
MN
∑ ∑ F (µ ,ν )e
x =0 y =0
04-Dec-11 45
Properties of the 2-D DFT
relationships between spatial and frequency intervals
04-Dec-11 46
Properties of the 2-D DFT
translation and rotation
f ( x, y )e j 2π ( µ0 x / M +ν 0 y / N ) ⇔ F ( µ − µ0 ,ν −ν 0 )
and
− j 2π ( µ x0 / M +ν y0 / N )
f ( x - x0 , y - y0 ) ⇔ F ( µ ,ν )e
f ( x, y ) = f ( x + k1M , y ) = f ( x, y + k2 N ) = f ( x + k1M , y + k2 N )
f ( x ) e j 2π ( µ0 x / M ) ⇔ F ( µ − µ 0 )
µ0 = M / 2, f ( x)(−1) x ⇔ F ( µ − M / 2)
f ( x, y )(−1) x + y ⇔ F ( µ − M / 2,ν − N / 2)
04-Dec-11 48
Properties of the 2-D DFT
periodicity
04-Dec-11 49
Properties of the 2-D DFT
Symmetry
04-Dec-11 50
Properties of the 2-D DFT
Fourier Spectrum and Phase Angle
Power spectrum
P (u, v) =| F (u , v) |2 = R 2 (u , v) + I 2 (u , v)
Phase angle
I (u , v)
φ (u,v)=arctan
R (u , v )
04-Dec-11 51
04-Dec-11 52
04-Dec-11 53
Example: Phase Angles
04-Dec-11 54
Example: Phase Angles and The Reconstructed
04-Dec-11 55
2-D Convolution Theorem
1-D convolution
M −1
f ( x ) h( x ) = ∑ f ( m)h( x − m)
m =0
2-D convolution
M −1 N −1
f ( x, y ) h( x, y ) = ∑ ∑ f ( m, n ) h ( x − m, y − n )
m =0 n =0
Mirroring h
about the
origin
Translating
the mirrored
function by x
Computing the
sum for each
x
04-Dec-11 57
An Example of Convolution
It causes the
wraparoun
d error
It can be
solved by
appending
zeros
04-Dec-11 58
Zero Padding
P ≥A+B-1
04-Dec-11 59
Zero Padding
► Let f(x,y) and h(x,y) be two image arrays of sizes A×B and
C×D pixels, respectively. Wraparound error in their
convolution can be avoided by padding these functions
with zeros
f ( x, y ) 0 ≤ x ≤ A -1 and 0 ≤ y ≤ B -1
f p ( x, y ) =
0 A ≤ x ≤ P or B ≤ y ≤ Q
h ( x, y ) 0 ≤ x ≤ C -1 and 0 ≤ y ≤ D -1
h p ( x, y ) =
0 C ≤ x ≤ P or D ≤ y ≤ Q
Here P ≥ A + C − 1; Q ≥ B + D − 1
04-Dec-11 60
Summary
04-Dec-11 61
Summary
04-Dec-11 62
Summary
04-Dec-11 63
Summary
04-Dec-11 64
The Basic Filtering in the Frequency Domain
04-Dec-11 65
The Basic Filtering in the Frequency Domain
g ( x, y ) = ℑ−1{H (u , v) F (u , v)}
04-Dec-11 66
The Basic Filtering in the Frequency Domain
04-Dec-11 67
The Basic Filtering in the Frequency Domain
04-Dec-11 68
The Basic Filtering in the Frequency Domain
04-Dec-11 69
Zero-Phase-Shift Filters
−1
g ( x, y ) = ℑ {H (u, v) F (u, v)}
F (u , v) = R(u , v) + jI (u , v)
−1
g ( x, y ) = ℑ [ H (u, v) R(u, v) + jH (u, v) I (u, v)]
Filters affect the real and imaginary parts equally,
and thus no effect on the phase.
These filters are called zero-phase-shift filters
04-Dec-11 70
Examples: Nonzero-Phase-Shift Filters
Even small
Phasechanges
angle is in the phase angle can ishave
Phase angle
dramaticmultiplied
(usually by undesirable) effects on the
multiplied by filtered
output 0.5 0.5
04-Dec-11 71
Summary:
Steps for Filtering in the Frequency Domain
1. Given an input image f(x,y) of size MxN, obtain the
padding parameters P and Q. Typically, P = 2M and Q = 2N.
{ }
g p ( x, y ) = real ℑ−1 [G (u, v) ] (−1) x + y
04-Dec-11 73
An Example:
Steps for Filtering in the Frequency Domain
04-Dec-11 74
Correspondence Between Filtering in the
Spatial and Frequency Domains (1)
04-Dec-11 75
Correspondence Between Filtering in the
Spatial and Frequency Domains (2)
Let H (u ) denote the difference of Gaussian filter
- u 2 /2σ12 - u 2 /2σ 2 2
H (u ) = Ae − Be
with A ≥ B and σ 1 ≥ σ 2
04-Dec-11 76
Correspondence Between Filtering in the
Spatial and Frequency Domains (3)
04-Dec-11 77
Correspondence Between Filtering in the
Spatial and Frequency Domains: Example
600x600
04-Dec-11 78
Correspondence Between Filtering in the
Spatial and Frequency Domains: Example
04-Dec-11 79
Generate H(u,v)
h ( x, y ) 0 ≤ x ≤ 2 and 0 ≤ y ≤ 2
h p ( x, y ) =
0 3 ≤ x ≤ 602 or 3 ≤ y ≤ 602
04-Dec-11 80
Generate H(u,v)
04-Dec-11 81
Image Smoothing Using Filter Domain Filters:
ILPF
04-Dec-11 82
Image Smoothing Using Filter Domain Filters:
ILPF
04-Dec-11 83
ILPF Filtering Example
04-Dec-11 84
ILPF
Filtering
Example
04-Dec-11 85
The Spatial Representation of ILPF
04-Dec-11 86
Image Smoothing Using Filter Domain Filters:
BLPF
Butterworth Lowpass Filters (BLPF) of order n and
with cutoff frequency D0
1
H (u , v) =
1 + [ D(u, v) / D0 ]
2n
04-Dec-11 87
04-Dec-11 88
The Spatial Representation of BLPF
04-Dec-11 89
Image Smoothing Using Filter Domain Filters:
GLPF
By letting σ = D0
− D 2 ( u , v )/2 D02
H (u , v) = e
04-Dec-11 90
Image Smoothing Using Filter Domain Filters:
GLPF
04-Dec-11 91
04-Dec-11 92
Examples of smoothing by GLPF (1)
04-Dec-11 93
Examples of smoothing by GLPF (2)
04-Dec-11 94
Examples of smoothing by GLPF (3)
04-Dec-11 95
Image Sharpening Using Frequency Domain
Filters
H HP (u, v) = 1 − H LP (u, v)
04-Dec-11 96
Image Sharpening Using Frequency Domain
Filters
04-Dec-11 97
04-Dec-11 98
The Spatial Representation of Highpass
Filters
04-Dec-11 99
Filtering Results by IHPF
04-Dec-11 100
Filtering Results by BHPF
04-Dec-11 101
Filtering Results by GHPF
04-Dec-11 102
Using Highpass Filtering and Threshold for
Image Enhancement
BHPF
(order 4 with a cutoff
frequency 50)
04-Dec-11 103
The Laplacian in the Frequency Domain
H (u , v) = −4π 2 (u 2 + v 2 )
H (u , v) = −4π 2 (u − P / 2) 2 + (v − Q / 2) 2 )
= −4π 2 D 2 (u , v)
The Laplacian image
∇ 2 f ( x, y ) = ℑ−1 { H (u , v) F (u , v)}
Enhancement is obtained
g ( x, y ) = f ( x, y ) + c∇ 2 f ( x, y ) c = -1
04-Dec-11 104
The Laplacian in the Frequency Domain
{ }
= ℑ−1 1 + 4π 2 D 2 (u , v) F (u , v)
04-Dec-11 105
The Laplacian in the Frequency Domain
04-Dec-11 106
Unsharp Masking, Highboost Filtering and
High-Frequency-Emphasis Fitering
g mask ( x, y ) = f ( x, y ) − f LP ( x, y )
{ }
g ( x, y ) = ℑ−1 1 + k * [1 − H LP (u , v) ] F (u , v)
= ℑ−1 {[1 + k * H HP (u , v)] F (u , v)}
04-Dec-11 107
Unsharp Masking, Highboost Filtering and
High-Frequency-Emphasis Fitering
−1
g ( x, y ) = ℑ {[ k
1 + k2 * H HP (u, v)] F (u, v)}
k1 ≥ 0 and k2 ≥ 0
04-Dec-11 108
Gaussian Filter
D0=40
High-Frequency-Emphasis Filtering
Gaussian Filter
K1=0.5, k2=0.75
04-Dec-11 109
Homomorphic Filtering
f ( x, y ) = i ( x, y ) r ( x, y )
ℑ [ f ( x, y ) ] ≠
= ℑ [i ( x, y ) ] ℑ [ r ( x, y ) ] ?
z ( x, y ) = ln f ( x, y ) = ln i ( x, y ) + ln r ( x, y )
Z (u , v) = Fi (u, v) + Fr (u, v)
04-Dec-11 110
Homomorphic Filtering
S (u , v) = H (u , v) Z (u, v)
= H (u, v) Fi (u, v) + H (u , v) Fr (u, v)
s ( x, y ) = ℑ−1 {S (u, v)}
= ℑ−1 { H (u, v) Fi (u , v) + H (u, v) Fr (u , v)}
= ℑ−1 { H (u, v) Fi (u , v)} + ℑ−1 { H (u, v) Fr (u, v)}
= i '( x, y ) + r '( x, y )
04-Dec-11 111
Homomorphic Filtering
H (u , v) = (γ H − γ L ) 1 − e
− c D 2 ( u , v )/ D02
+γ
L
04-Dec-11 113
γ L = 0.25
Homomorphic
γH = 2
Filtering
c =1
D0 = 80
04-Dec-11 114
Homomorphic Filtering
04-Dec-11 115
Selective Filtering
Non-Selective Filters:
operate over the entire frequency rectangle
Selective Filters
operate over some part, not entire frequency rectangle
• bandreject or bandpass: process specific bands
• notch filters: process small regions of the frequency
rectangle
04-Dec-11 116
Selective Filtering:
Bandreject and Bandpass Filters
H BP (u, v) = 1 − H BR (u , v)
04-Dec-11 117
Selective Filtering:
Bandreject and Bandpass Filters
04-Dec-11 118
Selective Filtering:
Notch Filters
Zero-phase-shift filters must be symmetric about the origin.
A notch with center at (u0, v0) must have a corresponding
notch at location (-u0,-v0).
2 1/ 2
D− k (u, v) = (u − M / 2 + uk ) + (v − N / 2 + vk )
2
04-Dec-11 120
Examples:
Notch
Filters (1)
A Butterworth notch
reject filter D0 =3
and n=4 for all
notch pairs
04-Dec-11 121
Examples:
Notch Filters
(2)
04-Dec-11 122
04-Dec-11 123