22.05.2014 Views

Topic 2: The pendulum

Topic 2: The pendulum

Topic 2: The pendulum

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PHY321F — cp 2005 35<br />

<strong>The</strong> Fourier transform can be approximated by a discrete Fourier transform<br />

(DFT). <strong>The</strong> time or frequency axes are replaced by a finite set of N points<br />

on a grid and the integral performed using the trapezoidal rule:<br />

F (n∆ω) ≈<br />

=<br />

N−1<br />

∑<br />

m=0<br />

N−1<br />

∑<br />

m=0<br />

f(m∆t) e −in∆ωm∆t<br />

f(m∆t) e −i2πnm/N<br />

<strong>The</strong> inverse transform is then<br />

f(m∆t) = 1 N<br />

N−1<br />

∑<br />

n=0<br />

F (n∆ω) e i2πmn/N<br />

Aliasing occurs for frequencies higher than the Nyquist frequency ω ny =<br />

N∆ω/2 = (2π/∆t)/2<br />

E.4 <strong>The</strong> fast Fourier transform<br />

<strong>The</strong> importance of Fourier methods in computation derives from the existence<br />

of the fast Fourier transform (FFT) algorithm, which is, well, a fast<br />

way of computing the DFT. (What does fast mean? <strong>The</strong> DFT requires<br />

O(N 2 ) calculations to compute the transform of N values; the FFT requires<br />

O(N log N) — when N is of the order of 10 3 , a typical value, the FFT is<br />

about 1000 times faster than the DFT. . . )<br />

<strong>The</strong> FFT is a non-trivial algorithm and we won’t discuss it here — we’ll just<br />

make use of a packaged version.<br />

E.5 <strong>The</strong> fast Fourier transform in Python<br />

In Python we can use:<br />

from Numeric import *<br />

from FFT import * # In windows : from Fft

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!