Today s lecture The Fourier transform What is it? What is it useful for? What are its properties? Sampling, aliasing, interpolation The Fast Fourier Transform (FFT) algorithm
Jean Baptiste Joseph Fourier Born 21 March 1768, Auxerre (Bourgogne region). Died 16 May 1830, Paris. Same age as Napoleon Bonaparte. Permanent Secretary of the French Academy of Sciences (1822-1830). Foreign member of the Royal Swedish Academy of Sciences (1830).
The Fourier transform = + + +...
Fourier analysis
Fourier example
Fourier example
Fourier example
Fourier example
Complex numbers i= 1 i i= 1 x =a+i b x * =a i b * 2 2 (complex conjugate) 2 x x =a +b = x b x=arctan( ) a e i φ =cos φ+i sin φ x = A ei φ (Euler s formula)
Fourier basis function e iωx = cos(ω x )+i sin(ω x ) ω=2 π f = T 2π T
Fourier basis function e Ae iωx iωx * = cos(ω x )+i sin(ω x ) i ω x +A e is a real-valued function This is why we need negative frequencies At frequency ω we have weight A, at frequency -ω we have weight A*.
Fourier basis function Ae iωx * i ω x +A e e iωx is a real-valued function = cos(ω x )+i sin(ω x ) A= A {cos φ+i sin φ} Ae iωx * i ω x +A e =2 A cos(ω x+φ)
Fourier transform F (ω) = f (x) = f (x) e = F (ω1 )e + i ω1 x F (ω2 )e + i ω2 x F (ω3 )e + i ω3 x... i ω x + + +... dx
Inverse Fourier transform f (x) = 1 2π ω=2 π μ f ( x ) = frequency (periods/second) radial frequency (radian/second) F (ω) e iωx dω F (μ) ei 2 π μ x dμ
Spatial impulse 1 cosine 2 impulses sine 2 impulses box sinc sinc box Gaussian white noise Notice the symmetry! Gaussian white noise Frequency Fourier transform pairs
Fourier transform F (ω) = i ω x f (x) e dx ω=0 F (0) = f (x) d x Does this even exist???
Fourier transform F (ω) = f(x) i ω x f (x) e dx F(ω) ωc smooth function band limit (cutoff frequency) F(ω) = 0, ω > ωc
Sampling spatial domain continuous function sampling function sampled function frequency domain
Reconstruction spatial domain sampled function reconstruction function continuous function frequency domain
Aliasing spatial domain continuous function sampling function sampled function frequency domain
Aliasing Sampling distance
Aliasing
Avoid aliasing frequency domain continuous function sampling function sampled function F(ω) = 0, ω > ωc ωc ωs > 2ωc ωs Minimum sampling frequency Nyquist frequency
Example: aliasing
Example: aliasing When we downsample, we only keep this part!
Example: aliasing The spectrum is replicated, higher frequencies being duplicated as lower frequencies.
Example: Moire
Example: Moire
Discrete Fourier transform spatial domain continuous function sampled function continuous image discrete image frequency domain
Discrete Fourier transform N 1 F [k ] = i f [n] e 2π kn N n=0 N 1 f [ n] = 1 N F [k] e i 2 kn N k =0 Main difference with F(ω) is that F[k] is defined on a limited domain (N samples), and that these samples are assumed to repeat periodically: F[k] = F[k+N]. In the same way, f[n] is defined by N samples, which are assumed to repeat periodically: f[n] = f[n+n].
Discrete Fourier transform The DFT only has positive frequencies!?!?!? Remember: it is periodic! F[k] = F[k+N] Thus: F[-k] = F[N-k] k 0 N
Fourier transform in 2D, 3D, etc. Simplest thing there is! the FT is separable: Perform transform along x-axis, Perform transform along y-axis of result, Perform transform along z-axis of result, (etc.) m m v n m n M 1 F [u, v ] = N 1 m=0 n=0 u i 2 f [n, m] e un vm N M M 1 = u N 1 m=0 n=0 i f [n, m] e 2 un N i e 2 vm M
2D Fourier transform pairs sine box FT
2D Fourier transform pairs pillbox Gauss FT
2D transform example 1
2D transform example 1
2D transform example 2
2D transform example 2
2D transform example 3
2D transform example 3
2D transform example 4
2D transform example 4
2D transform example 5
2D transform example 5
Properties of the Fourier transform Spatial scaling Linear Amplitude scaling Addition Translation phase change real, even Symmetry real, even real, odd imaginary, odd
Properties of the Fourier transform Rotation
What is more important? Jean Baptiste Joseph Fourier magnitude phase
What is more important? magnitude phase
The Fast Fourier Transform (FFT) Clever algorithm to compute the DFT. Runs in O(N log N) time, rather than O(N2) time. Because of symmetry of the forward and inverse Fourier transforms, FFT can also compute the IDFT. i F [k ] =F even [k ]+F odd [k ]e 2π k N i F [k +M ] =F even [k ] F odd [k ]e N = 2n 0 M-1 N = 2M 2π k N N-1
Summary of today s lecture The Fourier transform decomposes a function (image) into trigonometric basis functions (sines & cosines). The Fourier transform is used to analyse frequency components of an image. Aliasing can be understood through the Fourier transform FFT is a fast algorithm to compute the DFT 2D FT is separable
Reading assignment The Fourier transform and the DFT Sampling and aliasing Sections 4.3, 4.5.4 The FFT Sections 4.2, 4.4, 4.5, 4.6, 4.11.1 Section 4.11.3 Exercises: 4.3 4.4 4.22