FREQUENCY DOMAIN PROCESSING
FOURIER TRANSFORM
CS-467 Digital Image Processing
1
Frequency Domain
• Frequency domain is the domain for analysis
of signals with respect to frequency
• Time domain representation of a signal (in 1-D
case) and spatial domain (in 2-D case) shows
how the signal changes in time or space,
respectively
• Frequency domain representation shows how
much of the signal lies within each given
frequency band over a range of frequencies
2
Importance of Frequency Domain
• Frequency domain is very important in signal processing
• It shows which frequencies participate in the formation of a
signal and shows their contribution to this formation, as well
as the phase shift for each frequency
• It is very important to be able to design filters that eliminate
(correct) contribution of some certain frequencies to a
signal, passing other frequencies with no changes
• It is also very important to be able to restore a signal from
distortions caused by its convolution with a distorting
function (typical example – blur in image processing)
• It can also be used for solving image recognition problems,
for example, for “target recognition”
3
Frequency Domain Representation
• A mechanism, which is used to get the
frequency domain representation of a signal
defined in the time or spatial domain is the
Fourier transform
• The inverse Fourier transform is used to get
the time or spatial domain representation of a
signal from its frequency domain
representation
4
Jean Baptiste Joseph Fourier
(1768-1830)
• French mathematician and physicist
• Investigating how it is possible to compute
different functions representing them through
some well known functions, Fourier found (1807,
published in 1822) that any periodic function can
be represented as the sum of sines and/or
cosines of different frequencies (Fourier series)
• Non-periodic, but bounded functions, can be
represented as the integral of sines and/or
cosines multiplied by a weighting function
(Fourier transform)
5
Fourier Representation
6
© 1992-2008 R. C. Gonzalez & R.E. Woods
Orthogonal Functions
The continuous functions of a real variable
are called orthogonal on the interval , if
{ } { }0 1( ) ( ), ( ),...iu t u t u t=
( )0 0,t t T+
0
0
, if
( ) ( )
,0 if
t t
j k
t
j k
u u dt
k
c
t t
j
+
=
= 
≠
∫
If c=1 then then functions
are called orthonormal
{ } { }0 1( ) ( ), ( ),...ju t u t u t=
7
Orthogonal Vectors
A set of n-dimensional vectors
over the field of complex numbers is called orthogonal, if
( )
dot product
1 1
0
, if
, ...
, if
j k j k
j k n n
j k
U U u
c
u u u
j k
=
= + + = 
≠
If then is complex-conjugated to u
If c=1 then vectors
are called orthonormal
{ } { }1 0 1( ,..., ) , ( ),... ;j j j
j n sU u u U U t u= = ∈
{ } { }1 0 1( ,..., ) , ,... ;j j j
j n sU u u U U u= = ∈
u a bi= + u a bi= −
8
Signals and Functions
• Any signal can be treated as a function, which is defined
either on the temporal interval (for 1-D signals) or on the
space interval (for 2-D signals)
• For example, x(t) is a 1-D signal, which is defined on the
interval
• is a 2-D signal. Which is defined on the interval
( )0 0,t t T+
9
( ),f x y
( )0 0 0 0( , ),( , )x x N y y M+ +
Signals and Functions
• Any signal can be represented as the following orthogonal
series (can be broken down in the combination of
orthogonal functions)
• To find coefficients it is enough to multiply the last
equation by and to integrate it:
0
( ) ( )j j
j
x t a u t
∞
=
= ∑
ja
( )ku t
0 0
0 0
0
( ) ( )( ) ( )
t T t T
j jk k
jt t
x t dt a u t dt u t tu
+ + ∞
=
= ∑∫ ∫
10
Signals and Functions
• Taking into account that the functions
are orthogonal, we obtain
{ } { }0 1( ) ( ), ( ),...iu t u t u t=
0 0
0 0
0
0
0
,if
( ) ( )
1
(
( ) ( )
) ;( ) 0,1,2,...
t T t T
j j
jt t
c j k
t T
t
k k
k k
x t dt a u t dt
x t dt
u
a
t u t
u kt
c
+ + ∞
=
= =
+
= ⇒
⇒= =
∑∫ ∫
∫

