Sunteți pe pagina 1din 86

Fourier Transform

Overview
Signals as functions (1D, 2D)
Tools

1D Fourier Transform
Summary of definition and properties in the different cases
CTFT, CTFS, DTFS, DTFT DFT

2D Fourier Transforms
Generalities and intuition Examples A bit of theory

Discrete Fourier Transform (DFT) Discrete Cosine Transform (DCT)

Signals as functions
1. Continuous functions of real independent variables
1D: f=f(x) 2D: f=f(x,y) x,y Real world signals (audio, ECG, images) 1D: f=f[k] 2D: f=f[i,j] Sampled signals 1D: y=y[k] 2D: y=y[i,j] Sampled and quantized signals For ease of notations, we will use the same notations for 2 and 3

2. Real valued functions of discrete variables

3. Discrete functions of discrete variables

Images as functions
Gray scale images: 2D functions
Domain of the functions: set of (x,y) values for which f(x,y) is defined : 2D lattice [i,j] defining the pixel locations Set of values taken by the function : gray levels

Digital images can be seen as functions defined over a discrete domain {i,j: 0<i<I, 0<j<J}
I,J: number of rows (columns) of the matrix corresponding to the image f=f[i,j]: gray level in position [i,j]

Example 1: function

[i , j ] =

1 0

i= j=0 i , j 0; i j

[i , j J ] =

1 0

i = 0; j = J otherwise

Example 2: Gaussian
Continuous function

f ( x, y ) =

1 e 2

x2 + y2 2 2

Discrete version
i2 + j2 2 2

1 f [i , j ] = e 2

Example 3: Natural image

Example 3: Natural image

Fourier Transform
Different formulations for the different classes of signals
Summary table: Fourier transforms with various combinations of continuous/discrete time and frequency variables. Notations:
CTFT: continuous time FT: t is real and f real (f=) (CT, CF) DTFT: Discrete Time FT: t is discrete (t=n), f is real (f=) (DT, CF) CTFS: CT Fourier Series (summation synthesis): t is real AND the function is periodic, f is discrete (f=k), (CT, DF) DTFS: DT Fourier Series (summation synthesis): t=n AND the function is periodic, f discrete (f=k), (DT, DF) P: periodical signals T: sampling period s: sampling frequency (s=2/T) For DTFT: T=1 s=2

Continuous Time Fourier Transform (CTFT)


Time is a real variable (t) Frequency is a real variable ()

CTFT: Concept
A signal can be represented as a weighted sum of sinusoids. Fourier Transform is a change of basis, where the basis functions consist of sins and cosines (complex exponentials).

[Gonzalez Chapter 4]

Continuous Time Fourier Transform (CTFT)

T=1

Fourier Transform
Cosine/sine signals are easy to define and interpret. However, it turns out that the analysis and manipulation of sinusoidal signals is greatly simplified by dealing with related signals called complex exponential signals. A complex number has real and imaginary parts: z = x+j y A complex exponential signal:

r e j = r ( cos + j sin )

CTFT
Continuous Time Fourier Transform Continuous time a-periodic signal Both time (space) and frequency are continuous variables
NON normalized frequency is used

Fourier integral can be regarded as a Fourier series with fundamental frequency approaching zero Fourier spectra are continuous
A signal is represented as a sum of sinusoids (or exponentials) of all frequencies over a continuous frequency interval

Fourier integral

F ( ) = f (t )e jt dt 1 j t f (t ) = F ( ) e d 2
t

analysis

synthesis

Then CTFT becomes


Fourier Transform of a 1D continuous signal

F (u ) =

f ( x)e j 2 ux dx

Eulers formula

e j 2 ux = cos ( 2 ux ) j sin ( 2 ux )

Inverse Fourier Transform

f ( x) =

F (u )e j 2 ux du

CTFT: change of notations


Fourier Transform of a 1D continuous signal

F ( ) =
Eulers formula

f ( x)e j x dx

e j x = cos ( x ) j sin ( x )

Inverse Fourier Transform

1 f ( x) = 2

F ( )e j x d

Change of notations:

2 u x 2 u y 2 v

CTFT
Replacing the variables

F (2 u ) = F (u ) =
1 f ( x) = 2

F (u )e j 2 ux d ( 2 u ) =

