TIME AND FREQUENCY DOMAIN
FILTERING
Frequency Domain Filtering
=
Any function that periodically repeats itself can
be expressed as a sum of sines and cosines of
different frequencies each multiplied by a
different coefficient – a Fourier series
Fourier Transform
A function that is not periodic but the area under its curve is
finite can be expressed as the integral of sines and/or
cosines multiplied by a weighing function. The formulation
in this case is Fourier transform.
Continuous One-Dimensional Fourier Transform
and Its Inverse
Where
• (u) is the frequency variable.
• F(u) is composed of an infinite sum of sine and
cosine terms and…
• Each value of u determines the frequency of its
corresponding sine-cosine pair.
Continuous One-Dimensional Fourier Transform
and Its Inverse
Discrete One-Dimensional Fourier Transform and
Its Inverse
• A continuous function f(x) is discretized into a sequence:
by taking N or M samples x units apart.
Discrete One-Dimensional Fourier Transform and
Its Inverse
• Where x assumes the discrete values (0,1,2,3,…,M-1)
then
• The sequence {f(0),f(1),f(2),…f(M-1)} denotes any
M uniformly spaced samples from a corresponding
continuous function.
Discrete One-Dimensional Fourier Transform and
Its Inverse
u =[0,1,2, …, M-1]
x =[0,1,2, …, M-1]
Discrete One-Dimensional Fourier Transform and
Its Inverse
• The values u = 0, 1, 2, …, M-1 correspond to samples of
the continuous transform at values 0, u, 2 u, …, (M-1)
u.
i.e. F(u) represents F(u u), where:
• Each term of the FT (F(u) for every u) is composed of the
sum of all values of f(x)
Discrete One-Dimensional Fourier Transform and
Its Inverse
• The Fourier transform of a real function is generally
complex and we use polar coordinates:
Discrete One-Dimensional Fourier Transform and
Its Inverse
• |F(u)| (magnitude function) is the Fourier spectrum of
f(x) and (u) its phase angle.
• The square of the spectrum
is referred to as the Power Spectrum of f(x)
(spectral density).
Discrete 2-Dimensional Fourier Transform
• Fourier spectrum:
• Phase:
• Power spectrum:
Discrete Two-Dimensional Fourier Transform and
Its Inverse
for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.
Fourier Spectrum for x = 0, 1, 2…M-1 and y = 0, 1, 2…N-1.
Discrete Two-Dimensional Fourier Transform and Its
Inverse
F(0,0) is the average intensity of an image
Associations in frequency domain
Each term of F(u,v) contains all values of f(x,y)
modified by the values of the exponential terms
Frequencies in FT shows the intensity variations
in an image
Low frequency-smooth regions
High frequency -faster grey level changes
(edges and noise)
The Inverse DFT
It is really important to note that the Fourier
transform is completely reversible
The inverse DFT is given by:
for x = 0, 1, 2…M-1 and y = 0, 1, 2…N-1
Frequency Shifting Property of the Fourier Transform
The DFT and Image Processing
To filter an image in the frequency domain:
1. Compute F(u,v) the DFT of the image
2. Multiply F(u,v) by a filter function H(u,v)
3. Compute the inverse DFT of the result
Basics of filtering in the frequency domain
1. Multiply the input image by (-1)x+y to center
the transform
2. Compute F(u,v), the DFT of the image
3. Multiply F(u,v) by a filter function H(u,v)
4. Compute the inverse DFT of (3)
5. Obtain the real part of the result
6. Multiply the result in (5) by (-1)x+y
Some basic filters
• F(0,0) is the dc component or the average
value of the image
• Notch filter – sets F(0,0) to zero and
leaves all other frequency components of
the FT untouched.
H(u,v)= 0 if (u,v) = (M/2,N/2)
1 otherwise
Smoothing Frequency Domain Filters
Smoothing is achieved in the frequency domain
by dropping out the high frequency components
The basic model for filtering is:
G(u,v) = H(u,v)F(u,v)
where F(u,v) is the Fourier transform of the
image being filtered and H(u,v) is the filter
transform function
Low pass filters – only pass the low frequencies,
drop the high ones
Ideal Low Pass Filter (cont…)
The transfer function for the ideal low pass filter
can be given as:
where D(u,v) is given as:
Smoothing Frequency Domain, Ideal Low-pass Filters
Total
Power
The remained percentage
power after filtration
Butterworth Lowpass Filters
The transfer function of a Butterworth lowpass
filter of order n with cutoff frequency at
distance D0 from the origin is defined as:
Gaussian Lowpass Filters
The transfer function of a Gaussian lowpass
filter is defined as:
Low-pass and High-pass Filters
Sharpening in the Frequency Domain
Edges and fine detail in images are associated
with high frequency components
High pass filters – only pass the high
frequencies, drop the low ones
High pass frequencies are precisely the reverse
of low pass filters, so:
Hhp(u, v) = 1 – Hlp(u, v)
Ideal High Pass Filters
The ideal high pass filter is given as:
where D0 is the cut off distance as before
Butterworth High Pass Filters
The Butterworth high pass filter is given as:
where n is the order and D0 is the cut off
distance as before
Gaussian High Pass Filters
The Gaussian high pass filter is given as:
where D0 is the cut off distance as before
Laplacian In The Frequency Domain
• Origin of F(u,v) is centered using f(x,y)(-1)x+y, before taking
the transform. Center of filter function is shifted:
• H(u,v)= -[(u-M/2)2+(v-N/2)2]1/2
• Laplacian filtered image in the spatial domain is obtained by
computed the IFT of H(u,v)F(u,v)
• Computing Laplacian in spatial domain and computing FT of the
result is equivalent to multiplying F(u,v) by H(u,v)
∇2 f (x, y) = ℑ−1 {-[(u-M/2)2+(v-N/2)2 ]1/2F(u,v)}
∇2 f (x, y) ⇔ {-[(u-M/2)2+(v-N/2)2 ]1/2F(u,v)}
Fast Fourier Transform
The reason that Fourier based techniques have
become so popular is the development of the
Fast Fourier Transform (FFT) algorithm
Allows the Fourier transform to be carried out in
a reasonable amount of time
Reduces the amount of time required to
perform a Fourier transform by a factor of 100 –
600 times!
Frequency Domain Filtering & Spatial Domain
Filtering
Similar jobs can be done in the spatial and
frequency domains
Filtering in the spatial domain can be easier to
understand
Filtering in the frequency domain can be much
faster – especially for large images