Lecture 5
Lecture 5
Lecture 5
Spring 2020
●
Background
●
Preliminary Concepts
●
Fourier Series of Periodic Functions of One Continuous Dimension
●
Fourier Transform of Functions of One Continuous Dimension
●
Convolution in the Fourier Domain
●
Sampling and Fourier Transform of Sampled Functions
2 / 35
Background
●
Fourier Series: any periodic function can
be represented as the sum of sines and/or
cosines of different frequencies, each
multiplied by a different coefficient.
●
Fourier Transform: functions that are not
periodic, but have a finite area under the
curve, can be represented as the integral of
sines and/or cosines of different
frequencies, multiplied by a weighting
function.
3 / 35
Background
●
Progress of digital computers and the discovery of Fast Fourier Transform
(FFT) algorithms, revolutionized the field greatly.
●
For an MxN image and an mxn kernel, MNmn operations is needed.
●
If the kernel is separable, then MN(m+n) operations are needed.
●
If the same filtering is done in a the frequency domain, using FFT,
2MNlog2MN operations are needed!
4 / 35
Complex Numbers
●
A complex number is shown as:
C R jI
with R as the real part, I as the imaginary part and j is the imaginary
number, equal to 1
●
The conjugate of the complex number is:
C* R jI
●
Other representations of a complex number:
● Vector: <R, I>
● Polar coordinates: C | C | (cos j sin )
● Euler’s equation: e j cos j sin C | C | e j
● 2D graph
5 / 35
Complex Numbers
●
Other representations of a complex number:
● Vector: <R, I>
● Polar coordinates: C | C | (cos j sin )
● Euler’s equation: e j cos j sin C | C | e j
● 2D graph
●
In the above equations:
|C|= √ (R + I )
2 2
I
θ =arctan
R
6 / 35
Periodic Functions
e jθ −e− jθ
sin(θ )=
2j
e j θ +e− j θ
cos(θ )=
2
●
Any periodic function, has a period shown by T.
7 / 35
Periodic Functions
●
In general:
A sin( f t ) B
A cos( f t ) B 2
Period: T
f
8 / 35
Fourier Series
●
Can periodic functions be expressed as a
sum of sine and cosine functions of different
frequencies, multiplied by different
coefficients?
●
Joseph Fourier has studied this subject,
and confirmed that it is possible.
●
Expansion of a periodic function into its
consisting sine/cosine components is called
Fourier Series representation.
9 / 35
Fourier Series
●
Let’s assume a 1D continuous periodic function f(t), with period T.
●
The Fourier Series expansion of f(t) is defined as:
2n
j t
f (t ) c e
n
n
T
2n
1 T /2 j t
cn f (t )e T
dt n 0,1,2,
T T / 2
10 / 35
Impulse Functions and Their Sifting Properties
●
The unit impulse function of the continuous variable t, located at t=0 is
defined as: t 0
(t )
0 t 0
●
This function satisfies the following constraint, which means that the spike
of infinity amplitude and zero duration has a unit area:
(t )dt 1
●
Sifting Property:
f (t ) (t )dt f (0)
if the function f(t) is continuous at t=0.
●
Sifting yields the value of the function f(t) at the location of impulse.
11 / 35
Impulse Functions and Their Sifting Properties
f (t ) (t t0 )dt f (t0 )
12 / 35
Impulse Trains
●
What if we have a train of these unit impulses? How are they represented?
sT (t ) (t nT )
n
13 / 35
Discrete Impulse Functions
●
So far we saw impulses in terms of a the continuous variable t.
●
What about in discrete case, in terms of the discrete variable x?
1 x 0
( x)
0 t 0
●
What about the integral constraint? It can be shown using summation for
the discrete variable as:
( x) 1
x
●
What about the sifting property of the impulse function?
f ( x) ( x) f (0)
x
f ( x) ( x x ) f ( x )
x
0 0
14 / 35
Discrete Impulse Functions
●
What about the discrete impulse train? It is defined similar to the
continuous case.
15 / 35
Fourier Transform of Functions of One Continuous
Variable
●
As said before, Fourier Series is defined for functions that are periodic.
●
The Fourier Transform (FT) of a non-periodic function f(t) is defined as:
{ f (t )} f (t )e j 2ut dt
where u is the continuous frequency variable.
●
The FT, also shown as F(u), is a function of only u, because variable t is
integrated out.
●
The inverse of FT is defined as:
f (t ) F (u )e j 2ut du
●
The function and its Fourier transform can be show as a pair:
f (t )⇔ F (u)
16 / 35
Fourier Transform of Functions of One Continuous
Variable
●
Using the Euler’s formula: e j cos j sin
●
We can rewrite the FT as:
F (u ) f (t )[cos( 2ut ) j sin( 2ut )]dt
●
The inverse FT can also be rewritten as:
f (t ) F (u )[cos( 2ut ) j sin( 2ut )]du
●
This means that any function f(t) can be expressed as a weighted integral
of sine and cosine functions.
●
Remember, for the periodic function, it could be expressed as the
summation of weighted sine and cosine functions.
17 / 35
Fourier Transform – Example 1
●
What is the FT of a box function, defined as:
e jθ −e− jθ
●
The last step is done by using the trigonometric identity: sin(θ )=
2j
18 / 35
Fourier Transform – Example 1
●
What is the FT of a box function, defined as:
●
The function is called a sinc function:
sin ( π x )
sinc ( x )=
πx
●
The Fourier Spectrum is defined as the magnitude of F(u): |F(u)|
19 / 35
Fourier Transform – Example 2
t 0
●
What is the FT of a unit impulse located at the origin? (t )
0 t 0
●
Using the FT definition, and the sifting property of the impulse function:
+∞
F (u)= ∫ δ (t )e
− j 2π u t − j2π u 0 0
dt=e =e =1
−∞
20 / 35
Fourier Transform – Example 3
●
What is the FT of the impulse train: sT (t ) (t nT )
n
●
Its Fourier series, with period ΔT, can be written as:
2n
j t
sT (t ) c e
n
n
T
where
2 n
1 T /2 j t
cn
T
T / 2 T
s (t )e T
dt
● The coefficients cn are calculated as:
2n 2n
1 T / 2 j t 1 j t 1 0 1
cn
T T / 2
(t )e T
dt
T
(t )e T
dt
T
e
T
21 / 35
Fourier Transform – Example 3
●
This means we have an alternative way of writing an impulse train as:
2n
1 j t
sT (t )
T
e
n
T
2n
j t
T
●
Therefore, the FT of the impulse train reduces to finding the FT of e
●
Because of the symmetry property of the FT: if f (t )⇒ F (u), then F (t)⇒ f (−u)
2π n
j
ΔT n
FT {e }=δ (u−
)
ΔT
●
Combining these, we can find the FT of the impulse train as:
∞ 2π n
1 j 1 ∞ n
S (u)=FT {sΔ T (t )}=FT { ∑
Δ T n=−∞
e ΔT
}= ∑
Δ T n=−∞
δ (u−
ΔT
)
which means the FT of an impulse train in the signal domain, is an impulse
train in the frequency domain!
22 / 35
Convolution
●
Convolution of two functions involves flipping (rotating by 180 degrees)
one function about its origin, and sliding it past the other. At each
displacement, we perform the computation (sum-of-product).
●
Convolution of two continuous functions is defined as:
f (t ) h(t ) f ( ) h(t )d
●
The FT of the convolution is:
{ f (t ) h(t )} f (t ) h(t )e j 2ut dt
f ( ) h(t )e j 2ut dt d
23 / 35
Convolution
……
f ( ) H (u )e j 2u d
H (u ) f ( )e j 2u d
H (u ) F (u )
●
In conclusion:
FT
f (t )⊗h(t ) ⇔ H (u) F (u)
IFT
FT
f (t )h(t ) ⇔ H (u)⊗F (u)
IFT
24 / 35
1D Sampling Theory
●
So far we only talked about continuous
functions, either periodic, or non-periodic.
●
Continuous functions need to be sampled
and quantized to be processed by a
computer.
●
Sampling can be modeled by multiplying
the function f(t) with a train of impulses
ΔT apart:
~
f (t ) f (t ) sT (t ) f (t ) (t nT )
n
∞
f k =∫−∞ f (t ) δ (t−k Δ T )dt =f (k Δ T )
25 / 35
Fourier Transform of the Sampled Signal
●
How to find the FT of the sampled signal? Remember the convolution
property of FT:
FT
f (t )⊗h(t ) ⇔ H (u) F (u)
IFT
FT
f (t )h (t ) ⇔ H (u)⊗F (u)
IFT
~
●
This means that: F (u ) { f (t ) sT (t )} F (u ) S (u )
●
Remember the FT of the impulse train:
2π n
1 ∞ j 1 ∞ n
S (u)=FT {sΔ T (t )}=FT { ∑
Δ T n=−∞
e ΔT
}= ∑
Δ T n=−∞
δ (u−
ΔT
)
26 / 35
Fourier Transform of the Sampled Signal
~
●
Therefore: F (u ) F (u ) S (u )
F ( )S (u )d
1 n
T F ( )n
(u
T
)d
1 n
T
n
F ( ) (u
T
) d
1 n
T
n
F (u
T
)
27 / 35
Sampling Rate
●
What is the effect of sampling rate in
Fourier domain?
●
Over-sampled: 1/ΔT is sufficiently large
to separate the copies of the sampled
function’s FT in the frequency domain.
●
Critically-sampled: 1/ΔT is just large
enough to separate the sampled
function’s FT in the frequency domain.
●
Under-sampled: 1/ΔT is not large
enough to separate the sampled
function’s FT in the frequency domain.
28 / 35
The Sampling Theorem
●
A function f(t) whose Fourier transform is
zero for values of frequencies outside a
finite interval [-umax, umax] about the origin,
is called a band-limited function.
●
We can recover f(t) from its samples, if we
can isolate a single copy of the F(u) from
the periodic sequence of copies of this
function contained in ~
F (u) .
●
Sampling Theorem states that extraction
of a single copy is possible, if the sampling
rate (1/ΔT) satisfies:
1
2umax
T
29 / 35
How to Recover a Signal From its Samples?
●
First, we extract the central portion of
~
the Fourier transform F (u ) using a box
function like the following:
T umax u umax
H (u )
0 otherwise
by multiplying the Fourier transform,
with the box function:
~
F (u ) H (u ) F (u )
●
Finally, using the inverse Fourier
Transform we can recover the original
signal:
f (t ) F (u )e j 2ut du
30 / 35
Recovery From Sampled Signal in the Signal
Domain
●
In the frequency domain, as we saw, we can recover the signal from its
samples using:
1 ~ 1
f (t ) {F (u )} {H (u ) F (u )}
~
●
Because of the convolution property of the FT, we have: f (t ) h(t ) f (t )
●
The H(u) was a box function, which makes its inverse FT a sinc function:
t
h(t )=sinc ( )
ΔT
●
Also we have:
~
f (t ) f (t ) sT (t ) f (t ) (t nT )
n
●
Therefore for the recovery in the signal domain we have:
∞
f (t)=∑n=−∞ f (n Δ T ) sinc [(t −n Δ T )/ Δ T ]
31 / 35
Aliasing
●
Alias means “a false identity”.
●
Sampling phenomena that cause different
signals to become indistinguishable.
●
Since we describe a digitized function only
by its samples, it is possible that different
continuous functions to coincide at the
values of their respective sample.
●
Two continuous functions with these
characteristics are called an aliased pair.
●
Aliasing happens when the signals are
under-sampled; according to the Sampling
Theorem, when 1/ΔT < 2umax.
32 / 35
Aliasing - Example
●
Let’s have a sine function as sin(πt);
●
The period is 2, frequency is 0.5;
●
According to the sampling theorem, the sampling rate must be greater than
two times of the maximum frequency, here 2*0.5= 1, so it must be 1/ΔT>1.
●
Smoothing the original signal can reduce the aliasing effect, a process
called anti-aliasing (WHY?)
33 / 35
What is Next?
●
Discrete Fourier Transform (DFT) of One Variable
●
Extensions to Functions of Two Variables
●
Properties of 2D DFT and Inverse DFT
●
Filtering in the Frequency Domain
●
Image Smoothing and Sharpening in The Frequency Domain
34 / 35
Questions?
abaghaie@nyit.edu
35 / 35