f ( x)e j 2 ux dx =

F (u )e j 2 ux du

More compact notations

F (u ) = f ( x) =

f ( x)e j 2 ux dx F (u )e j 2 ux du

Sinusoids
Frequency domain characterization of signals

F ( ) =

f (t )e jt dt

Signal domain

Frequency domain (spectrum, absolute value of the transform)

Gaussian
Time domain

Frequency domain

rect
Time domain

Frequency domain

sinc function

Example

Example

Discrete Fourier Transform (DFT)


The easiest way to get to it Time is a discrete variable (t=n) Frequency is a discrete variable (f=k)

DFT
The DFT can be considered as a generalization of the CTFT to discrete series

1 N 1 F [k ] = f [n]e j 2 kn / N N n=0 f [ n] = F [k ]e j 2 kn / N
N 1 k =0

n = 0,1,, N 1 k = 0,1,, N 1
In order to calculate the DFT we start with k=0, calculate F(0) as in the formula below, then we change to u=1 etc

1 N 1 1 N 1 j 2 0 n / N F [0] = f [n]e = f [ n] = f N n =0 N n=0


F[0] is the average value of the function f[n] 0
This is also the case for the CTFT

Example 1
amplitude

0 |F[k]|

time F[0]

low-pass characteristic

frequency

Example 2
amplitude

time

|F[k]|

F[0]=0

band-pass (or high-pass) characteristic

-M

frequency

DFT
About M2 multiplications are needed to calculate the DFT The transform F[k] has the same number of components of f[n], that is N The DFT always exists for signals that do not go to infinity at any point Using the Euleros formula

1 N 1 1 N 1 j 2 kn / N F [k ] = f [n]e = f [n] ( cos ( j 2 kn / N ) j sin ( j 2 kn / N ) ) N n=0 N n=0


frequency component k discrete trigonometric functions

Intuition
The FT decomposed the signal over its harmonic components and thus represents it as a sum of linearly independent complex exponential functions Thus, it can be interpreted as a mathematical prism

DFT is a complex number


F[k] in general are complex numbers

F [ k ] = Re { F [ k ]} + j Im { F [ k ]} F [ k ] = F [ k ] exp { j F [ k ]} F [ k ] = Re { F [ k ]}2 + Im { F [ k ]}2 magnitude or spectrum Im { F [ k ]} 1 F [ k ] = tan phase or angle Re { F [ k ]} P [k ] = F [k ]


2

power spectrum

Example

Lets take a bit more advanced perspective


Book: Lathi, Signal Processing and Linear Systems

Overview
Transform (Continuous Time) Fourier Transform (CTFT) (Continuous Time) Fourier Series (CTFS) Time C Frequency C Analysis/Synthesis Duality Self-dual

F ( ) = f (t )e jt dt 1 j t ( ) f (t ) = F e d 2
t

C P

1 F [k ] = f (t )e j 2 kt / T dt T T / 2 f (t ) = F [k ]e j 2 kt / T
k

T /2

Dual with DTFT

Discrete Time Fourier Transform (DTFT)

C P

F ( ) = f [k ] =

k =

f [k ]e

j k

Dual with CTFS

1 2

F ( )e

j k

d
Self dual

Discrete Time Fourier Series (DTFS)

D P

D P

1 N 1 F [k ] = f [n]e j 2 kn / T N n=0 f [n] = F [k ]e j 2 kn / T


n =0 N 1

Linking continuous and discrete domains


amplitude amplitude fk=f(kTs)

Ts t n

DT signals can be seen as sampled versions of CT signals Both CT and DT signals can be of finite duration or periodic There is a duality between periodicity and discretization
Periodic signals have discrete frequency (DF) transform (f=k) CTFS Discrete time signals have periodic transform DTFT DT periodic signals have DF periodic transforms DTFS, DFT

Dualities
SIGNAL DOMAIN FOURIER DOMAIN

Sampling Periodicity Sampling+Periodicity

DTFT CTFS

Periodicity Sampling Sampling +Periodicity

DTFS/DFT

Discrete time signals


Sequences of samples f[k]: sample values Assumes a unitary spacing among samples (Ts=1) Normalized frequency Transform
DTFT for NON periodic sequences CTFS for periodic sequences DFT for periodized sequences

