Fourier Transform: 1 D and 2 D
Fourier Transform: 1 D and 2 D
Fourier Transform: 1 D and 2 D
Transform
1‐D and 2‐D
Introduction
Image processing methods can be
broadly divided into two categories:
–Spatial domain (Real space) methods
–Frequency domain (Fourier space)
methods
Introduction
Spatial domain (Real space) methods
– work by directly processing input pixel array
Frequency domain (Fourier space)
methods
– first perform Fourier transform of the input data
to get a new representation
– new data is then processed, and finally
– inverse Fourier transform is performed on the
resulting data to give the final output image
Fourier Series Theorem
Any periodic function can be expressed as a
weighted sum (infinite) of sine and cosine
functions of varying frequency:
where
f0 is called the “fundamental frequency”
and
Fourier Series
One of the Fundamental Secrets of the Universe
All waveforms, no matter what you scribble or observe in the
universe, are actually just the sum of simple sinusoids of
different frequencies.
What is a Fourier Transform?
It is a tool that breaks a waveform (a function or
signal) into an alternate representation
It represents a real valued function with the help
of sine and cosine functions
Inverse Fourier Transform:
– Tool which turns a Fourier space description of an
image back into real space
– Frequency domain Spatial domain
Significance of Frequency
What is the significance of frequencies in an
image?
– High frequency
– Low frequency
Significance of Frequency
High Frequency:
– If an image has large values at high frequency
components then it means the data is changing
rapidly on a short distance scale
– e.g., a page of text
Pixel
Intensity, I
Text image: data changes rapidly Column index, x
Significance of Frequency
Low Frequency
– If the image has large low frequency components
then it means the large scale features of the
picture are more prominent
– e.g. a single fairly simple object which occupies
most of the image
Pixel
Intensity, I
Text image: data changes are slow Column index, x
Fourier Transform: 1‐D Case
1‐D Case:
– Considering a continuous function f(x) of a single
variable x representing distance
– The Fourier transform of that function, denoted
by F(u) where u represents spatial frequency, is
defined by:
Fourier Transform: 1‐D Case
Important point to note
– in general F(u) will be a complex quantity even
though the original data is purely real
Meaning of Complex Quantity:
– The meaning of this is that, not only is the
magnitude of each frequency present important,
but that its phase relationship is too
Fourier Transform: 1‐D Case
Inverse Fourier Transform
– The inverse Fourier transform for obtaining
f(x) from F(u) is given by:
This is quite similar to Fourier transform except that
the exponential term has the opposite sign
Fourier Transform: 1‐D Case
Example 1:
– Let's take an example to see how to compute
Fourier Transform.
– Consider function f(x) defined as below for Fourier
transform computation
Fourier Transform: 1‐D Case
In this case F(u) is purely real, which is a consequence
of the original data being symmetric in x
Sinc function
– This function is often referred to as the Sinc function
Fourier Transform: 1‐D Case
Example 2:
– f(x) definition: from 0 to X, f(x) is A
Magnitude and Phase
F (u ) R(u ) jI (u )
j ( u )
F (u ) e
F (u ) R 2 (u ) I 2 (u )
I (u )
(u ) arctan
R(u )
|F(u)| is called the magnitude spectrum
φ(u) is called the phase spectrum (phase angle)
Magnitude and Phase
Power Spectrum or Spectral Density
2
P(u ) F (u ) R (u ) I (u )
2 2
For display, we can use following
formulation
D(u ) c log1 F (u )
Fourier Transform: 2‐D Case
Fourier Transform:
–If f(x,y) is a 2D function, its Fourier
transform is given by:
f(x,y) is a 2D function and, for example,
can be the brightness in an image
Fourier Transform: 2‐D Case
Inverse Fourier transform
–It is given as follows
Discrete Fourier Transform: 1‐D Case
Images are discrete sequence of numbers
Thus, we need a discrete formulation of the Fourier
transform
DFT
– Input: takes regularly spaced data values,
– Output: it returns the value of the Fourier transform (a
set of values in frequency space which are equally
spaced)
Replacing the integration by summation quite
naturally gives the discrete Fourier transform or
DFT for short
Discrete Fourier Transform: 1‐D Case
Assume that x takes values from 0 to N‐1
– In 1‐D it is convenient now to assume that x
goes up in steps of 1, and that there are N
samples, at values of x from 0 to N‐1
So the DFT takes the form:
Discrete Fourier Transform: 1‐D Case
NOTE minor changes from the continuous
case to discrete case
1/N factor in DFT
– There is a factor of 1/N in the exponential terms, and
also the factor 1/N in front of the forward transform
No 1/N in inverse DFT in front of expression:
– factor 1/N in front of the forward transform does not
appear in the inverse transform
Important Note:
– Some authors include(1/N) factor before summation
in inverse transform in place of including it in
forward transform
Discrete Fourier Transform: 1‐D Case
Example
Discrete Fourier Transform: 1‐D Case
Example
F(u) is discrete so,
Fk(u) = F(k u)
k = 0,.., N-1
Note: If x is the sample spacing in spatial
domain, corresponding spacing in
frequency domain is given as u = 1/(N x)
Discrete Fourier Transform Pair
N 1 ux
j 2
f ( x) F (u )e N
u 0
1 N 1 N 1 j 2
ux
j 2
ux
F (u )
N
F (u )e
x 0 u 0
N
e
N
Use following property of orthogonality
N 1 j 2
rx
j 2
ux
N if r u
e N
e N
x 0 0 otherwise
It gives F (u ) F (u )
Show this
Discrete Fourier Transform: 2‐D Case
The 2‐D DFT works in a similar way as 1‐D
For an N x M grid in x and y we have
Inverse DFT
Discrete Fourier Transform: 2‐D Case
When image size is N x N, this makes a special
case of f(x, y)
– Use N = M to get new formulation
This makes the forward and inverse
transforms look more symmetrical:
Forward DFT
u,v = 0,1,2, …, N‐1
Inverse DFT
x,y = 0,1,2, …, N‐1
Discrete Fourier Transform: 2‐D Case
The basis functions are sine and cosine waves
with increasing frequencies
F(0,0) represents the DC‐component of the
image which corresponds to the average
brightness
F(N‐1,N‐1) represents the highest frequency
Visualization of DFT
The Fourier Transform produces a complex
number valued output image which can be
displayed with two images,
– either with the real and imaginary part or
– with magnitude and phase
In image processing, often only the magnitude of
the Fourier Transform is displayed, as it contains
most of the information of the geometric
structure of the spatial domain image.
Visualization of DFT
So typically, we visualize |F(u,v)|
Since dynamic range of |F(u,v)| is normally
very large, so stretching is applied
(c is a constant)
Shows 2 pixel wide vertical stripes Fourier transform
End