11
Fourier Representation of Signals
• Let a set consists of functions
• Then
• where is called a main angular frequency, which
determines a period of
• If k is a frequency then is the angular frequency
{ } { }0 1( ) ( ), ( ),...ju t u t u t=
{ }0 01, cos , sin , 1,2,...j t j t jω ω =
0 0
0
0
1 1
( ) ( )
cos ( ) sin ( )
j j
j
j j
j j
x t a u t
a b j t c j tω ω
∞
=
∞ ∞
= =
= =
=+ +
∑
∑ ∑
0ω
02 /T π ω= 0 0cos , sinj t j tω ω
12
2 kω π=
Fourier Representation of Signals
• Taking into account that (i is an imaginary unit)
• then
13
( )
( )
0 0
0 0
0
0
1
cos
2
1
sin
2
ij t ij t
ij t ij t
j t e e
j t e e
i
ω ω
ω ω
ω
ω
−
−
= +
= −
0
0 0
2
( )
ij t
ij t T
j j
j j
x t d e d e
π
ω
∞ ∞
= =
= =∑ ∑
Fourier Representation of Signals
• Coefficients can be obtained fromja
14
0
0
( ) as follows:ik t
j
j
x t d e ω
∞
=
= ∑
0
/2
0
/2
2
( ) , = 2
T
ik t
j
T
d x t e dt k
T
ω π
ω π−
−
=∫
Fourier Transform
• Thus, the Fourier transform of x(t) is
• where
is the continuous angular frequency
• and is a frequency
21
( ) ( ) ( ) ( )i t i t
x x
k
F x t e dt F x t e dtk
T
πω
ω
∞ ∞
− −
−∞ −∞
= = =∫ ∫
15
( )
0
0 , 0,1,2,.2 ./ .2 /k k kT T k
ω
ω ω π π= ==

k
Inverse Fourier Transform
• The signal x(t) can be restored from its Fourier
transform by
16
( )xF ω
21 1
( ) ( ) ( )
2 2
i t i kt
x xx t F e d F j e duω π
ω ω
π π
∞ ∞
−∞ −∞
=∫ ∫
Discrete Fourier Transform
• If the discrete signal x(t) contains exactly N samples
(this means that x(t) has been obtained by sampling
of the continuous signal during N equal time
intervals), then its Discrete Fourier Transform is
1
2 /
0
1
( ) , 0,1,..., 1( )
N
i jk N
j
x x j ek NF k
N
π
−
−
=
= = −∑
17
Inverse Discrete Fourier Transform
• The signal x(t) can be restored from its
discrete Fourier spectrum as follows:
1
2 /
0
, 0,1,..., 1( ( ))
N
i kj
k
x
N
e j Nx kj F π
−
=
= = −∑
18
Discrete Fourier Transform
• Basic functions of the Discrete Fourier
Transform
form a complete system of the orthogonal functions,
which means that
where º is a component-wise multiplication of vectors
2 /
, 0,1,..., 1; 0,1,..., 1i jk N
kf e j N k Nπ
= = − = −
19
( )
{ } { }
dot product
, if
,
, if
, 0,1,..., 1 0,1,..., 1 :
0
s r k
s r
s r
f f
s r
s r N k
N
N f f f
=
= 
≠
=

∀ ∈ − ∃ ∈ − 