Sampled signals f(kTs): sample values The sampling interval (or period) is Ts Non normalized frequency Transform
DTFT CSTF DFT BUT accounting for the fact that the sequence values have been generated by sampling a real signal fk=f(kTs)

All transforms are 2 periodic

2 s = sTs = Ts = 2 Ts

All transforms are periodic with period s

= Ts

s =

2 Ts

Continuous Time Fourier Series Continuous time periodic signals


The signal is periodic with period T The transform is sampled (it is a series)

amplitude

CTFS

1 j 2 kt / T F [k ] = f t e dt ( ) T T / 2 f (t ) = F [k ]e j 2 kt / T
k

T /2

coefficients of the Fourier series

periodic signal

CTFS
Representation of a continuous time signal as a sum of orthogonal components in a complete orthogonal signal space
The exponentials are the basis functions

Fourier series are periodic with period equal to the fundamental in the set (2/T) Properties
even symmetry only cosinusoidal components odd symmetry only sinusoidal components

DTFT
Discrete Time Fourier Transform Discrete time a-periodic signal The transform is periodic and continuous with period
n

s =

non normalized frequency

2 Ts

F ( ) = f [n]e j 2 n / s = f [n]e j nTs


n

s / 2 2 2 2 s = Ts = Ts = Ts s 2
f [ n] =
s

s / 2

F ( e jt ) e j 2 n / s d =

2 Ts

/ Ts
/ Ts

F ( e jt ) e j nTs d

Ts = 2 / s

sampling interval in time periodicity in frequency the closer the samples, the farther the replicas

DTFT with normalized frequency


Normalized frequency

= Ts

normalized frequency

s = sTs =
s = 2

2 Ts = 2 Ts
periodicity in the normalized frequency domain

F () =

n =

f [k ]e jn F ( )e jk d
Relation to the CTFT

1 f [ n] = 2
F () =

1 Fc Ts Ts

DTFT with normalized frequency


F() can be_obtained from Fc() by replacing with /Ts. Thus F() is identical to F() frequency scaled and stratched by a factor 1/Ts, where Ts is the sampling interval in time domain Notations

1 Fc Ts Ts 2 2 Ts = s = Ts s F () =

periodicity of the spectrum

F () F (Ts ) = F ( 2 / s ) F () =
n =

= Ts normalized frequency (the spectrum is 2-periodic) Ts

f [n]e

j n

F (Ts ) = F ( ) =

k =

f [n]e j 2 n / s

DTFT with unitary frequency


= 2 u F () =
n =

( = 2 f )

f [ n]e

j n

F (u ) =

n = 1 2

f [n]e j 2 nu

1 f [ n] = 2

F ()e jn d f [n] = F (u )e j 2 nu du =
1

F (u )e j 2 nu du

1 2

j 2 nu F u f k e ( ) = [ ] n = 1 2 f [ n] = F (u )e j 2 nu du 1 2

NOTE: when Ts=1, = and the spectrum is 2-periodic. The unitary frequency u=2/ corresponds to the signal frequency f=2/. This could give a better intuition of the transform properties.

Summary
Sampled signals are sequences of sampels Looking at the sequence as to a set of samples obtained by sampling a real signal with sampling frequency s we can still use the formulas for calculating the transforms as derived for the sequences by
Stratching the time axis (and thus squeezing the frequency axis if Ts>1)
normalized frequency (sample series) spectral periodicity in

= Ts
2 s = 2 Ts

frequency (sampled signal) spectral periodicity in

Enclosing the sampling interval Ts in the value of the sequence samples (DFT)

f k = Ts f ( kTs )

Connection DTFT-CTFT
sampling f(t) t f(kTs) periodization Fc()

_ Fc()

0 Ts f[k]

4Ts

2/Ts F()

0 1

Differences DTFT-CTFT
The DTFT is periodic with period s=2 (or s=2/Ts) The discrete-time exponential ejn has a unique waveform only for values of in a continuous interval of 2 Numerical computations can be conveniently performed with the Discrete Fourier Transform (DFT)

DTFS
Discrete Time Fourier Series Discrete time periodic sequences of period N0
Fundamental frequency

0 = 2 / N 0

1 F [k ] = N0 f [ n] =

N 0 1

n =0

