Professional Documents
Culture Documents
EECE253 06 FourierTransform
EECE253 06 FourierTransform
This work is licensed under the Creative Commons Attribution-Noncommercial 2.5 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/2.5/ or send a letter to Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, 94105, USA.
Signal:
A measurable phenomenon that changes over time or throughout space.
sound image
code
01101000101101110110010110001
2013-03-08 1999-2013 by Richard Alan Peters II 2
2013-03-08
Origin of Sounds
The mechanical vibrations of an object in an atmosphere. Vibrations: internal elastic motions of the material. The surface of the object undulates causing compressions and rarefactions in the air which propagate through the air away from the surface. An object vibrates with different modes. A mode is a vibratory pattern with a distinctive shape part of the object surface moves out while another part moves in a standing wave.
1999-2013 by Richard Alan Peters II 4
2013-03-08
internal pressure
string modes
Note that the modes are all sinusoids.
pipe modes
Note that the negatives of these also will occur
2013-03-08
Sound Waves:
string sound
pipe sound
2013-03-08
Sound Waves:
Even-order harmonics
The vibratory modes add up to one complex motion that pushes the air around the vibrating object
string sound
pipe sound
Odd-order harmonics
2013-03-08
Odd-order harmonics
sq (t ) = 2p 1 sin 2 n 1 t + ( ) + 2 n 1 l n=-
Frequency-Domain Representation
Any periodic signal can be described by a sum of sinusoids.
sq (t ) = 2p 1 n t sin 2 1 + ( ) l n=- 2n + 1
The sinusoids are called basis functions. The multipliers are called Fourier coefficients.
2013-03-08 1999-2013 by Richard Alan Peters II 9
Frequency-Domain Representation
Any periodic signal can be described by a sum of sinusoids.
sq (t ) = 2p 1 n t sin 2 1 + ( ) l n=- 2n + 1
The sinusoids are called basis functions. The multipliers are called Fourier coefficients.
2013-03-08
Basis functions
10
Frequency-Domain Representation
Any periodic signal can be described by a sum of sinusoids.
sq (t ) = 2p 1 n t sin 2 1 + ( ) l n=- 2n + 1
The sinusoids are called basis functions. The multipliers are called Fourier coefficients.
2013-03-08
11
1 sine
2 sines
4 sines
8 sines
2013-03-08
16 sines
1999-2013 by Richard Alan Peters II
32 sines
12
Anatomy of a Sinusoid
f (t)
2p t - f f (t ) = A sin l
2013-03-08
13
f,g =
-l /2
f (t ) g * (t ) dt
This number, called the inner product of f and g , can also be thought of as the amount of g in f or as the projection of f onto g .
If f and g have the same energy, then their inner product is maximal if f = g . On the other hand if f , g = 0, then f and g have nothing in common.
2013-03-08 1999-2013 by Richard Alan Peters II 14
Inner Products
a function, f
1024
g is a component of f
0
f (t ) g (t )dt 0.12
2013-03-08
15
Inner Products
a function, f
1024
h is a not a comp. of f
0
f (t )h(t )dt 0
2013-03-08
16
3 different representations
2013-03-08
17
real number results yield the amplitude of that sinusoid in the function.
2013-03-08
18
Complex number result yields the amplitude and phase of that sinusoid in the function.
2013-03-08
19
n=1
2p n 2p n + Bn sin An cos t t l l
2 An = l 2 Bn = l
2013-03-08
-l /2 l /2
-l /2
Ce
n
pn i 2l t
n=-
Cn e
i = -1
Cn = Cn e
2p n 2p n 1 = f (t ) cos + + t + fn C t sin f dt n n l l l -l /2
l /2
2013-03-08
21
2 = f (h )[cos wn h cos wnt + f (h ) sin wn h sin wnt ] d h l n=0 -l /2 l /2 The sine-plus-cosine 1 = f (h ) cos (wn h - wnt ) d h form results from the l n=0 -l /2 projection of f onto a cosine that is in phase with the current time.
2013-03-08 1999-2013 by Richard Alan Peters II 22
l /2
Relationship between the real and the complex Fourier Series (contd.)
Claim:
0=
l /2
n=-
sin (w h - w t ).
n n
Therefore: Thus:
-l /2
Then add zero to the equation at the end of the previous page:
2013-03-08
23
Relationship between the real and the complex Fourier Series (contd.)
l /2 l /2 1 1 f (t ) = f (h ) cos (wn h - wnt ) d h - i f (h ) sin (wn h - wnt ) d h l n=- -l /2 l n=- -l /2
l /2
n=-
Ce
n
pn i 2l t
n=-
Cn e e
ifn
pn i 2l t
n=-
Cn e
t f
2013-03-08
24
Relationship between the real and the complex Fourier Series (contd.)
l /2 l /2 1 1 f (t ) = f (h ) cos (wn h - wnt ) d h - i f (h ) sin (wn h - wnt ) d h l n=- -l /2 l n=- -l /2
l /2
n=-
Ce
n
pn i 2l t
n=-
Cn e e
ifn
pn i 2l t
n=-
Cn e
t f
2013-03-08
25
Cn e
+i
2 pn t l
where Cn = Cn e +ifn .
Cn represents the amplitude, A=|Cn|, and relative phase, , of that part of the original signal, f (t), that is a sinusoid of frequency n = 2n / .
intensity
0
0
frequency, = 1/
2013-03-08
26
The real and imaginary parts at the negative frequency, -N/ ...
Fourier magnitude
Fourier phase
2013-03-08
30
F ( w ) = F (w ) e
iF(w )
= f (t ) e i 2 p w t dt
-
f (t ) = F (w ) e
-
d w = F (w ) e-i(2 p w t +F(w)) d w
-
2013-03-08
i.e., an integral.
31
2013-03-08
32
hk = H n e i 2 k n /N
n= 0
N 1
where the set, { H n n = 0,1, 2, , N 1}, are the Fourier coefficients defined as the projection of the original signal onto sinusoid, n, given by :
1 N 1 Hn = hk e +i 2 k n /N N k=0
2013-03-08 1999-2013 by Richard Alan Peters II 33
Explains why down-sampling can add distortion to an image and shows how to avoid it. Useful for certain types of noise reduction, deblurring, and other types of image restoration. For feature detection and enhancement, especially edge detection.
2013-03-08
34
F (w ) = f (t ) e-i 2 p w t dt = f (t ) , e+ i 2 p w t
-
and 1 Hn = N
he
k n= 0
N -1
-i 2 p k n / N
= hk , e
+i 2 p k n /N
for the Fourier coefficients are inner products which can be thought of as measures of the similarity between the functions f (t ) and e + i 2 t for t ( , ) or between the sequences N -1 + i 2 p k n / N N -1 { hk } k =0 and { e } k =0 .
2013-03-08 1999-2013 by Richard Alan Peters II 35
{ e-i2pw t
w and w (- , )
}
, if w 1= w 2 if w 1 w 2 c , if j = k if j k
-i 2 p j n / N
, e
-i 2 p k n / N
= e-i 2 p j n /N e+i 2 p k n /N = { 0,
N -1 n= 0
They are called basis sets since for any function1, f (t), of a real variable there exists a complex-valued function F(w), and for any sequence1, hk , there exist complex numbers, Hn , such that
f (t ) = F (w ) e
-
2013-03-08
-i 2 p w t
d w and hk = H n e-i 2p k n /N .
n= 0
N -1
1 with
finite energy.
36
{e
-i 2 p ( ux + vy )
u , v, x, y }
and
{e
jm -i 2 p ( M + kn ) N
j , m 0, ..., M - 1, k , n 0,..., N- 1
= =
- -
j1m + k1n -i 2 p M N
, e
j2 m + k2 n -i 2 p M N
= e
m= 0 n= 0
M -1 N -1
-i 2 p
=
2013-03-08
c , if j1 = j2 and k1 = k2 0, otherwise
.
37
{e
- i 2 p ( ux + vy )
u , v, x, y } and
{e
-i2p(
jm M
kn N
j, k , m , n, M
are orthogonal basis sets. This suggests that function f (x,y) defined on the real plane, and sequence {{ hmn }} for integers m and n have analogous Fourier representations,
f ( x, y ) =
- -
M - 1N - 1
jm kn +i 2 p + M N
F (u , v) =
- -
M -1 N -1
jm kn -i 2 p + M N
The continuous Fourier transform assumes a continuous image exists in a finite region of an infinite plane.
The BoingBoing Bloggers
2013-03-08
39
2013-03-08
40
2013-03-08
41
where
1 I (v,u ) = RC I ( r ,c ) e r =0 c=0 R-1 C -1 vr uc -i 2 p R+ C
e
where
i 2
vr R
+ uc C
=e
2 (vr + uc) N
=e
2 ( r sin + c cos ) N
,
v = tan -1 ( u ).
Note: since images are indexed by row & col with r down and c to the right, is positive in the clockwise direction.
1 ( r sin + c cos ) i 2p l
2013-03-08
Re e
1 ( r sin + c cos ) i 2 p l
} = + cos[
2p l
(r sin + c cos )]
Im e
1 ( r sin + c cos ) i 2 p l
} = sin [
2p l
(r sin + c cos )]
and =
2013-03-08
2D Sinusoids:
... are plane waves with grayscale amplitudes, periods in terms of lengths, ...
I ( r , c) =
orientation
= phase shift
2013-03-08 1999-2013 by Richard Alan Peters II 45
2D Sinusoids:
2013-03-08
46
I
2013-03-08
Re[F{I}]
1999-2013 by Richard Alan Peters II
Im[F{I}]
47
2013-03-08
48
u = C u wf
and v =
R v
pixels,
of a digital image
-1
The frequency is the fraction of the sinusoid traversed over one pixel,
u u = C , v = v R
- direction
, and
(0,0)
u direction
wf =
2013-03-08
p. 49.
51
2013-03-08
*See
p. 49.
53
I
2013-03-08
log{|F{I}|2+1}
1999-2013 by Richard Alan Peters II
[F{I}]
55
I
2013-03-08
Re[F{I}]
1999-2013 by Richard Alan Peters II
Im[F{I}]
56
At each location (u,v) it indicates the squared intensity of the frequency component with period l = 1 / u 2 + v 2 and orientation
q = tan -1 (v / u ).
For display in Matlab: PS = fftshift(2*log(abs(fft2(I))+1));
2013-03-08 1999-2013 by Richard Alan Peters II 57
If the PS is being calculated for later computational use -- for example the autocorrelation of a function is the inverse FT of the PS of the function -- it should be calculated by >> PS = abs(fft2(I)).^2;
2013-03-08
58
FT
If x y is the extent of the object in space and if u v is its extent in frequency then, x y u v 1 16 2
space
frequency
FT
2013-03-08
IFT
Recall: a symmetric pair of impulses in the frequency domain becomes a sinusoid in the spatial domain. A symmetric pair of lines in the frequency domain becomes a sinusoidal line in the spatial domain.
IFT
edge
Power Spectrum
Phase Spectrum
2013-03-08
61
bar
Power Spectrum
Phase Spectrum
2013-03-08
62
Image Origin
Image Origin
J = fftshift(I):
origin
after fftshift
5 1 4 7 2 5 8 3 6 9 2 8
6 9
4 7
u = C u wf
and v =
R v
pixels,
of a digital image
-1
The frequency is the fraction of the sinusoid traversed over one pixel,
u u = C , v = v R
- direction
, and
(0,0)
u direction
wf =
2013-03-08
2013-03-08
67
Since rows increase down and columns to the right, slopes and angles are opposite those of a right-handed coordinate system.
2013-03-08 1999-2013 by Richard Alan Peters II 68
fftshifted
fftshifted
fftshifted
fftshifted
fftshifted
fftshifted
fftshifted
+v direction
Note this
and this.
384 rows
+u direction
u = C / u
384 rows
384 rows
v = R / v
u = C / u
384 rows
384 rows
v = R / v
u = C / u
384 rows
384 rows
v = R / v
In the Fourier plane of a square image, the orientation of the line through the point pair = the orientation of the wave front in the image. Not so for a non-square image.
In the F plane the angle is -45 in this image its about -53 (yellow line). Thats because the fraction of R covered by one pixel is 4/3 the fraction of C covered by one pixel.
384 rows
In general the slope of the wavefront direction in the image is given by (v/R) / (u/C). Therefore its angle is
uR
512 columns
wf 384 rows
-1
wf
wf
84
384 rows
384 rows
The ratio R/C = in this image. Therefore at frequency (4,3) the wave front angle is
-1 3 512 -1 3 4 = tan -1 ( tan tan 1 45 ,Fourier = = = ) Frequencies and Wavelengths in the wf 4 3 4 384
Plane
wf wf
83.67,
2013-03-08
2013-03-08
88
power spectrum
phase
2013-03-08
89
2013-03-08
90
2013-03-08
91
Fourier Magnitude
log
F {I}
2013-03-08
92
Fourier Phase
F { I}
2013-03-08
93
original image
Fourier phase
2013-03-08
94
2013-03-08
95
2013-03-08
96