W08 - D01 Computati212onal Methods in Physics
W08 - D01 Computati212onal Methods in Physics
Phys 168
The FTs PoV: any signal can be made from circular motion or repeating cycles. Anything in the world can be described via a waveform - a function of time, space or some other variable.
Fourier introduced the concept of representing a given function by a trigonometric series of sines and cosines: For instance, sound waves, electromagnetic fields, radar detection systems, musical notes, TV signals, cell phone signals, etc
Example:
The motivation for the Fourier transform comes from the study of Fourier series. In the study of Fourier series, complicated but periodic functions are written as the sum of simple waves mathematically represented by sines and cosines. The Fourier transform is an extension of the Fourier series that results when the period of the represented function is lengthened and allowed to approach infinity.
Fourier Series
Fourier Series Representation of a function f(x): 0 = + 2
cos + sin () ; (, ]
At that time, this was still a shocking assertion! To solve for the coefficients and :
Assume for the moment f(x) is a uniformly convergent series Multiply both sides with cos(mx) or sin(mx) Integrate from (, ]
Fourier Series
To solve for the coefficients and :
0 = + 2
cos + sin () ; (, ]
0 cos = cos + 2
cos cos +
sin () cos
Fourier Series
To solve for the coefficients and :
0 = + 2
cos + sin () ; (, ]
cos cos +
sin () cos
Fourier Series
To solve for the coefficients and :
0 = + 2
cos + sin () ; (, ]
cos cos +
sin () cos
integral= Integral=0
if = if
Fourier Series
To solve for the coefficients and :
0 = + 2
cos + sin () ; (, ]
cos cos +
sin () cos
integral= Integral=0
if = if
Integral=ZERO orthogonality
Fourier Series
To solve for the coefficients and :
0 = + 2
cos + sin () ; (, ]
cos cos +
sin () cos
integral= Integral=0
if = if
1
Integral=ZERO orthogonality
cos =
cos ; 0
Fourier Series
Now we have the coefficient :
cos = sin =
= =
1 1
These are the Fourier Coefficients. This expansion produces 2periodic functions since they are constructed from sines and consines on the interval (, ].
Fourier Series
In general, the expansion produces the Fourier series on the domain [, ]:
/ =
; =
1 2
Fourier Transform
The Fourier transform (frequency domain representation) over the domain [, ] is defined as: 1 () = 2 Its inverse (time domain representation) is given as: 1 () = 2
This is known as Fourier Inversion Theorem, and was first introduced in Fourier's Analytical Theory of Heat. The functions f(x) and F(k) often are referred to as Fourier integral pair or Fourier transform pair We again note that formally, the transform is over the entire real line [, ] whereas our computational domain is only over a finite domain [, ]. Further, the Kernel of the transform, , describes oscillatory behavior. Thus the Fourier transform is essentially an eigenfunction expansion over all continuous wavenumbers k. And once we are on a finite domain [, ], the continuous eigenfunction expansion becomes a discrete sum of eigenfunctions and associated wavenumbers (eigenvalues).
= ()
hat represents the Fourier Transform In general, we have the relation between the Fourier Transform of the derivative and the Fourier Transform itself: = ()
1 2 exp ( ) 2 4
Example: Derivative
L=20; % define the computational domain [-L/2,L/2] n=128; % define the number of Fourier modes 2^n x2=linspace(-L/2, L/2, n+1); % define the domain discretization x=x2(1:n); % consider only the first n points: periodicity k = (2*pi/L) * [0:(n/2-1) (-n/2):-1]; % k rescaled to 2pi domain ks = fftshift(k); % shift of k domain
= ()
u=sech(x) % function to take a derivative of ud = -sech(x).*tanh(x); % analytical 1st-derivative of the function u2d = sech(x)-2*sech(x).^3; % analytical 2nd-derivative of the function
ut=fft(u); % FFT the function utd=(i*k).*ut; % Derivative of the FFT ut2d=(i*k).^2.*ut; % Derivative of the FFT for 2nd-derivative uds=ifft( utd ); % approximation (inverse-FT) of the 1st-derivative u2ds=ifft( ut2d ); % approximation (inverse-FT) of the 1st-derivative figure(1),plot(x,ud,'r', x,uds,'mo') % plot figure(2),plot(x,u2d,'r', x,u2ds,'mo') % plot