Power and Phase Spectrum
• The absolute values of the Fourier transform
coefficients of the discrete signal x(t) form a Power
Spectrum (or simply a spectrum, or magnitude)
• while the arguments of the of the Fourier transform
coefficients of the discrete signal x(t) form a Phase
Spectrum (phase shifts)
1
2 /
0
1
, 0,1,...,(( ) 1)
N
i jk N
j
x ex jF k N
N
k π
−
−
=
= = −∑
20
1
2 /
0
( )
1
, 0,1,...,( ) a ( 1g a g)r r
N
i jk N
x x
j
ek Nk
N
F kx j π
ϕ
−
−
=
= = = −∑
Power and Phase Spectrum
• The Fourier transform can be written also as
• If a signal is reconstructed from the Fourier
transform, then
• is the phase shift
21
( )
1
2 /
0
1
arg
a2 / r
0
)
)g
(
(
, 0,1,
( )
( ) ..., 1
( ) x
x
N
i i kj N
k
N
i
F k
x
F k
x
kj N
k
F k
F k
e e
e j N
x j π
π
−
=
−
+
=
=
= = −
∑
∑
(arg )
( , 0,1,...,) ) 1( xF k
x
i
xF k F ek k N= = −
arg ( )x
F k
Phase vs. Magnitude
• Oppenheim, A.V.; Lim, J.S., The importance of
phase in signals, IEEE Proceedings, v. 69, No 5,
1981, pp.: 529- 541
• In this paper, it was shown that the phase in the
Fourier spectrum of a signal is much more
informative than the magnitude: particularly in
the Fourier spectrum of images phase contains
the information about all shapes, edges,
orientation of all objects, etc.
Importance of Phase
• Phase contains the information about all the
edges, shapes, and their orientation
23
This image results from
the inverse Fourier
transform applied to the
spectrum synthesized
from the original phases,
but with magnitudes
replaced by the constant
“1”
Image Recognition:
Features Selection
• Thus the Fourier Phase Spectrum can be a
very good source of the objective features
that describe all objects represented by the
corresponding signals.
• The Power Spectrum (magnitude) describes
some global signal properties (for, example
blur, noise, cleanness, contrast, brightness,
etc. for images).
24
Phase
Phase
Magnitude
Importance of Phase
Phase and Magnitude
26
Phase (a) & Magnitude (b) Phase (b) & Magnitude (a)
Magnitude contains the information about the signal’s properties
(a) (b)
Proper treatment of phase
• If phases are treated as
some abstract real
numbers, we may treat
phases such as
and
as much different values.
This would be incorrect
because in fact they are
very close to each other
27
0.001ϕ =
2 0.001 6.282ψ π= − =
A role of phase and magnitude in the
Fourier transform
28
sin1 ; 1; 0t A ϕ⋅ = = 2sin1 ; 2; 0t A ϕ⋅ = =
sin1 2; 1; 2t A ϕ⋅ + = = 2sin1 2; 2; 2t A ϕ⋅ + = =
Convolution
• Convolution of two continuous functions f(t) and
h(t) is a process of flipping (rotating by 1800) one
function about its origin and sliding it past the
other
where stands for the flipping, t is the
displacement needed to slide one function past
the other, is a dummy variable that is
integrated out
29
( ) ( ) ( ) ( ) ( )g t f t h t f h t dτ τ τ
∞
−∞
= ∗ = ÷∫
÷
τ
Discrete Convolution
• Convolution of two discrete functions f(t) and h(t)
is also a process of flipping (rotating by 1800) one
function about its origin and sliding it past the
other
where stands for the flipping (shift
corresponding to the basis, where the
convolution is taken, for the Fourier basis this is
the circular shift), t is the displacement needed to
slide one function past the other
30
1
0
( ) ( ) ( ) ( ) ( ); 0,1,..., 1
N
k
g t f t h t f k h t k t N
−
=
= ∗ = ÷ = −∑
÷ ( )modt k N+
Circular Shift
31
A B C D E F G
E F G A B C D
Circular shift by 3:
( )f t
( 3)f t ÷
Convolution Theorem
• Theorem. Fourier transform of the
convolution of signals x(t) and y(t) equals the
product of the Fourier transforms of these
signals
• Corollary. The convolution of signals x(t) and
y(t) equals the inverse Fourier transform of
the product of their Fourier transforms
32
( ) ( ) ( ); 0,1,..., 1x y x yF k F k F k k N∗ = ⋅ = −
( )1
( ) ( ) ( ) ; 0,1,..., 1x yF Fg j x j y j F j j N−
⋅= ∗ = = −
2-D Continuous Fourier Transform
• Continuous Fourier transform of the function
of two continuous variables
• Continuous inverse 2-D Fourier transform
33
( , )g x y
2 ( )
( , ) ( , ) i xu yv
gF u v g x y e dxdyπ
∞ ∞
− +
−∞ −∞
= ∫ ∫
2 ( )
( , ) ( , ) i xu yv
gg x y F u v e dudvπ
∞ ∞
+
−∞ −∞
= ∫ ∫
2-D Discrete Fourier Transform
• Discrete Fourier transform of the digital image
of size MxN
• Discrete inverse 2-D Fourier transform
34
( , )g x y
1 1 2
0 0
1
( , ) ( , )
ux vyM N i
M N
g
x y
F u v g x y e
MN
π
 − − − + 
 
= =
= ∑∑
1 1 2
0 0
( , ) ( , )
ux vyM N i
M N
g
u v
g x y F u v e
π
 − − + 
 
= =
= ∑∑
Calculation of the
2-D Discrete Fourier Transform
• Since , the 2-D
DFT can be separated – it can be found first
with respect to one dimension (for rows) and
then with respect to another one (for
columns):
35
2 22
ux vy vyuxi ii
M N NM
e e e
π ππ
 
− + −− 
 
= ⋅
1 1 1 12 2 2
0 0 0 0
1 1 1
( , ) ( , ) ( , )
ux vy vy uxM N M Ni i i
M N N M
g
x y x y
F u v g x y e g x y e e
MN M N
π π π
 − − − −− + − − 
 
= = = =
 
=  
 
∑∑ ∑ ∑
Calculation of the
2-D Discrete Fourier Transform
• In practical implementation, 2-D DFT of a digital
image should be calculated as follows:
1) Fourier transform of the rows should be taken,
row by row and the results should be stored in a
matrix (2-D array)
2) This matrix should be transposed
3) Then Fourier transform of the rows of this
transposed matrix should be taken and the
results should be stored in a matrix (2-D array),
which contains the 2-D Fourier transform of the
initial image
36
Calculation of the
2-D Discrete Fourier Transform
• Since the Fast Fourier Transform algorithm
exists only for the dimensions that equal to
some powers of two, an image whose sizes
are not powers of two, should be extended to
the next closest power of two
• This extension should be done better by
mirroring in all directions rather than by zero-
padding, to avoid “boundary effects”
37
Important Properties of 2-D
Discrete Fourier Transform
38
© 1992-2008 R. C. Gonzalez & R.E. Woods
Discrete Cosine Transform (DCT)
• Discrete Cosine Transform of signals x(t) is a
shifted Fourier transform determined by
• The signal x(t) can be restored from its
discrete Cosine spectrum as follows:
39
1
0
1 1
( )cos , 0,1,...,(
2
) 1
N
x
j
x j j k k
N
C k N
N
π−
=
  