f [n]e jkn 2 / N0

N 0 1

k =0

F [k ]e jkn 2 / N0

DTFS: Example
N0=20 Ts=1 s=2 0= /10

[Lathi, pag 621]

Discrete Fourier Transform (DFT)


F [k ] =
N 0 1

n=0

f n e jn0 k =
N 0 1 k =0

N 0 1

n=0

fne

2 nk N0

1 f [ n] = N0 0 =

jn0 k F [ k ] e

1 = N0

N 0 1 k =0

F [k ]e

jn

2 k N0

2 N0

The DFT transforms N0 samples of a discrete-time signal to the same number of discrete frequency samples The DFT and IDFT are a self-contained, one-to-one transform pair for a length-N0 discrete-time signal (that is, the DFT is not merely an approximation to the DTFT as discussed next) However, the DFT is very often used as a practical approximation to the DTFT

DFT

N0 zero padding F()

2/N0

Discrete Cosine Transform (DCT)


Operate on finite discrete sequences (as DFT) A discrete cosine transform (DCT) expresses a sequence of finitely many data points in terms of a sum of cosine functions oscillating at different frequencies DCT is a Fourier-related transform similar to the DFT but using only real numbers DCT is equivalent to DFT of roughly twice the length, operating on real data with even symmetry (since the Fourier transform of a real and even function is real and even), where in some variants the input and/or output data are shifted by half a sample There are eight standard DCT variants, out of which four are common Strong connection with the Karunen-Loeven transform
VERY important for signal compression

DCT
DCT implies different boundary conditions than the DFT or other related transforms A DCT, like a cosine transform, implies an even periodic extension of the original function Tricky part
First, one has to specify whether the function is even or odd at both the left and right boundaries of the domain Second, one has to specify around what point the function is even or odd
In particular, consider a sequence abcd of four equally spaced data points, and say that we specify an even left boundary. There are two sensible possibilities: either the data is even about the sample a, in which case the even extension is dcbabcd, or the data is even about the point halfway between a and the previous point, in which case the even extension is dcbaabcd (a is repeated).

Symmetries

DCT
Xk =
N 0 1

n=0

1 xn cos n + k 2 N0

k = 0,...., N 0 1

2 xn = N0

N 0 1 1 k 1 X 0 + X k cos k + 2 k =0 N0 2

Warning: the normalization factor in front of these transform definitions is merely a convention and differs between treatments.
Some authors multiply the transforms by (2/N0)1/2 so that the inverse does not require any additional multiplicative factor.
Combined with appropriate factors of 2 (see above), this can be used to make the transform matrix orthogonal.

Images vs Signals
1D Signals Frequency
Temporal Spatial

2D Images Frequency
Spatial

Time (space) frequency characterization of signals Reference space for


Filtering Changing the sampling rate Signal analysis .

Space/frequency characterization of 2D signals Reference space for


Filtering Up/Down sampling Image analysis Feature extraction Compression .

2D spatial frequencies
2D spatial frequencies characterize the image spatial changes in the horizontal (x) and vertical (y) directions
Smooth variations -> low frequencies Sharp variations -> high frequencies

y x=1 y=0

x=0 y=1

2D Frequency domain
y Large vertical frequencies correspond to horizontal lines Large horizontal and vertical frequencies correspond sharp grayscale changes in both directions

Small horizontal and vertical frequencies correspond smooth grayscale changes in both directions

x Large horizontal frequencies correspond to vertical lines

Vertical grating
y

Double grating
y

Smooth rings
y

2D box

2D sinc

Margherita Hack

log amplitude of the spectrum

Einstein

log amplitude of the spectrum

What we are going to analyze


2D Fourier Transform of continuous signals (2D-CTFT)
1D
+ +

F ( ) =

2D Fourier Transform of discrete space signals (2D-DTFT)


1D

f (t )e jt dt , f (t ) =

F ( )e jt dt

F () =

k =

f [k ]e

j k

1 , f [k ] = 2

F ()e jk dt

2D Discrete Fourier Transform (2D-DFT)


1D

Fr =

N0 1 k =0

f [k ]e

jr0 k

1 N0 1 jr0k 2 , f N0 [k ] = , F e = r 0 N0 r =0 N0

2D Continuous Fourier Transform


