Lecture 7 Transformations in frequency domain 1.Basic steps in frequency domain transformation...

Post on 18-Jan-2016

221 views 0 download

Tags:

Transcript of Lecture 7 Transformations in frequency domain 1.Basic steps in frequency domain transformation...

Lecture 7 Transformations in frequency domain

1. Basic steps in frequency domain transformation

2. Fourier transformation theory in 1-D

2

Basic steps for filtering in the frequency domain

Takes spatial data and transforms it into frequency dataThe transformation is done by Fourier transformation

The most common image transform takes spatial data and transforms it into frequency data

Complex numbers and expression

2 2 1

0 0 0 0

( ) ( 1) ( 1)cos sin

! ! (2 )! (2 1)!

n n n n n n ni

n n n n

i ie i i

n n n n

2 2

1

(cos sin ) Re

, tan

i

i

a ib R i

aR a b

b

a

bR

θ

Fourier series

• The Fourier transform is a method of expressing a periodic function with period 2T in terms of the sum of its projections onto a set of basis functions

• Fourier series: f(x) is periodic [-T, T]

01 1

0

1( ) cos( ) sin( ),

2

1 1( ) , ( ) ( )

1( )sin( ) , 1, 2,3

n nn n

T T

nT T

T

n T

n x n xf x a a b

T T

n xa f x dx a f x cos dx

T T Tn x

b f x dx nT T

{sin( ),cos( ), 0, 1, 2,...}nx nx

nT T

Example of Fourier decomposition

Example by Maple

=

Maple commands

> f := piecewise(x < -1, x+2, x < 1, x, x < 3, x-2);> plot(f, x = -3..3, discont=true);> an := Int(x*cos(n*Pi*x), x = -1..1);> an := int(x*cos(n*Pi*x), x = -1..1); > bn := int(x*sin(n*Pi*x), x = -1..1);> with(plots):> F1 := plot(f, x = -3..3, discont=true, color=black):> S1 := sum(bn*sin(n*Pi*x), n = 1..1):> S2 := sum(bn*sin(n*Pi*x), n = 1..2):> S5 := sum(bn*sin(n*Pi*x), n = 1..5):> S20 := sum(bn*sin(n*Pi*x), n = 1..20):> F2 := plot({S1,S2,S5,S20}, x = -3..3):> display({F1,F2});

Fourier series in general form

01 1

01 1

Proof 1: ( ) 2 ,

1( ) , 0, 1,...

21

Proof 2: ( ) cos( ) sin( )2

1 1( ) (

2 2 2

m n mT Ti x i x i x

T T Tn mT T

n

nT i x

Tn T

n nn n

n x n x n x ni i i i

T T Tn n

n n

f x e dx c e e dx Tc

c f x e dx nT

n x n xf x a a b

T T

ia a e e b e e

01 1

0 0

)

1

2 2 2

,

1, , 0; , 0

2 2 2

x

T

n x n xi i

n n n nT T

n n

n xi

Tn

n

n n n nn n

a ib a iba e e

c e

a ib a ibc a c n c n

1( ) , ( ) , 0, 1,...

2

n nTi x i x

T Tn n T

n

f x c e c f x e dx nT

Continue

When 0,

1 1( )cos( ) ( )sin( )

2 2 21

( )(cos( ) sin( ))2

1( )

2When 0,

1 1 1( ( )cos( ) ( )sin( ) )

2 2

1

2

T Tn n

n T T

T

T

n xT i

T

T

T Tn n

n T T

n

a ib n x n xc f x dx i f x dx

T T T Tn x n x

f x i dxT T T

f x e dxT

n

a ib n x n xc f x dx i f x dx

T T T T

fT

1

( )(cos( ) sin( )) ( )2

n xT T i

T

T T

n x n xx i dx f x e dx

T T T

Fourier transformation

2

2

Define

( )} ( ) ( )

the Fourier transfomrarion of ( )

Define { ( )} ( )

the inverse Fourier transfomrarion of F( )

iux

iux

f x F u f x e dx

f x

F u F u e du

u

-1

