Digital Signal Processing The Short-Time Fourier Transform ...
Introduction to Fourier transform and signal analysis
Transcript of Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Introduction to Fourier transform and signalanalysis
Zong-han, [email protected]
January 7, 2015
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
License of this document
Introduction to Fourier transform and signal analysis by Zong-han,Xie ([email protected]) is licensed under a Creative CommonsAttribution-NonCommercial 4.0 International License.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Outline
1 Continuous Fourier transform
2 Discrete Fourier transform
3 References
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Orthogonal condition
Any two vectors a, b satisfying following condition aremutually orthogonal.
a∗ · b = 0 (1)
Any two functions a(x), b(x) satisfying the followingcondition are mutually orthogonal.
∫a∗(x) · b(x)dx = 0 (2)
* means complex conjugate.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Complete and orthogonal basis
cos nx and sinmx are mutually orthogonal in which n and mare integers. ∫ π
−πcos nx · sinmxdx = 0∫ π
−πcos nx · cosmxdx = πδnm∫ π
−πsin nx · sinmxdx = πδnm (3)
δnm is Dirac-delta symbol. It means δnn = 1 and δnm = 0when n 6= m.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series
Since cos nx and sinmx are mutually orthogonal, we can expandan arbitrary periodic function f (x) by them. we shall have a seriesexpansion of f (x) which has 2π period.
f (x) = a0 +∞∑k=1
(ak cos kx + bk sin kx)
a0 =1
2π
∫ π
−πf (x)dx
ak =1
π
∫ π
−πf (x) cos kxdx
bk =1
π
∫ π
−πf (x) sin kxdx (4)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series
If f (x) has L period instead of 2π, x is replaced with πx/L.
f (x) = a0 +∞∑k=1
(ak cos
2kπx
L+ bk sin
2kπx
L
)
a0 =1
L
∫ L2
− L2
f (x)dx
ak =2
L
∫ L2
− L2
f (x) cos2kπx
Ldx , k = 1, 2, ...
bk =2
L
∫ L2
− L2
f (x) sin2kπx
Ldx , k = 1, 2, ... (5)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series of step function
f (x) is a periodic function with 2π period and it’s defined asfollows.
f (x) = 0,−π < x < 0
f (x) = h, 0 < x < π (6)
Fourier series expansion of f (x) is
f (x) =h
2+
2h
π
(sin x
1+
sin 3x
3+
sin 5x
5+ ...
)(7)
f (x) is piecewise continuous within the periodic region. Fourierseries of f (x) converges at speed of 1/n.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series of step function
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series of triangular function
f (x) is a periodic function with 2π period and it’s defined asfollows.
f (x) = −x ,−π < x < 0
f (x) = x , 0 < x < π (8)
Fourier series expansion of f (x) is
f (x) =π
2− 4
π
∑n=1,3,5...
(cos nx
n2
)(9)
f (x) is continuous and its derivative is piecewise continuous withinthe periodic region. Fourier series of f (x) converges at speed of1/n2.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series of triangular function
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series of full wave rectifier
f (t) is a periodic function with 2π period and it’s defined asfollows.
f (t) = − sinωt,−π < t < 0
f (t) = sinωt, 0 < t < π (10)
Fourier series expansion of f (x) is
f (t) =2
π− 4
π
∑n=2,4,6...
(cos nωt
n2 − 1
)(11)
f (x) is continuous and its derivative is piecewise continuous withinthe periodic region. Fourier series of f (x) converges at speed of1/n2.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier series of full wave rectifier
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Complex Fourier series
Using Euler’s formula, Eq. 4 becomes
f (x) = a0 +∞∑k=1
(ak − ibk
2e ikx +
ak + ibk2
e−ikx)
Let c0 ≡ a0, ck ≡ ak−ibk2 and c−k ≡ ak+ibk
2 , we have
f (x) =∞∑
m=−∞cme
imx
cm =1
2π
∫ π
−πf (x)e−imxdx (12)
e imx and e inx are also mutually orthogonal provided n 6= m and itforms a complete set. Therfore, it can be used as orthogonal basis.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Complex Fourier series
If f (x) has T period instead of 2π, x is replaced with 2πx/T .
f (x) =∞∑
m=−∞cme
i 2πmxT
cm =1
T
∫ T2
−T2
f (x)e−i2πmxT dx ,m = 0, 1, 2... (13)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier transform
from Eq. 13, we define variables k ≡ 2πmT , f (k) ≡ cmT√
2πand
4k ≡ 2π(m+1)T − 2πm
T = 2πT .
We can have
f (x) =1√2π
∞∑m=−∞
f (k)e ikx 4 k
f (k) =1√2π
∫ T2
−T2
f (x)e−ikxdx
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier transform
Let T −→∞
f (x) =1√2π
∫ ∞−∞
f (k)e ikxdk (14)
f (k) =1√2π
∫ ∞−∞
f (x)e−ikxdx (15)
Eq.15 is the Fourier transform of f (x) and Eq.14 is the inverseFourier transform of f (k).
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Properties of Fourier transform
f (x), g(x) and h(x) are functions and their Fourier transforms aref (k), g(k) and h(k). a, b x0 and k0 are real numbers.
Linearity: If h(x) = af (x) + bg(x), then Fourier transform ofh(x) equals to h(k) = af (k) + bg(k).
Translation: If h(x) = f (x − x0), then h(k) = f (k)e−ikx0
Modulation: If h(x) = e ik0x f (x), then h(k) = f (k − k0)
Scaling: If h(x) = f (ax), then h(k) = 1a f (ka )
Conjugation: If h(x) = f ∗(x), then h(k) = f ∗(−k). With thisproperty, one can know that if f (x) is real and thenf ∗(−k) = f (k). One can also find that if f (x) is real and then|f (k)| = |f (−k)|.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Properties of Fourier transform
If f (x) is even, then f (−k) = f (k).
If f (x) is odd, then f (−k) = −f (k).
If f (x) is real and even, then f (k) is real and even.
If f (x) is real and odd, then f (k) is imaginary and odd.
If f (x) is imaginary and even, then f (k) is imaginary and even.
If f (x) is imaginary and odd, then f (k) is real and odd.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Dirac delta function
Dirac delta function is a generalized function defined as thefollowing equation.
f (0) =
∫ ∞−∞
f (x)δ(x)dx∫ ∞−∞
δ(x)dx = 1 (16)
The Dirac delta function can be loosely thought as a functionwhich equals to infinite at x = 0 and to zero else where.
δ(x) =
{+∞, x = 0
0, x 6= 0
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Dirac delta function
From Eq.15 and Eq.14
f (k) =1
2π
∫ ∞−∞
∫ ∞−∞
f (k ′)e ik′xdk ′e−ikxdx
=1
2π
∫ ∞−∞
∫ ∞−∞
f (k ′)e i(k′−k)xdxdk ′
Comparing to ”Dirac delta function”, we have
f (k) =
∫ ∞−∞
f (k ′)δ(k ′ − k)dk ′
δ(k ′ − k) =1
2π
∫ ∞−∞
e i(k′−k)xdx (17)
Eq.17 doesn’t converge by itself, it is only well defined as part ofan integrand.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Convolution theory
Considering two functions f (x) and g(x) with their Fouriertransform F (k) and G (k). We define an operation
f ∗ g =
∫ ∞−∞
g(y)f (x − y)dy (18)
as the convolution of the two functions f (x) and g(x) over theinterval {−∞ ∼ ∞}. It satisfies the following relation:
f ∗ g =
∫ ∞−∞
F (k)G (k)e ikxdt (19)
Let h(x) be f ∗ g and h(k) be the Fourier transform of h(x), wehave
h(k) =√
2πF (k)G (k) (20)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Parseval relation
∫ ∞−∞
f (x)g(x)∗dx =
∫ ∞−∞
1√2π
∫ ∞−∞
F (k)e ikxdk1√2π∫ ∞
−∞G ∗(k ′)e−ik
′xdk ′dx
=
∫ ∞−∞
1
2π
∫ ∞−∞
F (k)G ∗(k ′)e i(k−k′)xdkdk ′
By using Eq. 17, we have the Parseval’s relation.∫ ∞−∞
f (x)g∗(x)dx =
∫ ∞−∞
F (k)G ∗(k)dk (21)
Calculating inner product of two fuctions gets same result as theinner product of their Fourier transform.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Cross-correlation
Considering two functions f (x) and g(x) with their Fouriertransform F (k) and G (k). We define cross-correlation as
(f ? g)(x) =
∫ ∞−∞
f ∗(x + y)g(x)dy (22)
as the cross-correlation of the two functions f (x) and g(x) overthe interval {−∞ ∼ ∞}. It satisfies the following relation: Leth(x) be f ? g and h(k) be the Fourier transform of h(x), we have
h(k) =√
2πF ∗(k)G (k) (23)
Autocorrelation is the cross-correlation of the signal with itself.
(f ? f )(x) =
∫ ∞−∞
f ∗(x + y)f (x)dy (24)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Uncertainty principle
One important properties of Fourier transform is the uncertaintyprinciple. It states that the more concentrated f (x) is, the morespread its Fourier transform f (k) is.Without loss of generality, we consider f (x) as a normalizedfunction which means
∫∞−∞ |f (x)|2dx = 1, we have uncertainty
relation:(∫ ∞−∞
(x − x0)2|f (x)|2dx)(∫ ∞
−∞(k − k0)2|f (k)|2dk
)=
1
16π2(25)
for any x0 and k0 ∈ R. [3]
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier transform of a Gaussian pulse
f (x) = f0e−x2
2σ2 e ik0x
f (k) =1√2π
∫ ∞−∞
f (x)e−ikxdx
=f0
1/σ2e−(k0−k)2
2/σ2
|f (k)|2 ∝ e−(k0−k)2
1/σ2
Wider the f (x) spread, the more concentrated f (k) is.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier transform of a Gaussian pulse
Signals with different width.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Fourier transform of a Gaussian pulse
The bandwidth of the signals are different as well.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Outline
1 Continuous Fourier transform
2 Discrete Fourier transform
3 References
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Nyquist critical frequency
Critical sampling of a sine wave is two sample points per cycle.This leads to Nyquist critical frequency fc .
fc =1
2∆(26)
In above equation, ∆ is the sampling interval.Sampling theorem: If a continuos signal h(t) sampled with interval∆ happens to be bandwidth limited to frequencies smaller than fc .h(t) is completely determined by its samples hn. In fact, h(t) isgiven by
h(t) = ∆∞∑
n=−∞hn
sin[2πfc(t − n∆)]
π(t − n∆)(27)
It’s known as Whittaker - Shannon interpolation formula.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Discrete Fourier transform
Signal h(t) is sampled with N consecutive values and samplinginterval ∆. We have hk ≡ h(tk) and tk ≡ k ∗∆,k = 0, 1, 2, ...,N − 1.With N discrete input, we evidently can only output independentvalues no more than N. Therefore, we seek for frequencies withvalues
fn ≡n
N∆, n = −N
2, ...,
N
2(28)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Discrete Fourier transform
Fourier transform of Signal h(t) is H(f ). We have discrete Fouriertransform Hn.
H(fn) =
∫ ∞−∞
h(t)e−i2πfntdt ≈ ∆N−1∑k=0
hke−i2πfntk
= ∆N−1∑k=0
hke−i2πkn/N
Hn ≡N−1∑k=0
hke−i2πkn/N (29)
Inverse Fourier transform is
hk ≡ 1
N
N−1∑n=0
Hnei2πkn/N (30)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Periodicity of discrete Fourier transform
From Eq.29, if we substitute n with n + N, we have Hn = Hn+N .Therefore, discrete Fourier transform has periodicity of N.
Hn+N =N−1∑k=0
hke−i2πk(n+N)/N
=N−1∑k=0
hke−i2πk(n)/Ne−i2πkN/N
= Hn (31)
Critical frequency fc corresponds to 12∆ .
We can see that discrete Fourier transform has fs period wherefs = 1/∆ = 2 ∗ fc is the sampling frequency.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing
If we have a signal with its bandlimit larger than fc , we havefollowing spectrum due to periodicity of DFT.
Aliased frequency is f − N ∗ fs where N is an integer.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: original signal
Let’s say we have a sinusoidal sig-nal of frequency 0.05. The sampling interval is 1. We have the signal
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: spectrum of original signal
and we have its spectrum
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: critical sampling of original signal
The critical sampling interval of the original signal is 10 which ishalf of the signal period.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: under sampling of original signal
If we sampled the original sinusiodal signal with period 12, aliasinghappens.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: DFT of under sampled signal
fc of downsampled signal is 12∗12 , aliased frequency is
f − 2 ∗ fc = −0.03333 and it has symmetric spectrum due to realsignal.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: two frequency signal
Let’s say we have a signal containing two sinusoidal signal offrequency 0.05 and 0.0125. The sampling interval is 1. We havethe signal
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: spectrum of two frequency signal
and we have its spectrum
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: downsampled two frequency signal
Doing same undersampling with interval 12.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Aliasing example: DFT of downsampled signal
We have the spectrum of downsampled signal.
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Filtering
We now want to get one of the two frequency out of the signal.Wewill adapt a proper rectangular window to the spectrum.Assuming we have a filter function w(f ) and a multi-frequencysignal f (t), we simply do following steps to get the frequency bandwe want.
F−1{w(f )F{f (t)}} (32)
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Filtering example: filtering window and signal spectrum
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Filtering example: filtered signal
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
Outline
1 Continuous Fourier transform
2 Discrete Fourier transform
3 References
Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
References
Supplementary Notes of General Physics by Jyhpyng Wang,http:
//idv.sinica.edu.tw/jwang/SNGP/SNGP20090621.pdf
http://en.wikipedia.org/wiki/Fourier_series
http://en.wikipedia.org/wiki/Fourier_transform
http://en.wikipedia.org/wiki/Aliasing
http://en.wikipedia.org/wiki/Nyquist-Shannon_
sampling_theorem
MATHEMATICAL METHODS FOR PHYSICISTS by GeorgeB. Arfken and Hans J. Weber. ISBN-13: 978-0120598762
Numerical Recipes 3rd Edition: The Art of ScientificComputing by William H. Press (Author), Saul A. Teukolsky.ISBN-13: 978-0521880688Zong-han, [email protected] Introduction to Fourier transform and signal analysis
Continuous Fourier transformDiscrete Fourier transform
References
References
Chapter 12 and 13 inhttp://www.nrbook.com/a/bookcpdf.php
http://docs.scipy.org/doc/scipy-0.14.0/reference/fftpack.html
http://docs.scipy.org/doc/scipy-0.14.0/reference/signal.html
Zong-han, [email protected] Introduction to Fourier transform and signal analysis