Continuous case (x and y are real) 2D-CTFT (notation 1)
+

( , ) = f x y f ( x, y ) =

f ( x, y ) e
+

j ( x x + y y )

dxdy

1 4 2

* ( , )g Parseval formula f x y ( x , y ) d x d y

( , ) e j ( x x + y y ) d d f x y x y
1

f ( x, y ) g * ( x, y ) dxdy =

f = g

4 2 2 2 1 ( , ) d d f ( x, y ) dxdy = 2 f x y x y 4

Plancherel equality

2D Continuous Fourier Transform


Continuous case (x and y are real) 2D-CTFT

x = 2 u y = 2 v
( u, v ) = f f ( x, y ) = =
+

f ( x, y ) e j 2 ( ux + vy ) dxdy
+

1 4 2 1 4 2

( u , v ) e j 2 ( ux + vy ) ( 2 )2 dudv = f
2 j 2 ( ux + vy ) f ( u, v ) e ( 2 ) dudv

2D Continuous Fourier Transform


2D Continuous Fourier Transform (notation 2)

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

f ( x, y ) e j 2 ( ux + vy ) dxdy ( u , v ) e j 2 ( ux + vy ) dudv = f

f ( x, y ) dxdy =
2

(u , v) dudv f

Plancherels equality

2D Discrete Fourier Transform


The independent variable (t,x,y) is discrete
N 0 1

Fr =

k =0

f [k ]e jr0 k
N 0 1

F [u , v] =

N 0 1 N 0 1

i =0 k =0

f [i, k ]e j0 ( ui + vk ) F [u, v]e j0 ( ui + vk )

1 f N0 [k ] = N0 2 0 = N0

r =0

Fr e jr0 k

1 f N0 [i, k ] = 2 N0 2 0 = N0

N 0 1 N 0 1

u =0 v =0

[Lathis notations]

Delta
Sampling property of the 2D-delta function (Diracs delta)

( x x , y y ) f ( x, y)dxdy = f ( x , y )
0 0 0 0

Transform of the delta function

F { ( x, y )} =
F { ( x x0 , y y0 )} =

j 2 ( ux + vy ) ( x , y ) e dxdy = 1

j 2 ( ux + vy ) j 2 ( ux + vy ) ( x x , y y ) e dxdy = e 0 0
0 0

shifting property

Constant functions
Inverse transform of the impulse function

F 1 { (u , v)} =

j 2 ( ux + vy ) j 2 (0 x + v 0) ( u , v ) e dudv = e =1

Fourier Transform of the constant (=1 for all x and y)

k ( x, y ) = 1 F ( u, v ) =

x, y

j 2 ( ux + vy ) e dxdy = (u , v)

Trigonometric functions
Cosine function oscillating along the x axis
Constant along the y axis

s( x, y ) = cos(2 fx) F {cos(2 fx)} =


j 2 ( ux + vy ) fx e dxdy = cos(2 )

e j 2 ( fx ) + e j 2 ( fx ) j 2 (ux + vy ) = dxdy e 2
1 j 2 ( u f ) x j 2 ( u + f ) x j 2 vy e e e dxdy = = + 2 1 1 j 2 ( u f ) x j 2 ( u + f ) x e e dx e j 2 (u f ) x + e j 2 ( u + f ) x = e j 2 vy dy + = 1 dx = 2 2 1 [ (u f ) + (u + f )] 2

Vertical grating
y

-2f

2 f

Ex. 1

Ex. 2

Ex. 3

Magnitudes

Examples

Properties
Linearity Shifting Modulation Convolution Multiplication Separability

af ( x, y ) + bg ( x, y ) aF (u, v) + bG (u , v)

f ( x x0 , y x0 ) e

j 2 ( ux0 + vy0 )

F (u , v)

e j 2 ( u0 x + v0 y ) f ( x, y ) F (u u0 , v v0 )
f ( x, y ) * g ( x, y ) F (u, v)G (u, v)

f ( x, y ) g ( x, y ) F (u , v) * G (u , v)
f ( x, y ) = f ( x) f ( y ) F (u, v) = F (u ) F (v)

Separability
1. Separability of the 2D Fourier transform
2D Fourier Transforms can be implemented as a sequence of 1D Fourier Transform operations performed independently along the two axis

F (u , v) =