F{

F

Fourier series and Fourier transformation

1

2 22

2

1( ) , ( ) , 0, 1,...

2

1Consider when T , ,

2 2

( ) 2 ( ) ( )

( ) ( )

( ) (2 )

n

n

n nTi x i x

T Tn n T

n

n n n n

nT Ti x iu xT

n n T T

iu xn

ni x

Tn n

n n

f x c e c f x e dx nT

nu u u u

T T

c u Tc f x e dx f x e dx

f x e dx F u

f x c e Tc

2 2

2 2

2

2

(2 )

( ) ( )

Define ( )} ( ) ( ) the Fourier transfomrarion of ( )

Define { ( )} ( ) inverse Fourier tran

n n

n

ik x iu xn n n

n

iu x iuxn n

n

iux

iux

e k Tc e u

c u e u F u e du

f x F u f x e dx f x

F u F u e du

-1

F{

F sfomrarion of F( )u

Fourier Transform – 1D

• Fourier: Every periodic function f(x) can be decomposed into a set of sin() and cos() functions of different frequencies, given by

F(u) is called the Fourier transformation of f(x). F(u) =R(u)+iI(u) repesents magnitudes cos and sin at frequency u. So we say F(u) is in the Frequency domain.

Conversely, given F(u), we can get f(x) back using the inverse Fourier transformation

2( ) ( ) ( ) { ( )}iuxF u f x e dx F u f x

, F

2{ ( )} ( )

{ ( )} { ( )}} ( )

iuxF u F u e du

F u f x f x

-1

-1 -1

F

