Jérôme Gilles
UCLA
JGS Basics about Fourier analysis PART ONE Fourier analysis
JGS Basics about Fourier analysis On the menu ...
Introduction - some history ... Notations. Fourier series. Continuous Fourier transform. Discrete Fourier transform. Properties. 2D extension.
JGS Basics about Fourier analysis An everyday challenge
Signal/image processing : need to :
analyze : −→
synthesize :
−→
= need some reference elements. ⇒
JGS Basics about Fourier analysis The Fourier revolution !
Biography Born in March 21th, 1768 at Auxerre (France), died in Mai 16th, 1830 Graduated from ENS (Professors : Lagrange, Monge, Laplace) Chair at Polytechnique in 1797 Elected member of the French Academy of sciences in 1817 Elected member of the French Academy in 1826
JGS Basics about Fourier analysis The Fourier revolution !
Biography Born in March 21th, 1768 at Auxerre (France), died in Mai 16th, 1830 Graduated from ENS (Professors : Lagrange, Monge, Laplace) Chair at Polytechnique in 1797 Elected member of the French Academy of sciences in 1817 Elected member of the French Academy in 1826
Scientific contributions Analytic heat theory : modeling of heat propagation by trigonometric series (Fourier series) First to speak about the “greenhouse effect”
JGS Basics about Fourier analysis Notations
L1 : space of integrable functions 1 n R Let f L (R ) then f L1 = f (t) dt < ∈ k k | | ∞
L2 : space of functions of finite energy (square integrable) 1 2 n R 2 2 Let f L (R ) then f L2 = f (t) dt < ∈ k k | | ∞ Inner product between functions Let f , g E then f , g = R f (t)g¯(t)dt ∈ h i
If T R such that t R, f (t + T ) = f (t) then T is called the period of∃f and∈ F = 1/T is∀ the∈ frequency of f .
Dirac function : δ(t) δ(t) = + at t = 0, 0 otherwise and R δ(t)dt = 1. Discrete∞ case : Kronecker symbol : δ[n] δ[n] = 1 if n = 0, 0 otherwise.
JGS Basics about Fourier analysis Fourier series : Definition
Idea : all periodic function of period T can be decomposed as the sum 2π n t of trigonometric polynomials e T :
+∞ Z +T /2 X 2π n t 1 −2π n t f (t) = c (f )e T where c (f ) = f (t)e T n n T n=−∞ −T /2
JGS Basics about Fourier analysis Fourier series : Definition
Idea : all periodic function of period T can be decomposed as the sum 2π n t of trigonometric polynomials e T :
+∞ Z +T /2 X 2π n t 1 −2π n t f (t) = c (f )e T where c (f ) = f (t)e T n n T n=−∞ −T /2 if f is real
+∞ +∞ X n X n f (t) = a (f ) + a (f ) cos 2π t + b (f ) sin 2π t 0 n T n T 1 1
JGS Basics about Fourier analysis Fourier series : Definition
Idea : all periodic function of period T can be decomposed as the sum 2π n t of trigonometric polynomials e T :
+∞ Z +T /2 X 2π n t 1 −2π n t f (t) = c (f )e T where c (f ) = f (t)e T n n T n=−∞ −T /2 if f is real
+∞ +∞ X n X n f (t) = a (f ) + a (f ) cos 2π t + b (f ) sin 2π t 0 n T n T 1 1
1 R +T /2 where a0(f ) = T −T /2 f (t)dt, b0(f ) = 0 and for n > 0
2 Z T /2 n 2 Z T /2 n an(f ) = f (t) cos 2π t dt , bn(f ) = f (t) sin 2π t dt T −T /2 T T −T /2 T
JGS Basics about Fourier analysis Fourier series : Properties 1/3
if f is even then c−n(f ) = cn(f ), if f is real bn(f ) = 0,
if f is odd then c−n(f ) = cn(f ), if f is real an(f ) = 0 − Parseval equality :
+∞ X 1 Z T /2 1 Z T c (f ) 2 = f (t) 2dt = f (t) 2dt = f 2 . n T T L2 n=−∞ | | −T /2 | | 0 | | k k
JGS Basics about Fourier analysis Fourier series : Properties 2/3
The sinus/cosinus frequencies are multiple of 1/T (harmonics).
Spectral representation c | n|
5 4 3 2 1 1 2 3 4 5 −T −T −T −T −T T T T T T n
JGS Basics about Fourier analysis 1 R +T /2 cn(f ) = f (t)e¯n(t)dt = f , en T −T /2 h i but en is an orthonormal basis ( en, em = 0 if n = m and 1 if n{ =}m) h i 6
Fourier series : Properties 3/3
2π n t denote en(t) = e T then
JGS Basics about Fourier analysis but en is an orthonormal basis ( en, em = 0 if n = m and 1 if n{ =}m) h i 6
Fourier series : Properties 3/3
2π n t denote en(t) = e T then 1 R +T /2 cn(f ) = f (t)e¯n(t)dt = f , en T −T /2 h i
JGS Basics about Fourier analysis Fourier series : Properties 3/3
2π n t denote en(t) = e T then 1 R +T /2 cn(f ) = f (t)e¯n(t)dt = f , en T −T /2 h i but en is an orthonormal basis ( en, em = 0 if n = m and 1 if n{ =}m) h i 6
JGS Basics about Fourier analysis Fourier series : Properties 3/3
2π n t denote en(t) = e T then 1 R +T /2 cn(f ) = f (t)e¯n(t)dt = f , en T −T /2 h i but en is an orthonormal basis ( en, em = 0 if n = m and 1 if n{ =}m) h i 6 = Fourier series decomposition = projection a sinus/cosinus basis.⇒
JGS Basics about Fourier analysis Fourier series : Example
A
Real and odd signal A − with zero mean T = an(f ) = 0 n ⇒ ∀
JGS Basics about Fourier analysis Fourier series : Example
A
Real and odd signal A − with zero mean T = an(f ) = 0 n Only bn(f ) are different from 0 : ⇒ ∀
2 Z T /2 n bn(f ) = f (t) sin 2π t dt T −T /2 T " # 2A Z 0 n Z T /2 n = sin 2π t dt + sin 2π t dt T − −T /2 T 0 T ( ) 2A T n 0 T n T /2 = cos 2π t + cos 2π t T 2πn T −T /2 −2πn T 0 A = (1 cos(nπ) cos(nπ) + 1) nπ − − 2A = (1 ( 1)n) nπ − − JGS Basics about Fourier analysis Fourier series : Example
JGS Basics about Fourier analysis Continuous Fourier transform : Definition
Goal : generalization of the spectrum representation to non-periodic functions (frequencies ν R). The Fourier transform of a function f is∈ given by
Z +∞ ˆf (ν) = f (t)e−2πνt dt −∞ The inverse transform is given by
Z +∞ f (t) = ˆf (ν)e+2πνt dν −∞
JGS Basics about Fourier analysis Continuous Fourier transform : Properties Function Fourier transform ˆ ˆ Linearity af1(t) + bf2(t) af1(ν) + bf2(ν) 1 ˆ ν Dilation f (at) |a| f a ˆ 2πνt0 Temporal Translation f (t + t0) f (ν)e Temporal Modulation f (t)e2πν0t ˆf (ν ν ) − 0 Convolution f (t) ? g(t) ˆf (ν)gˆ(ν) Derivative f 0(t) 2πνˆf (ν) Parseval-Plancherel theorem The inner product is conserved :
Z +∞ 1 Z +∞ f (t)g¯(t)dt = ˆf (ν)gˆ¯(ν)dν −∞ 2π −∞ In particular :
Z +∞ 1 Z +∞ f (t) 2dt = ˆf (ν) 2dν −∞ | | 2π −∞ | |
JGS Basics about Fourier analysis Continuous Fourier transform : “Some classics”
Function Fourier transform constant A Aδ(ν) Dirac δ(t) 1 1 Trigonometric function cos(2πν0t) 2 [δ(ν − ν0) + δ(ν + ν0)] 1 Sign function Sign(t) πν 1 1 Heavyside function u(t) πν + 2 δ(ν) Square function 1 if −T /2 6 t 6 T /2, 0 otherwise T sinc(πνT ) P+∞ 1 P+∞ Dirac comb δ(t − mT0) δ(ν − nν0) m=−∞ T0 n=−∞ −x2 1 −4π2σ2ν2 Gaussian √ e 2σ2 e σ 2π
JGS Basics about Fourier analysis Discrete Fourier transform : Definition
Assume that f (t) is sample on N points at the frequency Fe, f (nTe) (we can directly note f (n)).
Discrete Fourier Transform (DFT) :
N−1 X −2π nk F(k) = f (n)e N n=0
Inverse transform :
N−1 1 X 2π nk f (n) = F(k)e N N k=0 Fast Algorithm : FFT
JGS Basics about Fourier analysis Link between FT and DFT 1/3
Saying that f (t) is sampled is equivalent to f (n) = f (t)P(t) where P(t) a Dirac comb associated to Te.
f(t)
t
P (t) t
f(n)
t But the FT of the Dirac comb is a Dirac comb and a temporal product becomes a convolution product in the Fourier domain = duplication the input signal spectrum. ⇒ t
JGS Basics about Fourier analysis Link between FT and DFT 2/3
FT (ν) | |
ν DFT (ν) | |
......
2F F F 2F ν − e − e e e
Shannon condition to have a correct reconstruction of the original signal : the support the FT of f must be limited to the frequency range ] Fe/2; Fe/2[ in order to avoid some spectrum overlapping− .
JGS Basics about Fourier analysis Link between FT and DFT 3/3 Truncation effect : N samples to weight f (t) by a square function. ⇔ 0 f (t) = f (t)Π(t) where Π(t) = 1 if t [0, NTe], 0 otherwise ∈ = convolution in the spectral domain by a sinc function ! We deform the⇒ spectrum ! Example : f (t) = sin(2πνt) (ν = 30 Hz)
JGS Basics about Fourier analysis Link between FT and DFT 3/3 Truncation effect : N samples to weight f (t) by a square function. ⇔ 0 f (t) = f (t)Π(t) where Π(t) = 1 if t [0, NTe], 0 otherwise ∈ = convolution in the spectral domain by a sinc function ! We deform the⇒ spectrum ! Example : f (t) = sin(2πνt) (ν = 30 Hz)
JGS Basics about Fourier analysis Window weighting 1/2 To reduce the spectrum deformation, we can use other kind of windows w(t) with “better” spectral behavior. Then f 0(t) = w(t)f (t) = triangular, parabolic, Hanning, Hamming, Blackman-Harris, ⇒ Gauss, Chebychev windows, ...
JGS Basics about Fourier analysis Window weighting 1/2 To reduce the spectrum deformation, we can use other kind of windows w(t) with “better” spectral behavior. Then f 0(t) = w(t)f (t) = triangular, parabolic, Hanning, Hamming, Blackman-Harris, ⇒ Gauss, Chebychev windows, ...
JGS Basics about Fourier analysis Window weighting 2/2
JGS Basics about Fourier analysis Resolution power 1/2
When we use a square window, the principal sinc lobe in the Fourier domain has a total width of 2/N and the secondary lobes of 1/N. Problem when two pikes are too close : we can distinguish them or resolve them :
JGS Basics about Fourier analysis Resolution power 2/2
To resolve two frequencies, it is necessary that the gap between them is larger than the Fourier resolution :
1 ν ν > | 1 − 2| N Otherwise we can use the zero padding technique (virtual augmentation of N by inserting zeros between the signal’s samples, it is possible to prove that it does not alter the spectrum shape).
JGS Basics about Fourier analysis Time-frequency incertitude principle 1/3
Localization behavior Signals well localized in time =⇒ have large support in the frequency domain. Large signals in the time domain =⇒ well localized in the frequency domain.
2πνt0 Ex : δ(t − t0) =⇒ e (infinite support in the frequency domain)
Statistical information distribution
|f (t)|2 |ˆf (ν)|2 The quantities and with Ef the energy given by the Parseval Ef Ef theorem, can be interpreted probability densities of the information repartition in one domain or the other. We can compute the moments of these densities.
JGS Basics about Fourier analysis Time-frequency incertitude principle 2/3
Time and frequency averages 1 Z +∞ 1 Z +∞ ¯t = t|f (t)|2dt et ν¯ = ν|ˆf (ν)|2dν Ef −∞ Ef −∞
Time and frequency variances
1 Z +∞ 1 Z +∞ (∆t)2 = (t −¯t)2|f (t)|2dt et (∆ν)2 = (ν −ν¯)2|ˆf (ν)|2dν Ef −∞ Ef −∞
∆ν and ∆t are invariants by translation in t and ν. The product ∆t∆ν is invariant time/frequency contraction/dilatation.
JGS Basics about Fourier analysis Time-frequency incertitude principle 3/3
Gabor-Heisenberg incertitude principle We can prove that : 1 ∆t∆ν > 4π
Signals which are jointly of compact supports in both domains are gaussian signals.
JGS Basics about Fourier analysis 2D extension : continuous case
All previously principles can be directly extended to the 2D case, for a function f (x1, x2) :
the continuous FT is given by :
Z +∞ ˆ −2π(ν1x1+ν2x2) f (ν1, ν2) = f (x1, x2)e dx1dx2 −∞ and its inverse : Z +∞ ˆ +2π(ν1x1+ν2x2) f (x1, x2) = f (ν1, ν2)e dν1dν2 −∞
JGS Basics about Fourier analysis 2D extension : discrete case
Images f (i, j) are assume of size NxM
DFT : N−1 M−1 X X −2π( ki + lj ) F(k, l) = f (i, j)e N M i=0 j=0 inverse : N−1 M−1 1 X X 2π( ki + lj ) f (i, j) = F(k, l)e N M NM k=0 l=0
JGS Basics about Fourier analysis 2D extension : bars patterns
JGS Basics about Fourier analysis 2D extension : Lena
JGS Basics about Fourier analysis PART TWO Time-frequency analysis
JGS Basics about Fourier analysis Next on the menu ...
Time-frequency analysis Short Term Fourier Transform Limitations
JGS Basics about Fourier analysis Limitation of the Fourier transform
The FT has no “localization” notion : we cannot tell at which moment a frequency component appeared.
sinusoid (30 Hz) + Dirac (t = 0.3s)
JGS Basics about Fourier analysis Linear Chirp
Chirp from 10Hz to 100Hz over 2s
JGS Basics about Fourier analysis Local Fourier transform
Idea : “get a spetcrum per instant t : time-frequency analysis”
f(t)
t1 t2 t3 t
fˆ(t1, ν) fˆ(t2, ν) fˆ(t3, ν)
ν ν ν
ˆ R +∞ −2πνt But the FT is computed over R : f (ν) = −∞ f (t)e dt ⇒ nonlocal.
JGS Basics about Fourier analysis
t Short Term Fourier Transform
We can get the “localization” by considering a “small” portion ofthe signal “close” to the considered instant.
= signal windowing. ⇒
JGS Basics about Fourier analysis Short Term Fourier Transform
We can get the “localization” by considering a “small” portion ofthe signal “close” to the considered instant.
= signal windowing. ⇒
The window is centered at τ and we “slide” the window by tuning τ.
w(t)
f(t)
τ t
JGS Basics about Fourier analysis
t Time-frequency plane
We get a 2D representation (time + frequency axis) called “the time-frequency plane” or spectrogram
f(t)
τ1 τ2 t
τ ˆ τ2 f(τ2, ν)
ˆ τ1 f(τ1, ν)
ν
JGS Basics about Fourier analysis t Definition
The Short Term Fourier Transform can be written Z +∞ −2πνt Sf (ν, τ) = w(t τ)f (t)e dt −∞ − and we have Z +∞ Z +∞ 2πνt f (t) = Sf (ν, τ)w(t τ)e dτdν −∞ −∞ − where w(t) can be one of the previous windows.
JGS Basics about Fourier analysis Gabor-Heisenberg (optimal case = gaussian window) ∆t∆ν = cst. ⇒ ∆t, ∆ν are fixed by w(t). tiling of the time-frequency plane⇒
Important properties of the time-frequency plane
τ Sampling grid in time and frequency
ν
JGS Basics about Fourier analysis ∆t, ∆ν are fixed by w(t). tiling of the time-frequency plane⇒
Important properties of the time-frequency plane
τ Sampling grid in time and frequency Gabor-Heisenberg (optimal case = gaussian window) ∆t∆ν = cst. ⇒
ν
JGS Basics about Fourier analysis tiling of the time-frequency plane⇒
Important properties of the time-frequency plane
τ Sampling grid in time and frequency Gabor-Heisenberg (optimal case = gaussian window) ∆t∆ν = cst. ⇒ ∆t, ∆ν are fixed by w(t).
ν
JGS Basics about Fourier analysis Important properties of the time-frequency plane
τ Sampling grid in time and frequency Gabor-Heisenberg (optimal case = gaussian window) ∆t ∆t∆ν = cst. ⇒ ∆t, ∆ν are fixed by w(t). tiling of the time-frequency ⇒ ν plane ∆ν
JGS Basics about Fourier analysis Sinus + Dirac case
sinusoid (30 Hz) + Dirac (t = 0.3s)
JGS Basics about Fourier analysis Linear Chirp case
Chirp from 10Hz to 100Hz over 2s
JGS Basics about Fourier analysis Influence of the window size 1/2
L=32 Good time localization Bad frequency localization
JGS Basics about Fourier analysis Influence of the window size 1/2
L=64 Fair time localization Fair frequency localization
JGS Basics about Fourier analysis Influence of the window size 1/2
L=128 Bad time localization Good frequency localization
JGS Basics about Fourier analysis Influence of the window size 2/2
JGS Basics about Fourier analysis Influence of the window size 2/2
JGS Basics about Fourier analysis Influence of the window size 2/2
JGS Basics about Fourier analysis Limitations of the STFT 1/3
Depending on the frequency content we can need several resolutions. For instance, let the following signal :
2 cos(2π150t) if t ∈ [0; 1s] ∪ [0.4s; 0.78s] ∪ [0.8s; 1s] f (t) = 2 cos(2π150t) + 0.5 cos(2π30t) if t ∈ [0.39s; 0.4s] 2 cos(2π150t) + cos(2π400t) if t ∈ [0.78s; 0.8s]
400Hz
30Hz
150Hz
0.39 0.4 0.78 0.8 t 0 1
JGS Basics about Fourier analysis Limitations of the STFT 2/3
JGS Basics about Fourier analysis Limitations of the STFT 3/3
When different frequency component are present in the signal, it is better to have a STFT with a small window to analyze high frequencies and a wide window to analyze low frequencies. But this is impossible because the STFT provides a uniform time-frequency plane tiling !
= Use of wavelets : multiresolution analysis. ⇒
JGS Basics about Fourier analysis