DREAM PLAN IDEA IMPLEMENTATION 1
Jan 07, 2016
DREAMDREAM
PLANPLANIDEAIDEA
IMPLEMENTATIONIMPLEMENTATION1
3
Introduction to Image ProcessingIntroduction to Image Processing
Dr. Kourosh KianiEmail: [email protected]: [email protected]: [email protected]: www.kouroshkiani.com
Present to:Amirkabir University of Technology (Tehran
Polytechnic) & Semnan University
4
Lecture 07FOURIER SERIES
Lecture 07FOURIER SERIES
5
Periodic functions play a very important role in the study of dynamical systems Definition: A function f (t) is said to be periodic of period T, if for all t D(f) , we have f (t + T) = f (t)
Periodic Functions
otherwise
Ttfortftf
0
0)()(
6
otherwise
TtTfortfTtuTtf
0
2)()()(
)3()3()2()2()()()()( TtuTtfTtuTtfTtuTtftftf
0
)()()(n
nTtunTtftf
7
Periodic Signals
A periodic signal f(t)Unchanged when time-shifted by one periodTwo-sided: extent is t (-, )May be generated by periodically extending one periodArea under f(t) over any interval of duration equal to the period is
the same; e.g., integrating from 0 to T0 would give the same value as integrating from –T0/2 to T0 /2
n
nTtunTtftf )()()(
8
Samples of periodic signalsA
mpl
itude
(v
olts
)A
mpl
itude
(v
olts
)
0
A
A
-A
0
-A
T=1/f
T=1/f
Sine Wave
Square Wave
Am
plitu
de
(vol
ts)
A
0
-A
T=1/f
Triangular Wave
9
3602360
)sin()(
incyclesnnn
amplitudeA
ntAtf
2
1
2
1
360
1
)sin()(
amplitude
ttf
2
2
2
360
5
)2sin(5)(
amplitude
ttf
10
Examples
)sin()( ttf )3sin(3
1)( ttf
11
Function Amplitude Period
3
2
1
5
)5sin(3)( ttf 5
2
)3cos(2)( ttf 3
2
)2
sin()(t
tf 4
)4cos(5)( ttf 2
Examples
12
Common PeriodConsider two periodic function f1(t) and f2(t) with respectively periods T1 and T2. If the ratio T1/T2 is a rational number, then
T=n1T1=n2T2
is a common period of f1(t) and f2(t)
2
1
2
1
2222
1111
2)cos()(
2)cos()(
w
w
T
T
wTtwtf
wTtwtf
If T1/T2 is a rational number, the cos(w1t) and cos(w2t) have a common period. If T1/T2 is irrational, they do not have a common period.
13
ExampleWhat is period of the function
)22cos()20cos()( tttf
20
2220)20cos()(
1111
wTwttf
22
2222)22cos()(
2222
wTwttf
1122
210
20
21110
10
11
222202
212
1 TTTT
T
14
ExampleWhat is period of the function
)2cos()cos()( tttf
2
1
221)cos()(
1111
wTwttf
2
222)2cos()(
2222
wTwttf
2
2
22
2
1
T
TThe f(t) is not periodic.
15
ExampleWhat is period of the function
)cos(4
3)3cos(
4
1)( tttf
3
223)3cos(
4
1)(
1111
wTwttf
2
1
221)cos(
4
3)(
2222 w
Twttf
21.233
21.3.
3
1
123
2
212
1 TTTT
T
16
ExampleWhat is period of the function
8
3)2cos(
2
1)4cos(
8
1)( tttf
24
224)4cos(
8
1)(
1111
wTwttf
2
222)2cos(
2
1)(
2222 wTwttf
1.22
1.2.2
1
1
221
2
1 TTTT
T
8
3)(3 tf
17
Analytic description of a periodic function
18
Analytic description of a periodic function
19
Analytic description of a periodic function
20
Analytic description of a periodic function
21
Analytic description of a periodic function
22
Orthogonal functionsIf two different functions f(x) and g(x) are defined on the interval a ≤x≤ b and
Then we say that the two functions are orthogonal to each other on the interval a ≤x≤ b. The trigonometric functions sin(nx) and cos(nx) where n=0, 1, 2,…. Form an infinite collection of periodic functions that are mutually orthogonal on the interval , indeed on any interval of width That is
b
a
dxxgxf 0)()(
x 2
nmfordxnxmx
0)cos()cos( nmfordxnxmx
0)sin()sin(
0)sin()cos( dxnxmx
23
Fourier seriesWe turn now to our main objective: the study of properties of linear combinations of the functions
These functions are periodic with common period .
Therefore, any linear combination is also periodic with period T.
The most general function that can be so formed is an infinite sum:
This is the Fourier series expansion of f(x) where the an and bn are constants called the Fourier coefficients. But how do we find the values of these constants?
)sin()cos( 00 tnandtn
0
2
T
1
0 )sin()cos(2
)(n
nn nxbnxaa
tf
24
Fourier coefficients
dxmxxfa
so
abaa
dxmxnxbdxmxnxadxmxa
mxnxbnxaa
dxmxtf
m
nmn
nmnn
nn
nn
nnn
)cos()(1
002
)cos()sin()cos()cos()cos(2
)cos()sin()cos(2
)cos()(
11
0
11
0
1
0
1
0 )sin()cos(2
)(n
nn nxbnxaa
tf
25
Fourier coefficients
dxmxxfb
so
bbaa
dxmxnxbdxmxnxadxmxa
mxnxbnxaa
dxmxtf
m
nmmnn
nn
nn
nn
nnn
)sin()(1
002
)sin()sin()sin()cos()sin(2
)sin()sin()cos(2
)sin()(
1,
1
0
11
0
1
0
1
0 )sin()cos(2
)(n
nn nxbnxaa
tf
26
Summary Fourier series
1
0 )sin()cos(2
)(n
nn nxbnxaa
tf
0)2
cos()(2 2
2
ndxT
xnxf
Ta
T
Tn
0)2
sin()(2 2
2
ndxT
xnxf
Tb
T
Tn
2
2
0 )(1
T
T
dxxfT
a
27
Dirichlet ConditionsIf a function f(t) is such that:(a) f(t) is defined, single-valued and periodic(b) f(t) and f ’(t) have at most a finite number of finite discontinuities
over a single period – that is they are piecewise continuous.Then the series
Where
Converges to f(t)
1
0 )sin()cos(2 n
nn nxbnxaa
2
2
)cos()(2
T
Tn dxnxxfT
a
2
2
)sin()(2
T
Tn dxnxxfT
b
28
Example
29
30
31
Fourier components of square wave
)}3{2sin(
3
1)2sin(
4)( tftfts
1,0
0.0
-1.0
0.0 0.50T 1.00T 1.50T 1.75T0.25T 0.75T 1.25T 2.00T
0.0 0.50T
1.00T
1.50T
1.75T
0.25T
0.75T
1.25T
2.00T
1,0
0.0
-1.0
)(ts
)(ts
32
The spectrum of a signal is a graphical representation of the relative amounts of signal as a function of frequency.
Fourier components and spectra of square wave
Modified from Stallings (2000) fig. 3.5
)ff()ff()f(S
)t}f{sin()tfsin()t(s
00 3314
3231
24
0 f 2f 3f 4f
0.0 0.50T 1.00T 1.50T 1.75T0.25T 0.75T 1.25T 2.00T
..1,0
0.0
-1.0
1.5
1.0
0.5
0.0
)(ts
)( fS
33
Fourier components of a square wave
)}7{2sin(
7
1)}5{2sin(
5
1)}3{2sin(
3
1)2sin(
4)( tftftftfts
0.0 0.50T 1.00T 1.50T 1.75T0.25T 0.75T 1.25T 2.00T
0.0 0.50T 1.00T 1.50T 1.75T0.25T 0.75T 1.25T 2.00T
1,0
0.0
-1.0
1,0
0.0
-1.0
)(ts
)(ts
34
)7(7
1)5(
5
1)3(
3
1)(
4)(
)}7{2sin(7
1)}5{2sin(
5
1)}3{2sin(
3
1)2sin(
4)(
0000 fffffffffS
tftftftfts
)( fS
0.0 0.50T 1.00T 1.50T 1.75T0.25T 0.75T 1.25T 2.00T
1.5
1.0
0.5
0.0
0 1f 2f 3f 4f 5f 6f 7f 8f 9f
1,0
0.0
-1.0
)(ts
Fourier components and spectra of square wave
35
Spectrum
f 3f 5f
f 3f 5f 9f7f
7f 9f
Fourier components and spectra of wave
36
The absolute bandwidth of a signal is the width of the spectrum, that is the width of the frequency range containing any signalThe effective bandwidth of a signal is the width of the portion of the spectrum containing ‘significant’ energy
)( fS
0.0 0.50T 1.00T 1.50T 1.75T0.25T 0.75T 1.25T 2.00T
1,0
0.0
-1.0
)(ts
Bandwidth = 7f –f = 6f
1.5
1.0
0.5
0.00 1f 2f 3f 4f 5f 6f 7f 8f 9f
)7(7
1)5(
5
1)3(
3
1)(
4)(
)}7{2sin(7
1)}5{2sin(
5
1)}3{2sin(
3
1)2sin(
4)(
0000 fffffffffS
tftftftfts
37
38
39
40
41
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
Ideally need infinite terms.
42
Fourier series with n = 20 Fourier series with n = 100
43
44
Example. Find the Fourier series of the function
xxxf )(
Answer. Since f(x) is odd, then an = 0, for n≥0. We turn our attention to the coefficients bn. For any n≥0 , we have
12
)1(2
)cos(2)sin()cos(1
)sin(1
n
n nnx
nn
nx
n
nxxdxnxxb
3
)3sin(
2
)2sin()sin(2)(
xxxxf
45
Example. Find the Fourier series of the function
x
xxf
0
00)(
10)cos(1
20
1
0
0
00
ndxnxadxdxa n
nn nnx
ndxnxb )1(1
1)cos(1
1)sin(
1
0
12
20 122
nbb nn
5
)5sin(
3
)3sin()sin(2
2)(
xxxxf
46
Example. Find the Fourier series of the function
x
xxf
02
02)( 0
22
1 0
00
dxdxa
Since this function is the function of the example above minus the constant . So Therefore, the Fourier series of f(x) is 2
5
)5sin(
3
)3sin()sin(2)(
xxxxf
47
Example. Find the Fourier series of the function
20
020)(
xx
xxf
1)1(2)cos(2
)2
sin(4
2
1)1)1(()2
(2
1)1)(cos()
2(
2
1)
2cos(
4
2
2
10
4
1
4
1
1
0
22
0
0
2
2
0
2
20
nfornn
ndx
xnxb
nforn
nn
dxx
nxa
xdxdxxdxa
nn
nn
1
122
)2
sin()1(2
)2
cos()1)1((2
2
1)(
n
nn xn
n
xn
nxf
48
Example
. as amplitudein decrease and
161
8 504.0 2sin
2
161
2 504.0 2cos
2
504.0121
2sin2cos
20
2
20
2
2
0
20
10
nba
n
ndtnteb
ndtntea
edtea
ntbntaatf
nn
t
n
t
n
t
nnn
Fundamental period
T0 = p Fundamental frequency
f0 = 1/T0 = 1/ p Hz
w0 = 2 p /T0 = 2 rad/s
0 p-p
1e-t/2
f(t)
12
2sin42cos161
21504.0
n
ntnntn
tf
49
Example
Fundamental period
T0 = 2 Fundamental frequency
f0 = 1/T0 = 1/2 Hz
w0 = 2p/T0 = p rad/s
0 1-1
A
f(t)
-A
,15,11,7,38
,13,9,5,18
even is 0
22
22
nn
A
nn
An
bn
2/3
2/1
2/1
2/1
0
10
) sin( ) 22(2
2
) sin( 22
2
symmetric) odd isit (because 0
plot) theof inspection(by 0
sin) cos(
dttnπtAA
dttnπtAb
a
a
tnπbtnπaatf
n
n
nnn
50
Gibbs phenomenonGibbs phenomenon
-1.5
-1
-0.5
0
0.5
1
1.5
0 2 4 6 8 10t
sq
ua
re s
ign
al,
sw
(t)
79
1kk79 sin(kt)b-(t)sw
Overshoot exist @ each discontinuity
• Max overshoot pk-to-pk = 8.95% of discontinuity magnitude.Just a minor annoyance.
• FS converges to (-1+1)/2 = 0 @ discontinuities, in this case.
• First observed by Michelson, 1898. Explained by Gibbs.
Questions? Discussion? Suggestions?
52