1 / 36

The Discrete Fourier Transform

The Discrete Fourier Transform. The Fourier Transform. “The Fourier transform is a mathematical operation with many applications in physics and engineering that expresses a mathematical function of time as a function of frequency, known as its frequency spectrum.”

ricky
Télécharger la présentation

The Discrete Fourier Transform

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Discrete Fourier Transform

  2. The Fourier Transform • “The Fourier transform is a mathematical operation with many applications in physics and engineering that expresses a mathematical function of time as a function of frequency, known as its frequency spectrum.” • from http://en.wikipedia.org/wiki/Fourier_transform

  3. The Fourier Transform • “For instance, the transform of a musical chord made up of pure notes (without overtones) expressed as amplitude as a function of time, is a mathematical representation of the amplitudes and phases of the individual notes that make it up.” • from http://en.wikipedia.org/wiki/Fourier_transform

  4. Amplitude & phase • f(x) =  sin( x +  ) +  •  is the amplitude •  is the frequency •  is the phase •  is the DC offset

  5. More generally • f(x) = 1 sin(  1 x +  1 ) + 2 sin(  2 x +  2 ) + 

  6. The Fourier Transform • “The function of time is often called the time domain representation, and the frequency spectrum the frequency domain representation.” • from http://en.wikipedia.org/wiki/Fourier_transform

  7. Applications • differential equations • geology • image and signal processing • optics • quantum mechanics • spectroscopy

  8. Review of complex numbers

  9. Complex numbers Complex numbers . . . • extend the 1D number line to the 2D plane • are numbers that can be put into the rectangular form, a+bi where i2 = -1, and a and b are real numbers.

  10. Complex numbers(rectangular form)

  11. Complex numbers Complex numbers . . . • a is the real part; b is the imaginary part • If a is 0, then a+bi is purely imaginary; if b is 0, then a+bi is a real number. • originally called “fictitious” by GirolamoCardano in the 16th century

  12. Complex arithmetic • add/subtract • add/subtract the real and imaginary parts separately

  13. Complex arithmetic • complex conjugate • often denoted as • negate only the imaginary part

  14. Complex arithmetic • inverse where z is a complex number z bar is the length or magnitude of z a is the real part b is the imaginary part

  15. Complex arithmetic • multiplication (FOIL)

  16. Complex arithmetic • division complex conjugate of denominator

  17. Complex numbers(polar form)

  18. exponential vs. trigonometric (phasor form) Leonhard Euler 1707-1783

  19. DFT(Discrete Fourier Transform)

  20. DFT • Say we have a sequence of N (possibly complex) numbers, x0 … xN-1. • The DFT produces a sequence of N (typically complex) numbers, X0 … XN-1, via the following:

  21. DFT & IDFT • The DFT (Discrete Fourier Transform) produces a sequence of N (typically complex) numbers, X0 … XN-1, via the following: • The IDFT (Inverse DFT) is defined as follows:

  22. Calculating the DFT So how can we actually calculate ?

  23. Calculating the DFT • So how can we calculate ? • Let’s use this relationship: • Then • So what does this mean?

  24. Interpretation of DFT Back to the polar form: • r/N is the amplitude and  is the phase of a sinusoid with frequency k/N into which xn is decomposed

  25. Calculating the DFT using excel

  26. Check w/ matlab/octave % see http://www.mathworks.com/help/matlab/ref/fft.html N = 256; % # of samples n = (0:N-1); % subscripts b1 = 0.5; % freq 1 b2 = 2.5; % freq 2 xn = 0.5 * sin( b1*n ) + 0.2 * sin( b2*n ); plot( xn ); Xn = fft( xn ); plot( abs(Xn(1:N/2)) ); X0real = xn .* cos( -2*pi*n*0/N ); X0imag = xn .* sin ( -2*pi*n*0/N ); X1real = xn .* cos( -2*pi*n*1/N ); X1imag = xn .* sin ( -2*pi*n*1/N ); X2real = xn .* cos( -2*pi*n*2/N ); X2imag = xn .* sin ( -2*pi*n*2/N ); X3real = xn .* cos( -2*pi*n*3/N ); X3imag = xn .* sin ( -2*pi*n*3/N ); . . . Note: .* is element-wise (rather than matrix) multiplication in matlab.

  27. Add random noise. % see http://www.mathworks.com/help/matlab/ref/fft.html N = 256; % # of samples n = (0:N-1); % subscripts b1 = 0.5; % freq 1 b2 = 2.5; % freq 2 r = randn( 1, N ); % noise xn = 0.5 * sin( b1*n ) + 0.2 * sin( b2*n ) + 0.5 * r; plot( xn ); Xn = fft( xn ); plot( abs(Xn(1:N/2)) ); X0real = xn .* cos( -2*pi*n*0/N ); X0imag = xn .* sin ( -2*pi*n*0/N ); X1real = xn .* cos( -2*pi*n*1/N ); X1imag = xn .* sin ( -2*pi*n*1/N ); X2real = xn .* cos( -2*pi*n*2/N ); X2imag = xn .* sin ( -2*pi*n*2/N ); X3real = xn .* cos( -2*pi*n*3/N ); X3imag = xn .* sin ( -2*pi*n*3/N ); . . .

  28. Signal without and with noise.

  29. Signal with noise. FFT of noisy signal (two major components are still apparent).

  30. Example of differences in phase. xn = 0.5 * sin( b1*n ) + 0.2 * sin( b2*n ) xn = 0.5 * sin( b1*n – 0.5 ) + 0.2 * sin( b2*n )

  31. Computational complexity:DFT vs. FFT • The DFT is O(N2) complex multiplications. • In 1965, Cooley (IBM) and Tukey (Princeton) described the FFT, a fast way (O(N log2 N)) to compute the FT using digital computers. • It was later discovered that Gauss described this algorithm in 1805, and others had “discovered” it as well before Cooley and Tukey. • “With N = 106, for example, it is the difference between, roughly, 30 seconds of CPU time and 2 weeks of CPU time on a microsecond cycle time computer.” – from Numerical Recipes in C

  32. Extending the DFT to 2D(and higher) • Let f(x,y) be a 2D set of sampled points. Then the DFT of f is the following: • (Note that engineers often use i for amps (current) so they use j for -1 instead.)

  33. Extending the DFT to 2D(and higher) • In fact, the 2D DFT is separable so it can be decomposed into a sequence of 1D DFTs. • And this can be generalized to higher and higher dimensions as well.

  34. The classical “Gibbs phenomenon” • Visit http://en.wikipedia.org/wiki/Square_wave. • Hear it at http://www.youtube.com/watch?v=uIuJTWS2uvY.

More Related