F F F{

Fourier Spectrum

• Fourier decomposition: • Fourier spectrum:• Fourier phase:• Decomposition:

2 2

1

( ) ( ) ( )

| ( ) | ( ) ( )

( ) tan ( ( ) / ( ))

( ) | ( ) | exp( )

F u R u iI u

F u R u I u

u I u R u

F u F u i

Properties of Fourier transformation

• Linear

2

2 2

2 2

{ ( ) ( )} { ( )} { ( )}

{ ( ) ( )} [ ( ) ( )]

( ) ( )

( ) ( )

{ ( )} { ( )}

iux

iux iux

iux iux

Af x Bg x A f x B g x

Af x Bg x Af x Bg x e dx

Af x e dx Bg x e dx

A f x e dx B g x e dx

A f x B g x

F F F

F

= +

+

= F F

Fourier transformation and Convolution

Convolution Theorem: assumethen

Proof

2

2

2 2

( ) ( ) ( ) ( )

{ ( ) ( )} [ ( ) ( ) ]

( )[ ( ) ]

( )[ ( ) ] ( ) ( ) ( ) ( )

i ut

i ut

i ux i ux

f t h t f x h t x dx

f t h t f x h t x dx e dt

f x h t x e dt dx

f x H u e dx H u f x e dx H u F u

F

{ ( )} ( ), { ( )} ( )

{ ( ) ( )} ( ) ( )

( ) ( ) ( ) ( )

( ) ( ) ( ) ( )

f t F u h t H u

f t h t F u H u

f t h t H u F u

f t h t H u F u

F F

F

Example 1

/ 22 2

/ 2

/ 22

/ 2

, / 2 / 2( )

0,

( ) ( )

sin( )

2 2

Wiut iut

W

Wiut iuW iuW

W

A W t Wf t

otherwise

F u f t e dt Ae dt

A A uWe e e AW

i u i u uW

Sinc(x)=sin(x)/x

Example 2

0

0 0

2 2

2 0

2 20 0

20

, 0( ) , ( ) 1,

0, 0

( ) ( ) (0), ( ) ( ) ( )

( ) ( ) ( )

1

( ) ( ) ( )

cos(2 ) sin(2

iut iut

iu

iut iut

iut

tt t dt

i

f t t dt f f t t t dt f t

F u t e dt e t dt

e

F u t t e dt e t t dt

e ut i u

0 )

( ) ( )

{ ( )} { ( )} (cos(2 ) sin(2 ))

Tn

Tn n

t

com x x nT

com x x nT unT i unT

F F

Impulse function and its Fourier transformation

Examples

Example: Discrete impulse function

• Unit discrete impulse function

• Impulse train function

0 0

1, 0( ) , ( ) 1

0, 0

( ) ( ) (0), ( ) ( ) ( )

x

x x

tt t

i

f x x f f x x x f x

( ) ( )Tx

S t t n T

Fourier transformation of impulse train

2 2/ 2 0

/ 2

2

2

2

2

( ) ( )

1 1 1( ) , ( )

1( )

{ } ( )

1( ) { ( )} { }

1 1{ } ( )

Tx

n nTj j t

T TT n n TT

n

nj

TT

n

nj t

T

nj

TT

n

nj

T

n n

S t t n T

S t c e c S t e dt eT T T

S t eT

ne u

T

S u S t eT

ne u

T T T

F

F F

F

Sampling and FT of Sampled Function

• Sampled function~

( ) ( ) ( ) ( ) ( )Tx

f t f x S t f t t n T

Sampling and FT of Sampled Function

• The value of each sample (strength of the weighted impulse)

~ ~

( ) ( ) ( )

( ) { ( )} { ( ) ( )}

( )* ( )

( ) ( )

1( ) ( )

1( ) ( )

1( )

k

T

n

n

n

f f t t n T dt f k T

F u f t f x S t

F u S u

F x S u x dx

nF x u dx

T T

nF x u t dx

T T

nF u

T T

F F

The Sampling Theorem

• Band-limited function f(t), its FT F(u) = 0 when u < -umax or u>umax

• Let be the sampling function of f(t), and be its FT

Question: if f(t) can be recovered from• Sampling Theorem: if then f(t) can be recovered

max

12U

T

~

( )F u~

( )f t

max max

~

~

~

,( )

0

( ) ( ) ( )

( ) { ( )}

{ ( ) ( )}

( )* ( )

( )sin [( ) / ]n

T u u uH u

otherwise

F u H u F u

f t F u

H u F u

h t f t

f n T c t n T n T

-1

-1

F

F

The Sampling Theorem

• Sampling:– Over-sampling– Critically-sampling– Under-sampling

• Aliasing: f(t) is

corrupted

max

12U

T

Discrete Fourier Transform(DFT)

• Derive DFT from continuous FT of sampled function

~ ~2

2

2

2

12 /

0

12 /

0

( ) ( )

( ) ( )

( ) ( )

, 0,1,..., 1

, 0,1,..., 1

1, 0,1,...,

iut

iut

n

iut

n n

iun Tn

n

Mimn M

m nn

Mimn M

n mm

F u f t e dt

f t t n t e dt

f t t n t e dt

f e

mu m M

M T

F f e m M

f F e nM

=

1M

DFT

1

0

( ) ( )

( ) ( )

( )* ( ) ( ) ( )M

m

F u F u kM

f x f x kM

f x h x f m h x m

-1-2 /

0

-12 /

0

( ) ( ) , 0,1,..., -1

1( ) ( ) , 0,1,..., -1

Mxu M

x

Mixu M

u

F u f n e u M

f x F u e x MM

Matrix representation

2

0 0 0 1 0 ( 1)

1 0 1 1 1 ( 1)

( 1) 0 ( 1) 1 ( 1) ( 1)

0 0 0 1

(0) (0)...

(1) (1)...

( 1) ( 1)...

(0) ..

(1)

( 1)

i

MM

MM M M

MM M M

M M M MM M M

M M

e

F f

F f

F M f M

f

f

f M

10 ( 1)

1 0 1 1 1 ( 1)

( 1) 0 ( 1) 1 ( 1) ( 1)

0 0 0 1 0 ( 1)

1 0 1 1 1 ( 1)

( 1) 0 ( 1) 1 ( 1

(0).

(1)...

( 1)...

...

...1

...

MM

MM N M

M M M MM M M

MM M M

MM M M

M M MM M M

F

F

F M

M

) ( 1)

(0)

(1)

( 1)M

F

F

F M

Example

3

0

32 (1) / 4 0 / 2 3 / 2

0

32 (2) / 4 0 2 3

0

32 (3) / 4 0 3 / 2

0

(0) ( ) [ (0) (1) (2) (3)]

1 2 4 4 11

(1) ( ) 1 2 4 4 3 2

(2) ( ) 1 2 4 4 1

(3) ( ) 1 2 4

x

i x i i i

x

i x i i i

x

i x i i

x

F f x f f f f

F f x e e e e e i

F f x e e e e e

F f x e e e e

6 / 2 9 / 2

3 32 (0)

0 0

4 3 2

1 1 1(0) ( ) ( ) [11 3 2 1 3 2 ] 1

4 4 4

i

iu

u u

e i

f F u e F u i i