Professional Documents
Culture Documents
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.
image
sound
code
01101000101101110110010110001
2013-03-08
2013-03-08
Origin of Sounds
2013-03-08
internal pressure
string modes
pipe modes
2013-03-08
Note that
the modes
are all
sinusoids.
Note that
the negatives
of these also
will occur
Sound Waves:
pipe sound
string sound
2013-03-08
Sound Waves:
Odd-order
harmonics
pipe sound
2013-03-08
string sound
Even-order
harmonics
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
+
(
)
n=- 2n + 1
Frequency-Domain Representation
Any periodic signal can be described by a sum of sinusoids.
sq (t ) =
2p
1
n
t
sin
2
1
+
(
)
n=- 2n + 1
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
+
(
)
n=- 2n + 1
The Fourier
coefficients
(of a square
wave).
11
1 sine
2 sines
4 sines
the limit as n
approaches
infinity of the
sum of n sines.
1
8 sines
2013-03-08
16 sines
1999-2013 by Richard Alan Peters II
32 sines
12
Anatomy of a Sinusoid
f (t)
2p
f (t ) = A sin t - f
l
2013-03-08
13
f,g =
f (t ) g * (t ) dt
-l /2
14
Inner Products
a function, f
1024
g is a component of f
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
f (t )h(t )dt 0
2013-03-08
16
3 different
representations
2013-03-08
17
2013-03-08
18
2013-03-08
19
f (t ) = A0 +
n=1
2p n
2p n
An cos
t + Bn sin
t
l
l
2
An =
l
2
Bn =
l
2013-03-08
l /2
-l /2
l /2
-l /2
The representation of a
function by its Fourier
Series is the sum of sinusoidal basis functions
multiplied by coefficients.
2p n
f (t ) cos
t - jn dt for n 0
2p n
f (t ) sin
t - jn dt for n 0
20
Ce
n
n=-
i 2lpn t
Cn e
2 pn
+
+fn
l
n=-
2pn
2pn
+
+
+
cos
f
sin
f
C
t
C
t
n
n
n
n
l
l
n=-
Cn = Cn e
+ ifn
l /2
2 pn
-i
t
1
l
dt
= f (t ) e
l -l /2
l /2
2p n
2p n
1
= f (t ) cos
t + fn + Cn sin
t + fn dt
l
l -l /2
2013-03-08
i = -1
Cn = Cn e+ifn
eix = cos x + i sin x
f (t + nl ) = f (t )
for all integers n
21
2pn
l
l /2
l /2
2
= f (h ) cos wn h d h cos wnt + f (h ) sin wn h d h sin wn t
l n=0 -l /2
-l /2
l /2
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
22
0=
sin (w h - w t ).
n
n=-
l /2
Therefore:
-l /2
Thus:
n=-
l /2
1
-i f (h ) sin (wn h - wn t ) d h = 0.
l n=- -l /2
Then add
zero to the
equation at
the end of
the previous
page:
l /2
l /2
1
1
2013-03-08
23
1
1
l /2
1
= f (h )[cos wn (h - t ) - i sin wn (h - t )] d h
l n=- -l /2
l /2
1
= f (h ) e-iwn (h-t )d h
l n=- -l /2
l /2
2 pn
2 pn
h
-i
+i
t
1
l
l
h
h
f
e
d
e
=
(
)
n=- l -l /2
Ce
n
n=-
2013-03-08
i 2lpn t
n=-
ifn
Cn e e
i 2lpn t
Cn e
t f
2 pn
+
+ n
l
n=-
24
1
1
l /2
1
= f (h )[cos wn (h - t ) - i sin wn (h - t )] d h
l n=- -l /2
l /2
1
= f (h ) e-iwn (h-t )d h
l n=- -l /2
l /2
2 pn
2 pn
h
-i
+i
t
1
l
l
h
h
f
e
d
e
=
(
)
n=- l -l /2
Ce
n
n=-
2013-03-08
i 2lpn t
n=-
ifn
Cn e e
i 2lpn t
Cn e
t f
2 pn
+
+ n
l
n=-
25
Cn e
+i
2 pn
t
l
where Cn = Cn e +ifn .
n=-
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 / .
2013-03-08
intensity
0
0
frequency, = 1/
26
F (w ) = ( N2A co s )[d (w + N l ) + d (w - N l )]
+ i ( N2A sin )[- d (w + N l ) + d (w - N l )]
27
Real + Imaginary to
Magnitude & Phase
28
Real + Imaginary to
Magnitude & Phase
29
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
-i 2 p w t
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
N 1
hk = H n e i 2 k n /N
n= 0
1 N 1
Hn =
hk e +i 2 k n /N
N k=0
2013-03-08
33
2013-03-08
34
F (w ) = f (t ) e-i 2 p w t dt = f (t ) , e+ i 2 p w t
-
continuous signals
defined over all
real numbers
and
1
Hn =
N
N -1
he
-i 2 p k n / N
= hk , e
+i 2 p k n /N
n= 0
discrete signals
with N terms or
samples.
35
{ e-i2pw t
w and w (- , )
, if w 1= w 2
if w 1 w 2
-i 2 p j n / N
-i 2 p k n / N
, e
= e-i 2 p j n /N e+i 2 p k n /N = { 0,
N -1
c , if j = k
if j k
n= 0
The function
sets are called
orthogonal
basis sets
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
-i 2 p w t
2013-03-08
N -1
d w and hk = H n e-i 2p k n /N .
n= 0
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
- -
=
j m k n
-i 2 p 1 + 1
M
N
j m k n
-i 2 p 2 + 2
M
N
, e
M -1 N -1
m= 0 n= 0
-i 2 p
= e
=
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
j= 0 k = 0
- -
F (u , v) =
M -1 N -1
jm kn
-i 2 p +
M
N
- -
38
2013-03-08
39
2013-03-08
40
2013-03-08
41
I ( r , c ) = I ( v ,u ) e
vr uc
+ i 2 p +
R C
u =0 v=0
where
R-1 C -1
these complex
exponentials are
2D sinusoids.
vr uc
-i 2 p +
R C
c=0
42
i 2
vr
R
+ uc
C
=e
2
(vr + uc)
N
=e
2
( r sin + c cos)
N
where
N
= ,
w
i 2 p l1 (r sin + c cos)
= tan -1 ( uv ) .
2013-03-08
43
Re e
i 2 p l1 (r sin + c cos)
} = + cos[
2p
l
(r sin + c cos )]
2p
l
(r sin + c cos )]
Im e
i 2 p l1 (r sin + c cos)
} = sin [
w
2pw
is the radian frequency, and
the frequency, of the wavefront
N
N
and =
2013-03-08
N
is the wavelength in pixels in the wavefront direction.
w
1999-2013 by Richard Alan Peters II
44
2D Sinusoids:
I ( r , c) =
2p
A
cos (r sin + c cos ) + j + 1
l
orientation
= phase shift
2013-03-08
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 = Cu
and v =
R
v
-v direction
pixels,
wf
More about
this later
(pp. 66-87).
of a digital image
-1
2
2 2
= RC (uR) + (vC ) .
wf =
v
R
, and
1
2
2
(uR) + (vC ) cycles.
RC
(0,0)
wf = tan -1 ( v ) = tan -1 ( vu CR ).
u
2013-03-08
row freq.
column freq.
1999-2013 by Richard Alan Peters II
u direction
u = Cu , v =
- direction
x
This point represents this particular sinusoidal grating
2013-03-08
50
*See
p. 49.
51
52
2013-03-08
*See
p. 49.
53
54
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
For display,
the log of
the power
spectrum is
often used.
= [ Re I (u ,v)] + [ Im I (u ,v)] .
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
frequency
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
space
frequency
FT
2013-03-08
1
16 2
59
IFT
small extent
large extent
space
IFT
2013-03-08
A symmetric pair of
lines in the frequency
domain becomes a
sinusoidal line in the
spatial domain.
large extent
frequency
small extent
Recall: a symmetric
pair of impulses in the
frequency domain
becomes a sinusoid in
the spatial domain.
small extent
space
large extent
frequency
large extent
1999-2013 by Richard Alan Peters II
60
edge
2013-03-08
Power Spectrum
Phase Spectrum
61
bar
2013-03-08
Power Spectrum
Phase Spectrum
62
Center =
(floor(R/2)+1, floor(C/2)+1)
Even
Odd
Even
Odd
Image Origin
Image Origin
2013-03-08
63
J = fftshift(I):
origin
origin
from FFT2
or ifftshift
after fftshift
64
I = ifftshift(J):
J ( R/2 +1, C/2 +1) I (1,1)
65
u = Cu
and v =
R
v
-v direction
pixels,
wf
of a digital image
-1
2
2 2
= RC (uR) + (vC ) .
wf =
v
R
, and
1
2
2
(uR) + (vC ) cycles.
RC
(0,0)
wf = tan -1 ( v ) = tan -1 ( vu CR ).
u
2013-03-08
row freq.
column freq.
1999-2013 by Richard Alan Peters II
u direction
u = Cu , v =
- direction
2013-03-08
67
(-r,+c)
(-r,-c)
>0
<0
<0
(+r,-c)
(-r,+c)
increasing cols
(+r,+c)
decreasing cols
(+r,-c)
>0
(+r,+c)
increasing rows
Since rows increase down and columns to the right, slopes and
angles are opposite those of a right-handed coordinate system.
2013-03-08
68
fftshifted
69
fftshifted
70
fftshifted
71
fftshifted
72
fftshifted
73
fftshifted
74
fftshifted
75
384 rows
+u direction
+v direction
Note this
and this.
76
u = C / u
384 rows
512 columns
u = # of complete cycles
in the horizontal direction
77
v = # of complete
cycles in the
vertical direction
v = R / v
384 rows
512 columns
78
u = C / u
384 rows
512 columns
u = # of complete cycles
in the horizontal direction
79
v = # of complete
cycles in the
vertical direction
v = R / v
384 rows
512 columns
80
u = C / u
384 rows
512 columns
u = # of complete cycles
in the horizontal direction
81
v = # of complete
cycles in the
vertical direction
v = R / v
384 rows
512 columns
82
384 rows
512 columns
83
Frequencies
and
vC Wavelengths in the Fourier Plane
= tan ,
-1
wf
uR
512 columns
wf
wf
384 rows
wf
-1
2
2 2
wavelengths: wf(=u, RC
v)(uR
= )(170
,128)
+ (vC
) .
84
384 rows
512 columns
85
384 rows
512 columns
86
= tan -1 (in
tan
tan
1
45
,Fourier
=
=
=
)
Frequencies
and
Wavelengths
the
wf
4 384
4 3
Plane
512 columns
wf
wf
384 rows
wf
2013-03-08
2
2
= 384 512 (3 384) + (4 512)
1
2
83.67,
87
2013-03-08
88
power spectrum
power spectrum
2013-03-08
phase
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
2013-03-08
Fourier log
magnitude
1999-2013 by Richard Alan Peters II
Fourier phase
94
2013-03-08
95
2013-03-08
96