Documente Academic
Documente Profesional
Documente Cultură
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
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
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
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
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]
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
F (u ) =
f ( x)e j 2 ux dx
Eulers formula
e j 2 ux = cos ( 2 ux ) j sin ( 2 ux )
f ( x) =
F (u )e j 2 ux du
F ( ) =
Eulers formula
f ( x)e j x dx
e j x = cos ( x ) j sin ( x )
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
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
Gaussian
Time domain
Frequency domain
rect
Time domain
Frequency domain
sinc function
Example
Example
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
Example 1
amplitude
0 |F[k]|
time F[0]
low-pass characteristic
frequency
Example 2
amplitude
time
|F[k]|
F[0]=0
-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
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
power spectrum
Example
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
C P
F ( ) = f [k ] =
k =
f [k ]e
j k
1 2
F ( )e
j k
d
Self dual
D P
D P
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
DTFT CTFS
DTFS/DFT
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)
2 s = sTs = Ts = 2 Ts
= Ts
s =
2 Ts
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
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 =
2 Ts
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
= 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
1 Fc Ts Ts 2 2 Ts = s = Ts s F () =
F () F (Ts ) = F ( 2 / s ) F () =
n =
f [n]e
j n
F (Ts ) = F ( ) =
k =
f [n]e j 2 n / s
( = 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
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
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
2/N0
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
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
Vertical grating
y
Double grating
y
Smooth rings
y
2D box
2D sinc
Margherita Hack
Einstein
F ( ) =
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
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
( , ) = 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
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
( 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
Fr =
k =0
f [k ]e jr0 k
N 0 1
F [u , v] =
N 0 1 N 0 1
i =0 k =0
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
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
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
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 )
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
1/ 2 1/ 2
f [k1 , k2 ] =
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 (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] =
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 ]
comb2 [n]
n
Appendix
2D-DTFT: delta
Define Kronecker delta function
F (u , v) =
j 2 ( um + vn ) j 2 ( u 0 + v 0 ) = =1 [ m , n ] e e m = n =
f [k , l ] = 1, k , l F [u , v] = =
j 2 ( uk + vl ) = 1 e k = l =
k = l =
(u k , v l )
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.