54
Fourier Transform Naveen Sihag

Fourier transform

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Fourier transform

Fourier Transform

Naveen Sihag

Page 2: Fourier transform

Mathematical Background:Complex Numbers

• A complex number x is of the form:

a: real part, b: imaginary part

• Addition

• Multiplication

Page 3: Fourier transform

Mathematical Background:Complex Numbers (cont’d)

• Magnitude-Phase (i.e.,vector) representation

Magnitude:

Phase:

φPhase – Magnitude notation:

Page 4: Fourier transform

Mathematical Background:Complex Numbers (cont’d)

• Multiplication using magnitude-phase representation

• Complex conjugate

• Properties

Page 5: Fourier transform

Mathematical Background:Complex Numbers (cont’d)

• Euler’s formula

• Propertiesj

Page 6: Fourier transform

Mathematical Background:Sine and Cosine Functions

• Periodic functions

• General form of sine and cosine functions:

Page 7: Fourier transform

Mathematical Background:Sine and Cosine Functions

Special case: A=1, b=0, α=1

π

π

Page 8: Fourier transform

Mathematical Background:Sine and Cosine Functions (cont’d)

Note: cosine is a shifted sine function:

• Shifting or translating the sine function by a const b

cos( ) sin( )2

t t

Page 9: Fourier transform

Mathematical Background:Sine and Cosine Functions (cont’d)

• Changing the amplitude A

Page 10: Fourier transform

Mathematical Background:Sine and Cosine Functions (cont’d)

• Changing the period T=2π/|α| consider A=1, b=0: y=cos(αt)

period 2π/4=π/2

shorter period higher frequency(i.e., oscillates faster)

α =4

Frequency is defined as f=1/T

Alternative notation: sin(αt)=sin(2πt/T)=sin(2πft)

Page 11: Fourier transform

Image Transforms

• Many times, image processing tasks are best performed in a domain other than the spatial domain.

• Key steps:(1) Transform the image

(2) Carry the task(s) in the transformed domain.

(3) Apply inverse transform to return to the spatial domain.

Page 12: Fourier transform

Transformation Kernels

• Forward Transformation

• Inverse Transformation

1

0

1

0

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

x

N

y

NvMuvuyxryxfvuT

1

0

1

0

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

u

N

v

NyMxvuyxsvuTyxf

inverse transformation kernel

forward transformation kernel

Page 13: Fourier transform

Kernel Properties

• A kernel is said to be separable if:

• A kernel is said to be symmetric if:

),(),(),,,( 21 vyruxrvuyxr

),(),(),,,( 11 vyruxrvuyxr

Page 14: Fourier transform

Notation

• Continuous Fourier Transform (FT)

• Discrete Fourier Transform (DFT)

• Fast Fourier Transform (FFT)

Page 15: Fourier transform

Fourier Series Theorem

• Any periodic function can be expressed as a weighted sum (infinite) of sine and cosine functions of varying frequency:

is called the “fundamental frequency”

Page 16: Fourier transform

Fourier Series (cont’d)

α1

α2

α3

Page 17: Fourier transform

Continuous Fourier Transform (FT)

• Transforms a signal (i.e., function) from the spatial domain to the frequency domain.

where

(IFT)

Page 18: Fourier transform

Why is FT Useful?

• Easier to remove undesirable frequencies.

• Faster perform certain operations in the frequency domain than in the spatial domain.

Page 19: Fourier transform

Example: Removing undesirable frequencies

remove highfrequencies

reconstructedsignal

frequenciesnoisy signal

To remove certainfrequencies, set theircorresponding F(u)coefficients to zero!

Page 20: Fourier transform

How do frequencies show up in an image?

• Low frequencies correspond to slowly varying information (e.g., continuous surface).

• High frequencies correspond to quickly varying information (e.g., edges)

Original Image Low-passed

Page 21: Fourier transform

Example of noise reduction using FT

Page 22: Fourier transform

Frequency Filtering Steps

1. Take the FT of f(x):

2. Remove undesired frequencies:

3. Convert back to a signal:

We’ll talk more about this later .....

Page 23: Fourier transform

Definitions

• F(u) is a complex function:

• Magnitude of FT (spectrum):

• Phase of FT:

• Magnitude-Phase representation:

• Power of f(x): P(u)=|F(u)|2=

Page 24: Fourier transform

Example: rectangular pulse

rect(x) function sinc(x)=sin(x)/x

magnitude

Page 25: Fourier transform

Example: impulse or “delta” function

• Definition of delta function:

• Properties:

Page 26: Fourier transform

Example: impulse or “delta” function (cont’d)

• FT of delta function:

1

ux

Page 27: Fourier transform

Example: spatial/frequency shifts

)()()2(

)()()1(

),()(

02

20

0

0

uuFexf

uFexxf

thenuFxf

xuj

uxj

Special Cases:

020 )( uxjexx

)( 02 0 uue xuj

Page 28: Fourier transform

Example: sine and cosine functions

• FT of the cosine function

cos(2πu0x)

1/2

F(u)

Page 29: Fourier transform

Example: sine and cosine functions (cont’d)

• FT of the sine function

sin(2πu0x)-jF(u)

Page 30: Fourier transform

Extending FT in 2D

• Forward FT

• Inverse FT

Page 31: Fourier transform

Example: 2D rectangle function

• FT of 2D rectangle function

2D sinc()

Page 32: Fourier transform

Discrete Fourier Transform (DFT)

Page 33: Fourier transform

Discrete Fourier Transform (DFT) (cont’d)

• Forward DFT

• Inverse DFT

1/NΔx

Page 34: Fourier transform

Example

Page 35: Fourier transform

Extending DFT to 2D

• Assume that f(x,y) is M x N.

• Forward DFT

• Inverse DFT:

Page 36: Fourier transform

Extending DFT to 2D (cont’d)

• Special case: f(x,y) is N x N.

• Forward DFT

• Inverse DFT

u,v = 0,1,2, …, N-1

x,y = 0,1,2, …, N-1

Page 37: Fourier transform

Visualizing DFT

• Typically, we visualize |F(u,v)|

• The dynamic range of |F(u,v)| is typically very large

• Apply streching: (c is const)

before scaling after scalingoriginal image

Page 38: Fourier transform

DFT Properties: (1) Separability

• The 2D DFT can be computed using 1D transforms only:

Forward DFT:

Inverse DFT:

2 ( ) 2 ( ) 2 ( )ux vy ux vy

j j jN N Ne e e

kernel isseparable:

Page 39: Fourier transform

DFT Properties: (1) Separability (cont’d)

• Rewrite F(u,v) as follows:

• Let’s set:

• Then:

Page 40: Fourier transform

• How can we compute F(x,v)?

• How can we compute F(u,v)?

DFT Properties: (1) Separability (cont’d)

)

N x DFT of rows of f(x,y)

DFT of cols of F(x,v)

Page 41: Fourier transform

DFT Properties: (1) Separability (cont’d)

Page 42: Fourier transform

DFT Properties: (2) Periodicity

• The DFT and its inverse are periodic with period N

Page 43: Fourier transform

DFT Properties: (3) Symmetry

• If f(x,y) is real, then

(see Table 4.1 for more properties)

Page 44: Fourier transform

DFT Properties: (4) Translation

f(x,y) F(u,v)

) N

• Translation is spatial domain:

• Translation is frequency domain:

Page 45: Fourier transform

DFT Properties: (4) Translation (cont’d)

• Warning: to show a full period, we need to translate the origin of the transform at u=N/2 (or at (N/2,N/2) in 2D)

|F(u-N/2)|

|F(u)|

Page 46: Fourier transform

DFT Properties: (4) Translation (cont’d)

• To move F(u,v) at (N/2, N/2), take

Using ) N

Page 47: Fourier transform

DFT Properties: (4) Translation (cont’d)

no translation after translation

Page 48: Fourier transform

DFT Properties: (5) Rotation

• Rotating f(x,y) by θ rotates F(u,v) by θ

Page 49: Fourier transform

DFT Properties: (6) Addition/Multiplication

but …

Page 50: Fourier transform

DFT Properties: (7) Scale

Page 51: Fourier transform

DFT Properties: (8) Average value

So:

Average:

F(u,v) at u=0, v=0:

Page 52: Fourier transform

Magnitude and Phase of DFT

• What is more important?

• Hint: use inverse DFT to reconstruct the image using magnitude or phase only information

magnitude phase

Page 53: Fourier transform

Magnitude and Phase of DFT (cont’d)

Reconstructed image using

magnitude only

(i.e., magnitude determines the

contribution of each component!)

Reconstructed image using

phase only

(i.e., phase determines

which components are present!)

Page 54: Fourier transform

Magnitude and Phase of DFT (cont’d)