= + = −  
  
∑
1
1
1 1
cos , 0,1,..., 1
2
) () 0( )
2
(x x
N
k
j k j N
N
x j C C k
π−
=
  
= + = −  
  
∑
Discrete Cosine Transform (DCT)
• Discrete Cosine Transform, being a shifted Fourier
transform, expresses a finite sequence of data
points in terms of a sum of cosine functions
oscillating at different frequencies
• DCT is equivalent to DFT of roughly twice the
length, operating on real data with even
symmetry (since the Fourier transform of a real
and even function is real and even), where the
input and/or output data are shifted by half a
sample.
40
Discrete Cosine Transform (DCT)
• Discrete Cosine Transform, being a real-valued,
but holding basically the same properties as
Discrete Fourier Transform is used in many
applications, particularly in lossy data
compression (jpeg for image data compression
and mp3 for audio data compression)
• Lossy frequency domain compression is based on
the possibility of neglidging or less accurate
encoding of the spectral coefficients in the high
frequency area
41
2D Discrete Cosine Transform
• 2D DCT is a separable transform (as a 2D DFT) and should be
calculated in the same way
• 8x8 DCT of an image fragment with respect to 2D frequencies
(8x8 DCT is used in jpeg compression)
42
Sampling
43
© 1992-2008 R .C. Gonzalez & R.E. Woods
Sampling
44
© 1992-2008 R .C. Gonzalez & R.E. Woods
[ ]max max,µ µ− - The frequency range of
a band-limited signal
max
1
2
t
µ=
∆
- The Nyquist rate
To recover a signal from its
sampled representation, the
sampling rate must exceed the
Nyquist rate:
max
1
2
t
µ>
∆
Sampling
45
Oversampling
Critically sampling
Undersampling
© 1992-2008 R .C. Gonzalez & R.E. Woods
Sampling – Reconstruction from the
Oversampled Discrete Signal
46
© 1992-2008 R .C. Gonzalez & R.E. Woods
Aliasing
• Aliasing (frequency aliasing) is a process in
which high frequency components of a
continuous function “masquerade” as lower
frequencies in the sampled function (“alias”
means a false identity)
• Spatial aliasing is due to undersampling
• Temporal aliasing is related to time intervals
between sequence of images (e.g. rotation of
wheels backwards in a movie, etc.)
47
Undersampling
48
© 1992-2008 R .C. Gonzalez & R.E. Woods
Undersampling and Aliasing
49
© 1992-2008 R .C. Gonzalez & R.E. Woods
Sampling – Reconstruction from
the Undersampled Discrete Signal
50
© 1992-2008 R .C. Gonzalez & R.E. Woods
 Lowering the sampling
rate below the Nyquist rate
leads to impossibility to
isolate a single period of
the Fourier transform

Lecture 9

  • 1.
    FREQUENCY DOMAIN PROCESSING FOURIERTRANSFORM CS-467 Digital Image Processing 1
  • 2.
    Frequency Domain • Frequencydomain is the domain for analysis of signals with respect to frequency • Time domain representation of a signal (in 1-D case) and spatial domain (in 2-D case) shows how the signal changes in time or space, respectively • Frequency domain representation shows how much of the signal lies within each given frequency band over a range of frequencies 2
  • 3.
    Importance of FrequencyDomain • Frequency domain is very important in signal processing • It shows which frequencies participate in the formation of a signal and shows their contribution to this formation, as well as the phase shift for each frequency • It is very important to be able to design filters that eliminate (correct) contribution of some certain frequencies to a signal, passing other frequencies with no changes • It is also very important to be able to restore a signal from distortions caused by its convolution with a distorting function (typical example – blur in image processing) • It can also be used for solving image recognition problems, for example, for “target recognition” 3
  • 4.
    Frequency Domain Representation •A mechanism, which is used to get the frequency domain representation of a signal defined in the time or spatial domain is the Fourier transform • The inverse Fourier transform is used to get the time or spatial domain representation of a signal from its frequency domain representation 4
  • 5.
    Jean Baptiste JosephFourier (1768-1830) • French mathematician and physicist • Investigating how it is possible to compute different functions representing them through some well known functions, Fourier found (1807, published in 1822) that any periodic function can be represented as the sum of sines and/or cosines of different frequencies (Fourier series) • Non-periodic, but bounded functions, can be represented as the integral of sines and/or cosines multiplied by a weighting function (Fourier transform) 5
  • 6.
    Fourier Representation 6 © 1992-2008R. C. Gonzalez & R.E. Woods
  • 7.
    Orthogonal Functions The continuousfunctions of a real variable are called orthogonal on the interval , if { } { }0 1( ) ( ), ( ),...iu t u t u t= ( )0 0,t t T+ 0 0 , if ( ) ( ) ,0 if t t j k t j k u u dt k c t t j + = =  ≠ ∫ If c=1 then then functions are called orthonormal { } { }0 1( ) ( ), ( ),...ju t u t u t= 7
  • 8.
    Orthogonal Vectors A setof n-dimensional vectors over the field of complex numbers is called orthogonal, if ( ) dot product 1 1 0 , if , ... , if j k j k j k n n j k U U u c u u u j k = = + + =  ≠ If then is complex-conjugated to u If c=1 then vectors are called orthonormal { } { }1 0 1( ,..., ) , ( ),... ;j j j j n sU u u U U t u= = ∈ { } { }1 0 1( ,..., ) , ,... ;j j j j n sU u u U U u= = ∈ u a bi= + u a bi= − 8
  • 9.
    Signals and Functions •Any signal can be treated as a function, which is defined either on the temporal interval (for 1-D signals) or on the space interval (for 2-D signals) • For example, x(t) is a 1-D signal, which is defined on the interval • is a 2-D signal. Which is defined on the interval ( )0 0,t t T+ 9 ( ),f x y ( )0 0 0 0( , ),( , )x x N y y M+ +
  • 10.
    Signals and Functions •Any signal can be represented as the following orthogonal series (can be broken down in the combination of orthogonal functions) • To find coefficients it is enough to multiply the last equation by and to integrate it: 0 ( ) ( )j j j x t a u t ∞ = = ∑ ja ( )ku t 0 0 0 0 0 ( ) ( )( ) ( ) t T t T j jk k jt t x t dt a u t dt u t tu + + ∞ = = ∑∫ ∫ 10
  • 11.
    Signals and Functions •Taking into account that the functions are orthogonal, we obtain { } { }0 1( ) ( ), ( ),...iu t u t u t= 0 0 0 0 0 0 0 ,if ( ) ( ) 1 ( ( ) ( ) ) ;( ) 0,1,2,... t T t T j j jt t c j k t T t k k k k x t dt a u t dt x t dt u a t u t u kt c + + ∞ = = = + = ⇒ ⇒= = ∑∫ ∫ ∫  11
  • 12.
    Fourier Representation ofSignals • Let a set consists of functions • Then • where is called a main angular frequency, which determines a period of • If k is a frequency then is the angular frequency { } { }0 1( ) ( ), ( ),...ju t u t u t= { }0 01, cos , sin , 1,2,...j t j t jω ω = 0 0 0 0 1 1 ( ) ( ) cos ( ) sin ( ) j j j j j j j x t a u t a b j t c j tω ω ∞ = ∞ ∞ = = = = =+ + ∑ ∑ ∑ 0ω 02 /T π ω= 0 0cos , sinj t j tω ω 12 2 kω π=
  • 13.
    Fourier Representation ofSignals • Taking into account that (i is an imaginary unit) • then 13 ( ) ( ) 0 0 0 0 0 0 1 cos 2 1 sin 2 ij t ij t ij t ij t j t e e j t e e i ω ω ω ω ω ω − − = + = − 0 0 0 2 ( ) ij t ij t T j j j j x t d e d e π ω ∞ ∞ = = = =∑ ∑
  • 14.
    Fourier Representation ofSignals • Coefficients can be obtained fromja 14 0 0 ( ) as follows:ik t j j x t d e ω ∞ = = ∑ 0 /2 0 /2 2 ( ) , = 2 T ik t j T d x t e dt k T ω π ω π− − =∫
  • 15.
    Fourier Transform • Thus,the Fourier transform of x(t) is • where is the continuous angular frequency • and is a frequency 21 ( ) ( ) ( ) ( )i t i t x x k F x t e dt F x t e dtk T πω ω ∞ ∞ − − −∞ −∞ = = =∫ ∫ 15 ( ) 0 0 , 0,1,2,.2 ./ .2 /k k kT T k ω ω ω π π= ==  k
  • 16.
    Inverse Fourier Transform •The signal x(t) can be restored from its Fourier transform by 16 ( )xF ω 21 1 ( ) ( ) ( ) 2 2 i t i kt x xx t F e d F j e duω π ω ω π π ∞ ∞ −∞ −∞ =∫ ∫
  • 17.
    Discrete Fourier Transform •If the discrete signal x(t) contains exactly N samples (this means that x(t) has been obtained by sampling of the continuous signal during N equal time intervals), then its Discrete Fourier Transform is 1 2 / 0 1 ( ) , 0,1,..., 1( ) N i jk N j x x j ek NF k N π − − = = = −∑ 17
  • 18.
    Inverse Discrete FourierTransform • The signal x(t) can be restored from its discrete Fourier spectrum as follows: 1 2 / 0 , 0,1,..., 1( ( )) N i kj k x N e j Nx kj F π − = = = −∑ 18
  • 19.
    Discrete Fourier Transform •Basic functions of the Discrete Fourier Transform form a complete system of the orthogonal functions, which means that where º is a component-wise multiplication of vectors 2 / , 0,1,..., 1; 0,1,..., 1i jk N kf e j N k Nπ = = − = − 19 ( ) { } { } dot product , if , , if , 0,1,..., 1 0,1,..., 1 : 0 s r k s r s r f f s r s r N k N N f f f = =  ≠ =  ∀ ∈ − ∃ ∈ −  
  • 20.
    Power and PhaseSpectrum • The absolute values of the Fourier transform coefficients of the discrete signal x(t) form a Power Spectrum (or simply a spectrum, or magnitude) • while the arguments of the of the Fourier transform coefficients of the discrete signal x(t) form a Phase Spectrum (phase shifts) 1 2 / 0 1 , 0,1,...,(( ) 1) N i jk N j x ex jF k N N k π − − = = = −∑ 20 1 2 / 0 ( ) 1 , 0,1,...,( ) a ( 1g a g)r r N i jk N x x j ek Nk N F kx j π ϕ − − = = = = −∑
  • 21.
    Power and PhaseSpectrum • The Fourier transform can be written also as • If a signal is reconstructed from the Fourier transform, then • is the phase shift 21 ( ) 1 2 / 0 1 arg a2 / r 0 ) )g ( ( , 0,1, ( ) ( ) ..., 1 ( ) x x N i i kj N k N i F k x F k x kj N k F k F k e e e j N x j π π − = − + = = = = − ∑ ∑ (arg ) ( , 0,1,...,) ) 1( xF k x i xF k F ek k N= = − arg ( )x F k
  • 22.
    Phase vs. Magnitude •Oppenheim, A.V.; Lim, J.S., The importance of phase in signals, IEEE Proceedings, v. 69, No 5, 1981, pp.: 529- 541 • In this paper, it was shown that the phase in the Fourier spectrum of a signal is much more informative than the magnitude: particularly in the Fourier spectrum of images phase contains the information about all shapes, edges, orientation of all objects, etc.
  • 23.
    Importance of Phase •Phase contains the information about all the edges, shapes, and their orientation 23 This image results from the inverse Fourier transform applied to the spectrum synthesized from the original phases, but with magnitudes replaced by the constant “1”
  • 24.
    Image Recognition: Features Selection •Thus the Fourier Phase Spectrum can be a very good source of the objective features that describe all objects represented by the corresponding signals. • The Power Spectrum (magnitude) describes some global signal properties (for, example blur, noise, cleanness, contrast, brightness, etc. for images). 24
  • 25.
  • 26.
    Phase and Magnitude 26 Phase(a) & Magnitude (b) Phase (b) & Magnitude (a) Magnitude contains the information about the signal’s properties (a) (b)
  • 27.
    Proper treatment ofphase • If phases are treated as some abstract real numbers, we may treat phases such as and as much different values. This would be incorrect because in fact they are very close to each other 27 0.001ϕ = 2 0.001 6.282ψ π= − =
  • 28.
    A role ofphase and magnitude in the Fourier transform 28 sin1 ; 1; 0t A ϕ⋅ = = 2sin1 ; 2; 0t A ϕ⋅ = = sin1 2; 1; 2t A ϕ⋅ + = = 2sin1 2; 2; 2t A ϕ⋅ + = =
  • 29.
    Convolution • Convolution oftwo continuous functions f(t) and h(t) is a process of flipping (rotating by 1800) one function about its origin and sliding it past the other where stands for the flipping, t is the displacement needed to slide one function past the other, is a dummy variable that is integrated out 29 ( ) ( ) ( ) ( ) ( )g t f t h t f h t dτ τ τ ∞ −∞ = ∗ = ÷∫ ÷ τ
  • 30.
    Discrete Convolution • Convolutionof two discrete functions f(t) and h(t) is also a process of flipping (rotating by 1800) one function about its origin and sliding it past the other where stands for the flipping (shift corresponding to the basis, where the convolution is taken, for the Fourier basis this is the circular shift), t is the displacement needed to slide one function past the other 30 1 0 ( ) ( ) ( ) ( ) ( ); 0,1,..., 1 N k g t f t h t f k h t k t N − = = ∗ = ÷ = −∑ ÷ ( )modt k N+
  • 31.
    Circular Shift 31 A BC D E F G E F G A B C D Circular shift by 3: ( )f t ( 3)f t ÷
  • 32.
    Convolution Theorem • Theorem.Fourier transform of the convolution of signals x(t) and y(t) equals the product of the Fourier transforms of these signals • Corollary. The convolution of signals x(t) and y(t) equals the inverse Fourier transform of the product of their Fourier transforms 32 ( ) ( ) ( ); 0,1,..., 1x y x yF k F k F k k N∗ = ⋅ = − ( )1 ( ) ( ) ( ) ; 0,1,..., 1x yF Fg j x j y j F j j N− ⋅= ∗ = = −
  • 33.
    2-D Continuous FourierTransform • Continuous Fourier transform of the function of two continuous variables • Continuous inverse 2-D Fourier transform 33 ( , )g x y 2 ( ) ( , ) ( , ) i xu yv gF u v g x y e dxdyπ ∞ ∞ − + −∞ −∞ = ∫ ∫ 2 ( ) ( , ) ( , ) i xu yv gg x y F u v e dudvπ ∞ ∞ + −∞ −∞ = ∫ ∫
  • 34.
    2-D Discrete FourierTransform • Discrete Fourier transform of the digital image of size MxN • Discrete inverse 2-D Fourier transform 34 ( , )g x y 1 1 2 0 0 1 ( , ) ( , ) ux vyM N i M N g x y F u v g x y e MN π  − − − +    = = = ∑∑ 1 1 2 0 0 ( , ) ( , ) ux vyM N i M N g u v g x y F u v e π  − − +    = = = ∑∑
  • 35.
    Calculation of the 2-DDiscrete Fourier Transform • Since , the 2-D DFT can be separated – it can be found first with respect to one dimension (for rows) and then with respect to another one (for columns): 35 2 22 ux vy vyuxi ii M N NM e e e π ππ   − + −−    = ⋅ 1 1 1 12 2 2 0 0 0 0 1 1 1 ( , ) ( , ) ( , ) ux vy vy uxM N M Ni i i M N N M g x y x y F u v g x y e g x y e e MN M N π π π  − − − −− + − −    = = = =   =     ∑∑ ∑ ∑
  • 36.
    Calculation of the 2-DDiscrete Fourier Transform • In practical implementation, 2-D DFT of a digital image should be calculated as follows: 1) Fourier transform of the rows should be taken, row by row and the results should be stored in a matrix (2-D array) 2) This matrix should be transposed 3) Then Fourier transform of the rows of this transposed matrix should be taken and the results should be stored in a matrix (2-D array), which contains the 2-D Fourier transform of the initial image 36
  • 37.
    Calculation of the 2-DDiscrete Fourier Transform • Since the Fast Fourier Transform algorithm exists only for the dimensions that equal to some powers of two, an image whose sizes are not powers of two, should be extended to the next closest power of two • This extension should be done better by mirroring in all directions rather than by zero- padding, to avoid “boundary effects” 37
  • 38.
    Important Properties of2-D Discrete Fourier Transform 38 © 1992-2008 R. C. Gonzalez & R.E. Woods
  • 39.
    Discrete Cosine Transform(DCT) • Discrete Cosine Transform of signals x(t) is a shifted Fourier transform determined by • The signal x(t) can be restored from its discrete Cosine spectrum as follows: 39 1 0 1 1 ( )cos , 0,1,...,( 2 ) 1 N x j x j j k k N C k N N π− =    = + = −      ∑ 1 1 1 1 cos , 0,1,..., 1 2 ) () 0( ) 2 (x x N k j k j N N x j C C k π− =    = + = −      ∑
  • 40.
    Discrete Cosine Transform(DCT) • Discrete Cosine Transform, being a shifted Fourier transform, expresses a finite sequence of data points in terms of a sum of cosine functions oscillating at different frequencies • DCT is equivalent to DFT of roughly twice the length, operating on real data with even symmetry (since the Fourier transform of a real and even function is real and even), where the input and/or output data are shifted by half a sample. 40
  • 41.
    Discrete Cosine Transform(DCT) • Discrete Cosine Transform, being a real-valued, but holding basically the same properties as Discrete Fourier Transform is used in many applications, particularly in lossy data compression (jpeg for image data compression and mp3 for audio data compression) • Lossy frequency domain compression is based on the possibility of neglidging or less accurate encoding of the spectral coefficients in the high frequency area 41
  • 42.
    2D Discrete CosineTransform • 2D DCT is a separable transform (as a 2D DFT) and should be calculated in the same way • 8x8 DCT of an image fragment with respect to 2D frequencies (8x8 DCT is used in jpeg compression) 42
  • 43.
    Sampling 43 © 1992-2008 R.C. Gonzalez & R.E. Woods
  • 44.
    Sampling 44 © 1992-2008 R.C. Gonzalez & R.E. Woods [ ]max max,µ µ− - The frequency range of a band-limited signal max 1 2 t µ= ∆ - The Nyquist rate To recover a signal from its sampled representation, the sampling rate must exceed the Nyquist rate: max 1 2 t µ> ∆
  • 45.
  • 46.
    Sampling – Reconstructionfrom the Oversampled Discrete Signal 46 © 1992-2008 R .C. Gonzalez & R.E. Woods
  • 47.
    Aliasing • Aliasing (frequencyaliasing) is a process in which high frequency components of a continuous function “masquerade” as lower frequencies in the sampled function (“alias” means a false identity) • Spatial aliasing is due to undersampling • Temporal aliasing is related to time intervals between sequence of images (e.g. rotation of wheels backwards in a movie, etc.) 47
  • 48.
    Undersampling 48 © 1992-2008 R.C. Gonzalez & R.E. Woods
  • 49.
    Undersampling and Aliasing 49 ©1992-2008 R .C. Gonzalez & R.E. Woods
  • 50.
    Sampling – Reconstructionfrom the Undersampled Discrete Signal 50 © 1992-2008 R .C. Gonzalez & R.E. Woods  Lowering the sampling rate below the Nyquist rate leads to impossibility to isolate a single period of the Fourier transform