.. _book_fig_chapter10_fig_fft_example: Fast Fourier Transform Example ------------------------------ Figure 10.5 The discrete Fourier transform (bottom panel) for two noisy data sets shown in the top panel. For 512 evenly sampled times t (dt = 0.977), points are drawn from h(t) = a + sin(t)G(t), where G(t) is a Gaussian N(mu = 0,sigma = 10). Gaussian noise with sigma = 0.05 (top data set) and 0.005 (bottom data set) is added to signal h(t). The value of the offset a is 0.15 and 0, respectively. The discrete Fourier transform is computed as described in Section 10.2.3. For both noise realizations, the correct frequency f = (2pi)-1 ~ 0.159 is easily discernible in the bottom panel. Note that the height of peaks is the same for both noise realizations. The large value of abs(H(f = 0)) for data with larger noise is due to the vertical offset. .. image:: ../images/chapter10/fig_fft_example_1.png :scale: 100 :align: center .. raw:: html
**Code output:** .. raw:: html
.. literalinclude:: fig_fft_example.txt .. raw:: html
**Python source code:** .. raw:: html
.. literalinclude:: fig_fft_example.py :lines: 17- .. raw:: html
:download:`[download source: fig_fft_example.py] ` .. raw:: html