filtering in the frequency domain · dr. praveen sankaran department of ece nit calicut january 11,...
Post on 06-Jul-2020
6 Views
Preview:
TRANSCRIPT
Preliminary ConceptsFourier Transform of Sampled Functions
Filtering in the Frequency Domain
Dr. Praveen Sankaran
Department of ECE
NIT Calicut
January 11, 2013
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Outline
1 Preliminary Concepts
2 Fourier Transform of Sampled FunctionsContinuous FunctionsDiscrete Fourier Transform (DFT)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Signal
A measurable phenomenon that changes over time or throughoutspace.
Case in hand for this class → an image.
Signals undulate → variation in pixel values.
Frequency-domain representation
An exact description of a signal in terms of its undulations.
Any Real Signal has a Frequency-Domain Representation.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Fourier Series
Any periodic function can be expressed as the sum of sines and/orcosines of di�erent frequencies, each multiplied by a di�erentcoe�cient.
The sinusoids are called �basis functions�.
The multipliers are called �Fourier coe�cients�.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Fourier Series
f (t) =∞
∑n=−∞
cnej 2πnT t (1)
T = period
cn =1
T
∫ T/2
−T/2f (t)e−j
2πnT tdt (2)
n = 0,±1, · · ·
Note →e jθ = cosθ + jsinθ
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Non-periodic Functions?
Any Real Signal has a Frequency-Domain Representation. Sowhat about non-periodic functions?
Fourier Transform
ℑ{f (t)}= F (µ) =∫
∞
−∞
f (t)e−j2πµtdt (3)
µ = frequency.
f (t) =∫
∞
−∞
F (µ)e j2πµtdµ (4)
Fourier transform pair.
Note → integral of the square of f (t) =�nite.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Fourier Transform Example
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Impulses
A unit impulse of a continuous variable t located at t = 0, isde�ned as,
δ (t) =
{∞ if t = 0
0 if t 6= 0(5)
and, ∫∞
−∞
δ (t)dt = 1 (6)
Unit Discrete Impulse
δ [x ] =
{1 if x = 0
0 if x 6= 0(7)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Sifting Property
Sifting Property ∫∞
−∞
f (t)δ (t)dt = f (0) (8)
if f (t) is continuous at t = 0
∫∞
−∞
f (t)δ (t− t0)dt = f (t0) (9)
Discrete Form∞
∑x=−∞
f [x ]δ [x ] = f [x ] (10)
∞
∑x=−∞
f [x ]δ [x− x0] = f [x0] (11)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Impulse Train
s (t) =∞
∑n=−∞
δ (t−n∆T )
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Convolution
Convolution
f (t)?h (t) =∫
∞
−∞
f (τ)h (t− τ) (12)
Convolution Theorem
ℑ(f (t)?h (t)) = H (µ)F (µ) (13)
ℑ(f (t)h (t)) = H (µ)?F (µ) (14)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Outline
1 Preliminary Concepts
2 Fourier Transform of Sampled FunctionsContinuous FunctionsDiscrete Fourier Transform (DFT)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Sampling
1 Sampling theorem?
2 Aliasing?
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Fourier Transform of an Impulse
F (µ) =∫
∞
−∞f (t)e−j2πµtdt
f (t) =∫
∞
−∞F (µ)e j2πµtdµ
Note that the di�erence is in the sign of the exponential. Thusif,
f (t)→ F (µ), thenF (t)→ f (−µ)
ℑ(δ (t− t0)) = e−j2πµt0
Then, e−j2πtt0 (notice the variable replacement), will have atransform, δ (−µ− t0).
If we put −t0 = a, transform of e j2πat is δ (a−µ) or δ (µ−a).
So we have, ℑ
(ej2πnt∆T
)= δ
(µ− n
∆T
)Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Fourier Series of an Impulse Train
Let f̃ [t] represent the product of f (t) and an impulse train.(sampled function).
F̃ (µ) = ℑ
{f̃ [t]
}= F (µ)?S (µ) (15)
This is obtained from equation 14, convolution theorem.So now we need to �nd the transform of an impulse train,
S (µ) = ℑ(s (t)) = ℑ(∑
∞n=−∞ δ (t−n∆T )
),
which is periodic.
We �rst �nd the Fourier series expansion for the impulse trainas,
s (t) =∞
∑n=−∞
cnej 2πnt
∆T
cn = 1
∆T
∫ ∆T2
−∆T2
s (t)e−j2πnt∆T dt = 1
∆T
s (t) = 1
∆T
∞
∑n=−∞
ej 2πnt
∆T
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Fourier Transform of Sampled Functions
So now, S (µ) = ℑ
(1
∆T
∞
∑n=−∞
ej2πnt∆T
)
S (µ) = 1∆T
ℑ
(∞
∑n=−∞
ej2πnt∆T
), the term inside the function
summation we recognize as being that of impulse!
So now,
S (µ) =1
∆T
∞
∑n=−∞
δ
(µ− n
∆T
)(16)
Remember - F̃ (µ) = F (µ)?S (µ), leading to,
F̃ (µ) =1
∆T
∞
∑n=−∞
F(
µ− n
∆T
)(17)
Note → notice that F (µ) is a continuous function. And sinceF̃ (µ) consists of copies of F (µ), this is also continuous.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Fourier Transform - Illustration
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Reconstruction Problem: Illustration
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Reconstruction Problem
1 Generate two sinusoids with frequencies F0 = 18Hz and
F1 =−78Hz . Sample both at Fs = 1Hz . Generate stem plots
for each, with a di�erent color for each. Plot the originalcontinuous signals over the sampled one, again each colorcoded. What do you observe? Determine the sampling rate atwhich you can avoid a problem here? Repeat the procedure atthis new sampling frequency. What do you observe?
2 You have done such a process in your DSP lab.
1 You may try this out in Matlab.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Illustration
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Reconstruction Function?
f (t) = ℑ−1 {F (µ)}
= ℑ−1{H (µ) F̃ (µ)
}= h (t)? f̃ [t]
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Outline
1 Preliminary Concepts
2 Fourier Transform of Sampled FunctionsContinuous FunctionsDiscrete Fourier Transform (DFT)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Continuous Transform Revisited
F̃ (µ) =∫
∞
−∞
f̃ [t]e−j2πµtdt (18)
=∫
∞
−∞
∞
∑n=−∞
f (t)δ (t−n∆T )e−j2πµtdt (19)
=∞
∑n=−∞
∫∞
−∞
f (t)δ (t−n∆T )e−j2πµtdt (20)
=∞
∑n=−∞
f [n]e−j2πµn∆T (21)
Remember → F̃ (µ) = 1∆T
∞
∑n=−∞
F(
µ− n
∆T
).
f [n] is discrete, F̃ (µ) is continuous.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Illustration - FT
We have F̃ (µ) is continuous, repeating itself with period 1∆T
.
Consider one period → µ = 0 to 1∆T
.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Getting the DFT
What we want
K equally spaced samples of F̃ (µ) between µ = 0 andµ = 1
∆T.
What we will do -
Take samples at following frequencies -
µ =k
K∆Tk = 0,1, · · ·K −1 (22)
Substituting above µ to F̃ (µ) =∞
∑n=−∞
f [n]e−j2πµt ,
F [k] =K−1
∑n=0
f [n]e−j2πnk/K k = 0,1, · · ·K −1 (23)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Getting the DFT
What we want
K equally spaced samples of F̃ (µ) between µ = 0 andµ = 1
∆T.
What we will do -
Take samples at following frequencies -
µ =k
K∆Tk = 0,1, · · ·K −1 (22)
Substituting above µ to F̃ (µ) =∞
∑n=−∞
f [n]e−j2πµt ,
F [k] =K−1
∑n=0
f [n]e−j2πnk/K k = 0,1, · · ·K −1 (23)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Getting the DFT
What we want
K equally spaced samples of F̃ (µ) between µ = 0 andµ = 1
∆T.
What we will do -
Take samples at following frequencies -
µ =k
K∆Tk = 0,1, · · ·K −1 (22)
Substituting above µ to F̃ (µ) =∞
∑n=−∞
f [n]e−j2πµt ,
F [k] =K−1
∑n=0
f [n]e−j2πnk/K k = 0,1, · · ·K −1 (23)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
DFT Pair
DFT
F [k] =K−1
∑n=0
f [n]e−j2πnk/K k = 0,1, · · ·K −1
Inverse DFT
f [n] =1
K
K−1
∑k=0
F [k]ej2πkn/K n = 0,1, · · ·K −1 (24)
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Convolution
f [n]?h [n] =K−1
∑k=0
f [m]h [n−m] n = 0,1, · · ·K −1 (25)
Circular convolution.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Sample Calculation
In terms of variable x (f [x ]). x = 0, 1, 2, 3.
Calculate,
F [0] , F [1] , F [2] , F [3]f [0] , f [1] , f [2] , f [3] from the above.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Summary
Fourier series.
Fourier transforms.
Sampling, sampling theorem.
Fourier transform of sampled functions.
DFT, IDFT, Circular convolution.
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
Assignment?
1 Perform histogram equalization of image provided. Save theinput image histogram and the output image histogram as.pgm images.
2 Repeat histogram equalization on the processed output ofprevious question. Save the histogram as .pgm. Repeat thisprocess a few times.
1 Do you notice any di�erence over successive histograms?
3 Using images provided, perform Histogram Matching.
Save histograms of both input image and the reference image.Save histogram of processed image.(All in .pgm format).
Dr. Praveen Sankaran DIP Winter 2013
Preliminary ConceptsFourier Transform of Sampled Functions
Continuous FunctionsDiscrete Fourier Transform (DFT)
References
Dr. Richard Alan Peters II:http://archive.org/details/Lectures_on_Image_Processing
Dr. Praveen Sankaran DIP Winter 2013
top related