The Fourier Transform CS/BIOEN 4640: Image Processing Basics March 20, 2012
Why Study Spectral Methods? ◮ Is often more efficient method for filtering than convolution ◮ Helps us understand image sampling, filtering, and aliasing ◮ Used in image compression ◮ Important for solving PDEs in image processing ◮ Fourier transform used in MRI
Harmonic Analysis ◮ Decompose a function into 0 1 basic waves called “harmonics” 1/2 ◮ Any signal can be written as a 1/3 1/4 summation of harmonics 1/5 ◮ Think of sound waves and 1/6 music: harmonics are pure 1/7 tones
Sine and Cosine Functions Harmonics are given by sine and cosine functions 1.0 sin cos 0.5 0.0 −0.5 −1.0 0 1 2 3 4 5 6 7
Wave Properties: Frequency 1.0 sin(t) sin(2t) sin(3t) Frequency is how 0.5 many times a wave repeats. 0.0 cos ( ω x ) sin ( ω x ) and −0.5 ω is the frequency −1.0 0 1 2 3 4 5 6
Wave Properties: Amplitude 3 sin(t) 2 sin(t) 3 sin(t) 2 Amplitude is the height of the wave. 1 0 a · cos ( x ) a · sin ( x ) and −1 a is the amplitude −2 −3 0 1 2 3 4 5 6
Wave Properties: Phase 1.0 sin(t) sin(t − pi/4) sin(t − pi/2) Phase is the horizon- 0.5 tal shift of the wave. 0.0 cos ( x − φ ) and sin ( x − φ ) −0.5 φ is the phase shift −1.0 0 1 2 3 4 5 6
Who’s This Guy? While studying heat conduc- tion, Fourier discovered that functions could be decom- posed into summations of cosine waves with different amplitudes and frequencies. Trivia fact: Fourier also first described the greenhouse ef- Jean Baptiste Joseph de Fourier fect! (1768 - 1830)
Fourier Series Definition Consider a function g ( x ) that is periodic on [ 0 , 2 π ω 0 ] It’s Fourier series is given as ∞ � g ( x ) = [ A k cos ( k ω 0 x ) + B k sin ( k ω 0 x )] , k = 0 where A k , B k are constants called the Fourier coefficients .
Complex Numbers Definition A complex number is an ordered pair of real numbers, z = ( a , b ) , with a the real part and b the imaginary part . Also written as z = a + ib , √ where i = − 1 is the imaginary unit . The set of complex numbers is denoted C .
Complex Numbers as 2D Coordinates Im a+bi The real and imaginary parts of b z = a + ib are the coordinates: Re { z } = a Im { z } = b Re 0 a
Complex Number Arithmetic Take two complex numbers z 1 = ( a 1 , b 1 ) and z 2 = ( a 2 , b 2 ) . ◮ Addition z 1 + z 2 = ( a 1 + a 2 , b 1 + b 2 ) ◮ Multiplication z 1 · z 2 = ( a 1 + ib 1 ) · ( a 2 + ib 2 ) = ( a 1 a 2 − b 1 b 2 ) + i ( a 1 b 2 + a 2 b 1 )
Conjugation and Absolute Value Consider a complex number z = ( a , b ) ◮ Conjugation: Simply negate the imaginary part: z ∗ = a − ib ◮ Absolute value: Same as 2D vector length: � a 2 + b 2 | z | = Also given by | z | = √ z · z ∗
Euler’s Representation of Complex Numbers Im ◮ A complex number can be given as an angle φ and a radius r r ◮ Think 2D polar coordinates φ ◮ Exponential form: Re 0 re i φ = r cos ( φ ) + i ( r sin ( φ ))
Operations in Euler’s Notation Take z 1 = r 1 e i θ 1 and z 2 = r 2 e i θ 2 . ◮ Multiplication: z 1 · z 2 = r 1 r 2 e i ( θ 1 + θ 2 ) ◮ Conjugation: z ∗ 1 = r 1 e − i θ 1 ◮ Absolute value: | z 1 | = r 1
Fourier Integral For periodic functions we have the Fourier series: ∞ � g ( x ) = [ A k cos ( k ω 0 x ) + B k sin ( k ω 0 x )] , k = 0 But for nonperiodic functions we need a continuum of frequencies. So, our Fourier series becomes an integral: � ∞ g ( x ) = A ω cos ( ω x ) + B ω sin ( ω x ) d ω 0
Computing Fourier Coefficients Fourier coefficients describe how much a particular frequency ω contributes to the function g . They are computed by just multiplying and integrating with cos/sin waves: � ∞ A ω = A ( ω ) = 1 g ( x ) · cos ( ω x ) dx π −∞ � ∞ B ω = B ( ω ) = 1 g ( x ) · sin ( ω x ) dx π −∞
Fourier Transform Now, let’s put the B coefficient (the sine part) into the imaginary part of a complex number � π � � G ( ω ) = A ( ω ) − i · B ( ω ) 2 � ∞ 1 � � = √ g ( x ) · cos ( ω x ) − i · sin ( ω x ) dx 2 π −∞ � ∞ 1 g ( x ) · e − i ω x dx √ = 2 π −∞
Recommend
More recommend