Sei sulla pagina 1di 27

Fast Fourier Transform

Maria Hafeez
Definition
In 1807 Fourier discovered that any periodic function can be written as a
sum of sine and cosine functions.
Some image processing operations are better suited to frequency domain
solutions.
Transformation is mapping between two sets of data or domains. In this
case of Fourier transform it is time and frequency domain.
Frequency Domain
Frequency refers to the rate of repetition of some periodic event. In
imaging, Spatial Frequency refers to the variations of image brightness with
position in space.

A varying signal can be transformed into a series of simple periodic
variations. The Fourier Transform is a well known example and decomposes
the signal into a set of sine waves of different characteristics (frequency
and phase).
Amplitude and Phase
The spectrum is the set of waves
representing a signal as frequency
components. It specifies for each
frequency:
The amplitude (related to the energy)
The phase (its position relative to
other frequencies)
Amplitude Phase
period
a
m
p
l
i
t
u
d
e

phase
What happens if we vary the phase of the
components we used to make the triangle
wave?
y1 = sin(2.0*pi*frequency1*time);
y2 = sin(2.0*pi*frequency2*time - 1.6);
y3 = sin(2.0*pi*frequency3*time - 0.1);
y4 = sin(2.0*pi*frequency4*time +1.3);
y = a1*y1 + a2*y2 + a3*y3 + a4*y4;
Shape of wave is changed even
though frequency spectrum is
the same
Multiplying two cosines with different
frequencies

cos(2 ) and
cos(4 )
Multiplied together
Average to zero
t
t
t
t
Multiplying two cosines with the same
frequency
The
average is
not zero.
The
average is
1/2
Image Processing pipeline
Sampling Theory
Analysis in the frequency (not spatial) domain
Sum of sine waves, with possibly different offsets (phase)
Each wave different frequency, amplitude



Fourier Transform: Examples 1
Single sine curve








2
2
2
0
( ) ( )
( ) ( )
iux
u
iux
f x F u e
F u f x e dx
t
t
t
+
=

=
=

}
Low-pass Filtering
Let the low frequencies pass and eliminating the high frequencies.
Generates image with overall
shading, but not much detail
High-pass Filtering
Lets through the high frequencies (the detail), but eliminates the low
frequencies (the overall shape). It acts like an edge enhancer.

Applications: Frequency Domain In
Images
Spatial frequency of an image refers to the rate at which the pixel
intensities change
In picture on right:
High frequencies:
Near center
Low frequencies:
Corners

Example: Removing undesirable
frequencies
remove high
frequencies
reconstructed
signal
frequencies
noisy signal
To remove certain
frequencies, set their
corresponding F(u)
coefficients to zero!
How do frequencies show up in an image?
Low frequencies correspond to slowly varying information (e.g., continuous
surface).
High frequencies correspond to quickly varying information (e.g., edges)

Original Image
Low-passed
Example of noise reduction using FT
A visualization of the relationship between the time domain and the
frequency domain of a function, based on its Fourier transform. The Fourier
transform takes an input function f (in red) in the "time domain" and converts
it into a new function f-hat (in blue) in the "frequency domain".
In other words, the original function can be thought of as being "amplitude
given time", and the Fourier transform of the function is "amplitude given
frequency".
Shown here, a simple 6-component approximation of the square wave is
decomposed (exactly, for simplicity) into 6 sine waves. These component
frequencies show as very sharp peaks in the frequency domain of the
function, shown as the blue graph.
https://upload.wikimedia.org/wikipedia/commons/5/50/Fourier_transform_ti
me_and_frequency_domains.gif

