SlideShare a Scribd company logo
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

More Related Content

PPTX
Digital Image Processing Unit -2 Notes complete
PPTX
Chap6 image restoration
PPT
Discrete cosine transform
PDF
03 image transform
PPTX
Digital Image Fundamentals - II
PDF
Image segmentation
PDF
Digital Image Processing - Image Enhancement
PPT
6 spatial filtering p2
Digital Image Processing Unit -2 Notes complete
Chap6 image restoration
Discrete cosine transform
03 image transform
Digital Image Fundamentals - II
Image segmentation
Digital Image Processing - Image Enhancement
6 spatial filtering p2

What's hot (20)

PPTX
Color image processing Presentation
PPTX
Simultaneous Smoothing and Sharpening of Color Images
PDF
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
PPTX
EDGE DETECTION USING SOBEL OPERATOR.pptx
PPT
Image Formation
PPTX
PPTX
Color Models.pptx
PPTX
Application of edge detection
PPTX
Psuedo color
PPTX
Image transforms
PPTX
Image segmentation
PPTX
Linear Image Processing
PPTX
Introduction to Image Compression
PPTX
Color models
PPTX
Halftoning in Computer Graphics
PPTX
Basic Relationships between Pixels- Digital Image Processing
PPT
lec z-transform.ppt
PPT
Lzw coding technique for image compression
Color image processing Presentation
Simultaneous Smoothing and Sharpening of Color Images
UNIT-6-Illumination-Models-and-Surface-Rendering-Methods.pdf
EDGE DETECTION USING SOBEL OPERATOR.pptx
Image Formation
Color Models.pptx
Application of edge detection
Psuedo color
Image transforms
Image segmentation
Linear Image Processing
Introduction to Image Compression
Color models
Halftoning in Computer Graphics
Basic Relationships between Pixels- Digital Image Processing
lec z-transform.ppt
Lzw coding technique for image compression
Ad

Similar to Lecture 9 (20)

PDF
3.Frequency Domain Representation of Signals and Systems
PPT
Lecturer 03. Digital imaging probability
PPTX
Fourier Transform
PDF
Fourier slide
PDF
Analog Communication Chap 3-pages-2-41.pdf
PDF
Frequency Domain Filtering of Digital Images
PPT
signals and system
PPTX
Lecture Notes: EEEC6440315 Communication Systems - Time Frequency Analysis -...
PPT
lec-4.ppt
PPT
lec-4.ppt
PPT
lec-4.ppt
PPT
Fourier image
PPT
lec-4.ppt COMPUTER VISIONS FOR ENGINEERING
PPT
Nt lecture skm-iiit-bh
PDF
Signals and Systems Ch 4 5_Fourier Domain
PDF
Chapter 3
PDF
Fourier Transform ppt and material for mathematics subject
PPT
communication system Chapter 3
PPT
3. convolution fourier
PDF
Nss fourier
3.Frequency Domain Representation of Signals and Systems
Lecturer 03. Digital imaging probability
Fourier Transform
Fourier slide
Analog Communication Chap 3-pages-2-41.pdf
Frequency Domain Filtering of Digital Images
signals and system
Lecture Notes: EEEC6440315 Communication Systems - Time Frequency Analysis -...
lec-4.ppt
lec-4.ppt
lec-4.ppt
Fourier image
lec-4.ppt COMPUTER VISIONS FOR ENGINEERING
Nt lecture skm-iiit-bh
Signals and Systems Ch 4 5_Fourier Domain
Chapter 3
Fourier Transform ppt and material for mathematics subject
communication system Chapter 3
3. convolution fourier
Nss fourier
Ad

More from Wael Sharba (20)

PDF
Project 8
PDF
Project 7
PDF
Project 6
PDF
Project 5
PDF
Project 4
PDF
Project 2
PDF
Project 1
PDF
Project 3
PDF
Project 9
PDF
Lecture 14
PDF
Lecture 13
PDF
Lecture 11
PDF
Lecture 12
PDF
Lecture 10
PDF
Lecture 8
PDF
Lecture 7
PDF
Lecture 6
PDF
Lecture 5
PDF
Lecture 4
PDF
Lecture 3
Project 8
Project 7
Project 6
Project 5
Project 4
Project 2
Project 1
Project 3
Project 9
Lecture 14
Lecture 13
Lecture 11
Lecture 12
Lecture 10
Lecture 8
Lecture 7
Lecture 6
Lecture 5
Lecture 4
Lecture 3

Recently uploaded (20)

PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Introduction to pro and eukaryotes and differences.pptx
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
20th Century Theater, Methods, History.pptx
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
1_English_Language_Set_2.pdf probationary
PDF
Indian roads congress 037 - 2012 Flexible pavement
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Share_Module_2_Power_conflict_and_negotiation.pptx
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Introduction to pro and eukaryotes and differences.pptx
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
AI-driven educational solutions for real-life interventions in the Philippine...
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
B.Sc. DS Unit 2 Software Engineering.pptx
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
20th Century Theater, Methods, History.pptx
TNA_Presentation-1-Final(SAVE)) (1).pptx
1_English_Language_Set_2.pdf probationary
Indian roads congress 037 - 2012 Flexible pavement
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Paper A Mock Exam 9_ Attempt review.pdf.
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
احياء السادس العلمي - الفصل الثالث (التكاثر) منهج متميزين/كلية بغداد/موهوبين
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...

Lecture 9

  • 1. FREQUENCY DOMAIN PROCESSING FOURIER TRANSFORM CS-467 Digital Image Processing 1
  • 2. 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
  • 3. 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
  • 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 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
  • 6. Fourier Representation 6 © 1992-2008 R. C. Gonzalez & R.E. Woods
  • 7. 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
  • 8. 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
  • 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 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ω π=
  • 13. 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 π ω ∞ ∞ = = = =∑ ∑
  • 14. 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 ω π ω π− − =∫
  • 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 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
  • 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 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 π ϕ − − = = = = −∑
  • 21. 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
  • 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
  • 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 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ψ π= − =
  • 28. 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 ϕ⋅ + = =
  • 29. 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τ τ τ ∞ −∞ = ∗ = ÷∫ ÷ τ
  • 30. 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+
  • 31. 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 ÷
  • 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 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π ∞ ∞ + −∞ −∞ = ∫ ∫
  • 34. 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 π  − − +    = = = ∑∑
  • 35. 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 π π π  − − − −− + − −    = = = =   =     ∑∑ ∑ ∑
  • 36. 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
  • 37. 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
  • 38. Important Properties of 2-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 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
  • 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 µ> ∆
  • 46. Sampling – Reconstruction from the Oversampled Discrete Signal 46 © 1992-2008 R .C. Gonzalez & R.E. Woods
  • 47. 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
  • 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 – 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