f ( x, y )e j 2 (ux + vy ) dxdy =

f ( x, y ) e

j 2 ux j 2 vy

dxdy =

j 2 vy

j 2 vy

dy f ( x, y )e j 2 ux dx =

F (u, y)e
2D DFT

dy = F ( u, v )
1D DFT along the rows 1D DFT along the cols

Separability
Separable functions can be written as f ( x, y ) = f ( x ) g ( y ) 2. The FT of a separable function is the product of the FTs of the two functions

F (u , v) =

f ( x, y )e j 2 ( ux + vy ) dxdy =
j 2 ux j 2 vy

= H (u ) G (v )

h( x ) g ( y ) e

dxdy =

g ( y)e

j 2 vy

dy h( x)e j 2 ux dx =

f ( x, y ) = h ( x ) g ( y ) F ( u , v ) = H ( u ) G ( v )

2D Fourier Transform of a Discrete function


Fourier Transform of a 2D a-periodic signal defined over a 2D discrete grid
The grid can be thought of as a 2D brush used for sampling the continuous signal with a given spatial resolution (Tx,Ty)

1D

F ( ) =

k =

f [k ]e jk , f [k ] =

1 2

F ()e jk dt

2D

F ( x , y ) = f [k ] = 1 4 2

k1 = k2 =

j ( k1 x + k2 y )

f [k1 , k2 ]e
j ( k1 x + k2 y )

2 2

F ( x , y )e

d x y

x,y: normalized frequency

Unitary frequency notations


x = 2 u y = 2 v F (u, v) =
k1 = k2 = 1/ 2 1/ 2


1/ 2 1/ 2

f [k1 , k2 ]e j 2 ( k1u + k2v )

f [k1 , k2 ] =

F (u , v)e j 2 ( k1u + k2v ) dudv

The integration interval for the inverse transform has width=1 instead of 2
It is quite common to choose

1 1 u, v < 2 2

Properties
Periodicity: 2D Fourier Transform of a discrete a-periodic signal is periodic
The period is 1 for the unitary frequency notations and 2 for normalized frequency notations. Proof (referring to the firsts case)

F (u + k , v + l ) =

m = n =

f [m, n]e

j 2 ( ( u + k ) m + ( v + l ) n )

Arbitrary integers

m = n =

f [m, n]e

j 2 ( um + vn ) j 2 km j 2 ln

m = n =

f [m, n]e j 2 (um + vn )

= F (u , v)

Properties
Linearity shifting modulation convolution multiplication separability energy conservation properties also exist for the 2D Fourier Transform of discrete signals. NOTE: in what follows, (k1,k2) is replaced by (m,n)

2D DTFT Properties
Linearity Shifting Modulation Convolution Multiplication

af [m, n] + bg[m, n] aF (u , v) + bG (u , v)

f [m m0 , n n0 ] e j 2 (um0 + vn0 ) F (u , v)

j 2 ( u0 m + v0 n )

f [m, n] F (u u0 , v v0 )

f [m, n]* g[m, n] F (u , v)G (u , v)


f [m, n]g[m, n] F (u , v) * G (u , v)
f [m, n] = f [m] f [n] F (u , v) = F (u ) F (v)
m = n = 1/ 2 1/ 2

Separable functions Energy conservation

f [m, n] =
2

1/ 2 1/ 2

F (u, v) dudv

Impulse Train
Define a comb function (impulse train) as follows

combM , N [m, n] =

k = l =

[m kM , n lN ]

where M and N are integers

comb2 [n]
n

Appendix

2D-DTFT: delta
Define Kronecker delta function

1, for m = 0 and n = 0 [m, n] = 0, otherwise


DT Fourier Transform of the Kronecker delta function

F (u , v) =

j 2 ( um + vn ) j 2 ( u 0 + v 0 ) = =1 [ m , n ] e e m = n =

2D DT Fourier Transform: constant


Fourier Transform of 1

f [k , l ] = 1, k , l F [u , v] = =
j 2 ( uk + vl ) = 1 e k = l =

k = l =

(u k , v l )

periodic with period 1 along u and v

To prove: Take the inverse Fourier Transform of the Dirac delta function and use the fact that the Fourier Transform has to be periodic with period 1.

S-ar putea să vă placă și