Lets Look at Some Real Images!
In this image you have a bunch of cells that are all
the same size but there is no order to their
arrangement. There are enough of them that they
are pretty tightly packed in some regions.
This is reflected in the FT image because there
is a circle which represents the average
distance they are from each other but it also
shows that there is no preferred long range
order.
The power of FT is that it allows you to take a
seemingly complicated image which has an
apparent order that is difficult to determine see
and break it up into its component sine waves.
This image for example looks ordered but I
couldnt tell you exactly what that order is.
After taking a FT of the image it is very
apparent what sort of order it has and one
can determine all the distances between
nearest neighbors just by taking the
reciprocal of the distances between a dot
and the center of the image.
Fourier Transform Images are from: http://www.cs.unm.edu/~brayer/vision/fourier.html
Lets Bring it Up a Few Notches
This image exclusively has 4 cycles
horizontally and 16 cycles vertically
This image exclusively has 32 cycles
horizontally and 2 cycles vertically
An original image without imaginary
numbers will always be symmetric across
the y-axis, regardless of what the actual
image is.
If the image is symmetrical across the x-
axis in real space then it will also be in
inverse space.

Each of the horizontal points is fractured
by the vertical parts and vice versa. This
only happens because the original
image was blurry.
Fourier Transform Images are from: http://www.cs.unm.edu/~brayer/vision/fourier.html
Magnitude vs. Phase
The Fourier Transform is defined as:
Since Computers dont like infinite integrals a Fast
Fourier Transform makes it simpler:
Where F(w) is original function and f(t) is the transformed function
|
.
|

\
| +

=
N
y v x u i
x y
e y x F v u f
) * * ( 2 *
) , ( ) , (
t
Where F(x,y) is real and f(u,v) is complex.
So what do we do with this?
Well instead of representing the complex numbers
as real and imaginary parts we can represent it as
Magnitude and Phase where they are defined as:
|
.
|

\
|
=
+ =
Re
Im
arctan ) (
Im Re ) (
2 2
f Phase
f Magnitude
Magnitude is telling how much of a certain
frequency component is in the image.
Phase is telling where that certain frequency lies
in the image.
What do Magnitude and Phase
physically appear as on the FT?
They look the same!
This is because when we look at FT images
they are actually just the magnitude and all
information regarding phase is disregarded.
These two images are shifted pi with
respect to each other.
This is because FT Phase images are much to
difficult to interpret. Fourier Transform Images are from: http://www.cs.unm.edu/~brayer/vision/fourier.html
Rotation Effects
These two images are identical except
the right one has been rotated 45
degrees.
What happened?
The FT always treats an image as a
periodic array of horizontal and vertical
sine curves. Since the images abruptly
ends at the edges of the box it has a
strong effect on the image.
This is only caused by the abrupt ending
of the box so it can be resolved by
making it less abrupt.
This is better but it isnt perfect because of
the blurring around the edges.
This is the True FT image of the pattern
rotated 45 degrees.
Fourier Transform Images are from: http://www.cs.unm.edu/~brayer/vision/fourier.html
Other Applications
Image restoration (compensate instrumental aberrations)
Lattice averaging & structure determination (esp. TEM)
Automatic focusing & astigmatism correction
Analysis of diffraction (and other related) patterns
3D measurements, visualization & reconstruction
Analysis of sections (stereology)
Image data compression, transmission & access
Desktop publishing & multimedia
Stimulus
Control
Feedback
Signal
conditioning
equipment
Display
Recording,
data processing
and transmission of data
Sensor
Transducer
Biological Signal Measurement
noise
Frequency Ranges of Bio-signal
Electromyography (EMG)-------- dc~10000Hz
Electrocardiography (ECG) ----- -0.01~250Hz
Electroencephalography (EEG) -- dc~150Hz
Indirect blood pressure ----------- dc~60Hz
Respiratory rate -------------------- 0.1~10Hz
Body temperature ------------------ dc~0.1Hz
Fast Fourier Transform
The fast Fourier transform (FFT) is a faster way to
compute DFT.
The output of FFT and DFT algorithms are the
same, when the input is the same.
The ratio of computing time for the FFT and DFT is



The number of data samples, N, must be a
power of 2, for FFT to be efficient.
FFT computing time
DFT computing time
=
N log
2
N
N
2

Potrebbero piacerti anche