fouriertransform...
TRANSCRIPT
FOURIER TRANSFORM
APPLICATION TO SIGNAL PROCESSING
Pawel A. Penczek
The University of Texas – Houston Medical School, Department of Biochemistry
Wednesday, August 24, 2011
FOURIER TRANSFORMS
1.Fourier Transform
2.Fourier Series
3.Discrete Fourier Transform (DFT)
Wednesday, August 24, 2011
FOURIER TRANSFORMSThe Fourier transform is a generalization of the complex Fourier series in the limit of .L→∞
F s( ) = f x( )e−2π isx dx−∞
+∞
∫
f x( ) = F s( )e2π isx ds−∞
+∞
∫
Wednesday, August 24, 2011
FOURIER TRANSFORMSF s( ) = f x( )e−2π isx dx
−∞
+∞
∫
f x( ) = F s( )e2π isx ds−∞
+∞
∫Euler's formula: eix = cos x + i sin x
Since any function can be split into even and off portions:fE x( ) = 1
2f x( ) + f −x( )⎡⎣ ⎤⎦ fO x( ) = 1
2f x( ) − f −x( )⎡⎣ ⎤⎦
f x( ) = fE x( ) + fO x( )
a Fourier transform can always be expressed in terms of the Fourier cosine transform and Fourier sine transform as
F s( ) = fE x( )cos 2πisx( )dx−∞
+∞
∫ − i fO x( )sin 2π sx( )dx−∞
+∞
∫Wednesday, August 24, 2011
COMPLEX ALGEBRA
i2 = −1z,u ∈a,b ∈z = a + ibz∗ = a − ib
z 2 = a2 + b2
zu = ?zu* = ?z / u = ?
Complex numbers versus vectors
Wednesday, August 24, 2011
DIRAC (DELTA) FUNCTION*
*a misnomer, Dirac's delta is not a function, it is a distribution!
The Dirac delta function as the limit (in the sense of distributions) of the sequence of Gaussians:
δa x( ) =a→0
1a π
e− x
2
a2
The Dirac delta function, or δ function, is (informally) a generalized function depending on a real parameter such that it is zero for all values of the parameter except when the parameter is zero, and its integral over the parameter from −∞ to ∞ is equal to one. It is also known as unit impulse function.
Fourier transform of a delta function
δ x( )e−2π isx dx−∞
+∞
∫ = 1
e2π isx ds−∞
+∞
∫ = δ x( )
Wednesday, August 24, 2011
FOURIER PAIRS
Gaussian function top-hat function
Wednesday, August 24, 2011
FOURIER PAIRS
cosine function
sine function
Wednesday, August 24, 2011
PROPERTIES OF FOURIER TRANSFORM
Linearity
Rotation
Translation
Scaling
Conjugation
Parseval's theorem
If h x( ) = af x( ) + bg x( ), then H s( ) = aF s( ) + bG s( )
If R is a rotation matrix, FT f Rx( )( ) = H Rs( )
If h x( ) = f x − t( ), then H s( ) = e− i2π tsF s( )
If h x( ) = f ax( ), a ≠ 0, then H s( ) = 1aF s
a⎛⎝⎜
⎞⎠⎟
f x( ) 2 dx−∞
∞
∫ = F s( ) 2 ds−∞
∞
∫
FT −1 H ∗ s( )( ) = f −x( )
Density scaling
Rotation of FT,of power spectrum
Lossless shift
Scaling
1D - mirror2D - rotation by 180o
Preservation of energy,power spectrum
Wednesday, August 24, 2011
CROSS-CORRELATION THEOREM
c t( ) = f x( )g x + t( )dx−∞
∞
∫ = FT −1 F∗ s( )G s( )( )
SPECIAL CASE OF CCF, AUTOCORRELATION FUNCTION
a t( ) = f x( ) f x + t( )dx−∞
∞
∫ = FT −1 F∗ s( )F s( )( ) = FT −1 F s( ) 2( )
CONVOLUTION THEOREM
h = f ∗ g
h t( ) = f x( )g x − t( )dx−∞
+∞
∫ = FT −1 F s( )G s( )( )
Wednesday, August 24, 2011
CROSS-CORRELATION THEOREM
c t( ) = f x( )g x + t( )dx−∞
∞
∫ = FT −1 F∗ s( )G s( )( )
SPECIAL CASE OF CCF, AUTOCORRELATION FUNCTION
a t( ) = f x( ) f x + t( )dx−∞
∞
∫ = FT −1 F∗ s( )F s( )( ) = FT −1 F s( ) 2( )
CONVOLUTION THEOREM
h = f ∗ g
h t( ) = f x( )g x − t( )dx−∞
+∞
∫ = FT −1 F s( )G s( )( )
Wednesday, August 24, 2011
FOURIER SERIESA Fourier series is an expansion of a periodic function in terms of an infinite sum of sines and cosines.
Fourier series make use of the orthogonality relationships of the sine and cosine functions.
f x( ) = 12a0 + an cos nx( )
n=1
∞
∑ + bn sin nx( )n=1
∞
∑-π period +π
a0 =1π
f x( )dx−π
π
∫
an =1π
f x( )cos nx( )dx−π
π
∫
bn =1π
f x( )sin nx( )dx−π
π
∫
Wednesday, August 24, 2011
FOURIER SERIESGIBBS PHENOMENON
Ringing artifact near sharp edges that is due to truncation of Fourier series. Note the amplitude of oscillation is constant, does not depend on the number of Fourier coefficients included. Often observed when filter is incorrect (too sharp). Ringing can be reduced by making filter "smooth" - an extreme is a Gaussian filter. Regrettably, the cut-off frequency of a Gaussian filter is poorly defined and much noise in high frequencies passes through. There are many filters designed that offer a trade-off between sharpness (and thus artifacts) and smoothness (fewer artifacts but more noise): Butterworth, tangent..
Wednesday, August 24, 2011
Effects of top-hat, Gaussian, and Butterworth filters on a step function. Comparison of Gaussian and Butterworth filters.
Digital filters.
Wednesday, August 24, 2011
FOURIER SERIESAS AN EXPANSION IN AN ORTHONORMAL BASIS
Using Euler's formula
f x( ) = 12a0 + an cos nx( )
n=1
∞
∑ + bn sin nx( )n=1
∞
∑
einx = cosnx + i sinnx
f x( ) = cneinx
n=−∞
∞
∑ with Fourier coefficients(complex!) given by
cn =12π
f x( )e− inx dx−π
π
∫
an = cn + c−n , n = 0,1,2,…bn = i cn − c−n( ), n = 1,2,…
The set of functions forms an orthonormal basis for the Hilbert space
(of squared integrable functions on ) with an inner product
Indeed,
en = einx , n ∈{ } L2 −π ,π[ ]
−π ,π[ ] f ,g =def 12π
f x( )g∗ x( )dx−π
π
∫ .
en ,em =12π
einxe− imx dx−π
π
∫ =12π
ei n−m( )x dx−π
π
∫ = δnm .
Wednesday, August 24, 2011
DISCRETE FOURIER TRANSFORM (DFT)AS A REPRESENTATION IN AN ORTHONORMAL BASIS
DFT is a transformation of a finite (and presumably periodic) sequence of real or complex number into a finite space whose orthonormal basis is spanned by complex exponentials (discretized).
Xk = xne−
2π iN
kn
n=0
N
∑ k = 0,…,N −1
xk =1N
Xke2π iN
kn
k=0
N
∑ n = 0,…,N −1
xn
Re X0( ) 0 Re X1( ) Im X1( ) Re X2( ) Im X3( ) Re X3( ) Im X3( ) Re X4( ) 0⎡⎣⎢
⎤⎦⎥
Wednesday, August 24, 2011
DISCRETE FOURIER TRANSFORM (DFT)AS A REPRESENTATION IN AN ORTHONORMAL BASIS
DFT is a transformation of a finite (and presumably periodic) sequence of real or complex number into a finite space whose orthonormal basis is spanned by complex exponentials (discretized).
Xk = xne−
2π iN
kn
n=0
N
∑ k = 0,…,N −1
xk =1N
Xke2π iN
kn
k=0
N
∑ n = 0,…,N −1
xn
Re X0( ) 0 Re X1( ) Im X1( ) Re X2( ) Im X3( ) Re X3( ) Im X3( ) Re X4( ) 0⎡⎣⎢
⎤⎦⎥
Wednesday, August 24, 2011
DISCRETE FOURIER TRANSFORM (DFT)AS A REPRESENTATION IN AN ORTHONORMAL BASIS
DFT is a transformation of a finite (and presumably periodic) sequence of real or complex number into a finite space whose orthonormal basis is spanned by complex exponentials (discretized).
Xk = xne−
2π iN
kn
n=0
N
∑ k = 0,…,N −1
xk =1N
Xke2π iN
kn
k=0
N
∑ n = 0,…,N −1
xn
Re X0( ) 0 Re X1( ) Im X1( ) Re X2( ) Im X3( ) Re X3( ) Im X3( ) Re X4( ) 0⎡⎣⎢
⎤⎦⎥
Wednesday, August 24, 2011
DISCRETE FOURIER TRANSFORM (DFT)AS A REPRESENTATION IN AN ORTHONORMAL BASIS
DFT is a transformation of a finite (and presumably periodic) sequence of real or complex number into a finite space whose orthonormal basis is spanned by complex exponentials (discretized).
Xk = xne−
2π iN
kn
n=0
N
∑ k = 0,…,N −1
xk =1N
Xke2π iN
kn
k=0
N
∑ n = 0,…,N −1
xn
Re X0( ) 0 Re X1( ) Im X1( ) Re X2( ) Im X3( ) Re X3( ) Im X3( ) Re X4( ) 0⎡⎣⎢
⎤⎦⎥
X0X1
XN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
=
wN0i0 wN
0i1 wN0i(N −1)
wN1i0 wN
1i1 wN1i(N −1)
wN(N −1)i0 wN
(N −1)i1 wN(N −1)i(N −1)
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
x0x1xN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
wN = e−2π i
N
Wednesday, August 24, 2011
FAST FOURIER TRANSFORM (FFT) ALGORITHM FOR DFTRADIX-2
Cooley, James W., and John W. Tukey, "An algorithm for the machine calculation of complex Fourier series," Math. Comput. 19, 297–301 (1965)Gauss, Carl Friedrich, "Nachlass: Theoria interpolationis methodo nova tractata", Werke, Band 3, 265–327 (Königliche Gesellschaft der Wissenschaften, Göttingen, 1866) (1805)
X0X1
XN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
=
wN0i0 wN
0i1 wN0i(N −1)
wN1i0 wN
1i1 wN1i(N −1)
wN(N −1)i0 wN
(N −1)i1 wN(N −1)i(N −1)
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
x0x1xN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
wN = e−2π i
N
FN - N2 fps
Wednesday, August 24, 2011
FAST FOURIER TRANSFORM (FFT) ALGORITHM FOR DFTRADIX-2
Cooley, James W., and John W. Tukey, "An algorithm for the machine calculation of complex Fourier series," Math. Comput. 19, 297–301 (1965)Gauss, Carl Friedrich, "Nachlass: Theoria interpolationis methodo nova tractata", Werke, Band 3, 265–327 (Königliche Gesellschaft der Wissenschaften, Göttingen, 1866) (1805)
X0X1
XN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
=
wN0i0 wN
0i1 wN0i(N −1)
wN1i0 wN
1i1 wN1i(N −1)
wN(N −1)i0 wN
(N −1)i1 wN(N −1)i(N −1)
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
x0x1xN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
wN = e−2π i
N
FN - N2 fps
F8=
w w 0 0 0 0 0 00 0 w w 0 0 0 00 0 0 0 w −w 0 00 0 0 0 0 0 w −ww −w 0 0 0 0 0 00 0 w −w 0 0 0 00 0 0 0 w w 0 00 0 0 0 0 0 w w
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥
w 0 w 0 0 0 0 00 w 0 w 0 0 0 00 0 0 0 w 0 −w 00 0 0 0 0 w 0 −ww 0 −w 0 0 0 0 00 w 0 −w 0 0 0 00 0 0 0 w 0 w 00 0 0 0 0 w 0 w
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥
w 0 0 0 w 0 0 00 w 0 0 0 w 0 00 0 w 0 0 0 w 00 0 0 w 0 0 0 ww 0 0 0 −w 0 0 00 w 0 0 0 −w 0 00 0 w 0 0 0 −w 00 0 0 w 0 0 0 −w
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥
Wednesday, August 24, 2011
FAST FOURIER TRANSFORM (FFT) ALGORITHM FOR DFTRADIX-2
Cooley, James W., and John W. Tukey, "An algorithm for the machine calculation of complex Fourier series," Math. Comput. 19, 297–301 (1965)Gauss, Carl Friedrich, "Nachlass: Theoria interpolationis methodo nova tractata", Werke, Band 3, 265–327 (Königliche Gesellschaft der Wissenschaften, Göttingen, 1866) (1805)
X0X1
XN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
=
wN0i0 wN
0i1 wN0i(N −1)
wN1i0 wN
1i1 wN1i(N −1)
wN(N −1)i0 wN
(N −1)i1 wN(N −1)i(N −1)
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
x0x1xN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
wN = e−2π i
N
FN - N2 fps
F8=
w w 0 0 0 0 0 00 0 w w 0 0 0 00 0 0 0 w −w 0 00 0 0 0 0 0 w −ww −w 0 0 0 0 0 00 0 w −w 0 0 0 00 0 0 0 w w 0 00 0 0 0 0 0 w w
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥
w 0 w 0 0 0 0 00 w 0 w 0 0 0 00 0 0 0 w 0 −w 00 0 0 0 0 w 0 −ww 0 −w 0 0 0 0 00 w 0 −w 0 0 0 00 0 0 0 w 0 w 00 0 0 0 0 w 0 w
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥
w 0 0 0 w 0 0 00 w 0 0 0 w 0 00 0 w 0 0 0 w 00 0 0 w 0 0 0 ww 0 0 0 −w 0 0 00 w 0 0 0 −w 0 00 0 w 0 0 0 −w 00 0 0 w 0 0 0 −w
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥
FFT - 2N log2N fps!Wednesday, August 24, 2011
FAST FOURIER TRANSFORM (FFT) ALGORITHM FOR DFTRADIX-2
Cooley, James W., and John W. Tukey, "An algorithm for the machine calculation of complex Fourier series," Math. Comput. 19, 297–301 (1965)Gauss, Carl Friedrich, "Nachlass: Theoria interpolationis methodo nova tractata", Werke, Band 3, 265–327 (Königliche Gesellschaft der Wissenschaften, Göttingen, 1866) (1805)
X0X1
XN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
=
wN0i0 wN
0i1 wN0i(N −1)
wN1i0 wN
1i1 wN1i(N −1)
wN(N −1)i0 wN
(N −1)i1 wN(N −1)i(N −1)
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
x0x1xN −1
⎡
⎣
⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥
wN = e−2π i
N
FN - N2 fps
FFT - 2N log2N fps!Wednesday, August 24, 2011
FOURIER
DECOMPOSITION SYNTHESIS
Amplitudes
8.2
3.1
2.1
1.0
1.5
2.0
0.6
1.0
Wednesday, August 24, 2011
2D FT
⊗
c0,0 c0,1 c0,2 c0,3 c0,4 c0,5 c0,6 c0,7c1,0 c1,1 c1,2
c2,0
c3,0
c4,0
c5,0
c6,0
c7,0 c7,1 c7,7
⎡
⎣
⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢⎢
⎤
⎦
⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥⎥
=
amplitude: Ai, j = ci, j = Re ci, j( )2+ Im ci, j( )2
phase: ϕ i, j = atan2 Im ci, j( ),Re ci, j( )( )Wednesday, August 24, 2011
DFT CASE STUDY:POWER SPECTRUM (PS)
Stationary random process (signal + noise): f(x)
The power spectrum S(f) is the Fourier transform of the autocorrelation function of the process.
Sf s( ) = a τ( )e−2π isτ dτ−∞
∞
∫
Periodogram is the squared amplitude of the Fourier transform of the process.
Periodogram is a very poor estimator of the power spectrum: its relative error is 100% and it is biased. Finally, it does not converge to the true power spectrum with increased window size.
Pf s( ) = f x( )e−2π isx dx−∞
∞
∫2
Ansemble average (expected value) of periodogram approximates power spectrum.
E Pf s( )⎡⎣ ⎤⎦→ Sf s( )Wednesday, August 24, 2011
DFT CASE STUDY:POWER SPECTRUM (PS) ESTIMATION
AVERAGING OF PERIODOGRAMS - WELCH METHOD
.
.
.
+
Zhu, J., Penczek, P.A., Schröder, R., and Frank, J. (1997). Three-dimensional reconstruction with contrast transfer function correction from energy-filtered cryoelectron micrographs: procedure and application to the 70S Escherichia coli ribosome. Journal of Structural Biology 118, 197-219.
Average of periodogramsreduced variance
50% overlap
Rotational average
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
c t( ) = f x( )g x + t( )dx−∞
+∞
∫ = FT −1 F∗ s( )G s( )( )
ck = flgl+ k−∞
∞
∑ = FT −1 F∗G( )
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
c t( ) = f x( )g x + t( )dx−∞
+∞
∫ = FT −1 F∗ s( )G s( )( )
ck = flgl+ k−∞
∞
∑ = FT −1 F∗G( )
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
c t( ) = f x( )g x + t( )dx−∞
+∞
∫ = FT −1 F∗ s( )G s( )( )
ck = flgl+ k−∞
∞
∑ = FT −1 F∗G( )
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
Discrete FT is periodic, thus it "sees" a single image as periodic.
wrap-around effect
... ...
ck = flg l+ k( )mod N0
N −1
∑ = FT −1 F∗G( )k = −N
2,…,N 2
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
Discrete FT is periodic, thus it "sees" a single image as periodic.
wrap-around effect
... ...
ck = flg l+ k( )mod N0
N −1
∑ = FT −1 F∗G( )k = −N
2,…,N 2
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
To avoid wrap-around effect, pad image with zeroes (or something else??).
ck = flpadgl+ k
pad
l=0
N −1
∑ = FT −1 F pad∗Gpad( )k = −N
2,…,N 2Each ccf coefficient is computed using
different number of image points!Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
To avoid wrap-around effect, pad image with zeroes (or something else??).
ck = flpadgl+ k
pad
l=0
N −1
∑ = FT −1 F pad∗Gpad( )k = −N
2,…,N 2Each ccf coefficient is computed using
different number of image points!Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
To avoid wrap-around effect, pad image with zeroes (or something else??).
ck = flpadgl+ k
pad
l=0
N −1
∑ = FT −1 F pad∗Gpad( )k = −N
2,…,N 2Each ccf coefficient is computed using
different number of image points!Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
To avoid uneven normalization problem, normalize by lag padded ccf.
ck =1
N − kflpadgl+ k
pad
l=0
N −1
∑ =1
N − kFT −1 F pad∗Gpad( )
k = −N2,…,N 2
The variance of ccf coefficients increases with lags!
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
To avoid uneven normalization problem, normalize by lag padded ccf.
ck =1
N − kflpadgl+ k
pad
l=0
N −1
∑ =1
N − kFT −1 F pad∗Gpad( )
k = −N2,…,N 2
The variance of ccf coefficients increases with lags!
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
To avoid uneven normalization problem, normalize by lag padded ccf.
ck =1
N − kflpadgl+ k
pad
l=0
N −1
∑ =1
N − kFT −1 F pad∗Gpad( )
k = −N2,…,N 2
The variance of ccf coefficients increases with lags!
Wednesday, August 24, 2011
DFT CASE STUDY:CROSS-CORRELATION
Which ccf should I use?
ck = flg l+ k( )mod N0
N −1
∑ = FT −1 F∗G( )
ck = flpadgl+ k
pad
l=0
N −1
∑ = FT −1 F pad∗Gpad( )
ck =1
N − kflpadgl+ k
pad
l=0
N −1
∑ =1
N − kFT −1 F pad∗Gpad( )
Wednesday, August 24, 2011
Tomographyhistorical background
1956 - Bracewell reconstructed sun spots from multiple projection views of the Sun from the Earth.
1967 - Medical Research Council Laboratory, Cambridge, England: Aaron Klug and grad student David DeRosier reconstructed three-dimensional structures of viruses.
1969 – W. Hoppe (Germany) proposed three-dimensional high resolution electron microscopy of non-periodic biological structures.
1972 - British engineer Godfrey Hounsfield of EMI Laboratories, England, and independently South African born physicist Allan Cormack of Tufts University, Massachusetts, invented CAT (Computed Axial Tomography) scanner. Tomography is from the Greek word τοµή meaning "slice" or "section" and graphia meaning "describing".
Wednesday, August 24, 2011