{ "metadata": { "name": "", "signature": "sha256:ee895ddb4389e18e99edc47a07cd34a4e87ed2ade70e5baaf548faeb83c3e584" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "#X-[FFT](http://www.ams.org/journals/mcom/1965-19-090/S0025-5718-1965-0178586-1/) - Fast Fourier Transform" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.display import HTML" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 8 }, { "cell_type": "code", "collapsed": false, "input": [ "HTML('http://www.ams.org/journals/mcom/1965-19-090/S0025-5718-1965-0178586-1/')" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", "\n", "\n", "\t\n", "\n", "\n", "\r\n", "\r\n", "\r\n", "\r\n", "\r\n", "\r\n", "\n", "\r\n", "\r\n", "Mathematics of Computation\r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", "\r\n", "\r\n", "\r\n", "\r\n", " \r\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\r\n", "\r\n", "\r\n", "\r\n", "\n", "\n", "\n", "\n", "\n", "
\n", "Publications \n", "Meetings \n", "The Profession \n", "Membership \n", "Programs \n", "Math Samplings \n", "Policy & Advocacy \n", "In the News \n", "About the AMS\n", "\n", "
\n", "\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", "
\n", "\n", "\r\n", "\r\n", "
\r\n", "\r\n", "
   
\r\n", "
\r\n", "\r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", " \r\n", "\r\n", "
\"Mobile
\r\n", " \"Green\r\n", "
\r\n", " \"Mathematics\r\n", "
\r\n", "\r\n", "\r\n", "\r\n", "\r\n", "\"Mathematics
\r\n", " ISSN 1088-6842(online) ISSN 0025-5718(print) \r\n", "
\r\n", "\n", " \n", "\n", "\r\n", "
\r\n", "
\r\n", "
\r\n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "
\n", " \n", "
\n", "\n", "\n", "
\n", "\n", "\n", "\n", " \n", " \n", "
\n", " \n", " \n", "
\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", "
\n", "
\n", "
\n", "\n", "

 

\n", "

An algorithm for the machine calculation of complex Fourier series

\n", "\n", "

\n", "\n", "\n", "
\n", "Authors:\n", "James W. Cooley and John W. Tukey\n", "\n", "\n", "
\n", "Journal:\n", "Math. Comp. 19 (1965), 297-301\n", "\n", "
\n", "MSC:\n", "Primary 65.90\n", "\n", "
\n", "MathSciNet review:\n", "0178586\n", "
\n", "Full-text PDF Free Access\n", "

References |\n", "Similar Articles |\n", "Additional Information\n", "\n", "

\n", "

\n", "
\n", "

\n", " References\n", " [Enhancements\n", " On\n", " Off]\n", " (What's this?)\n", "

\n", "
\n", "\n", "
\n", "
    \n", "
  • [1]\n", "G. E. P. Box, L. R. Connor, W. R. Cousins, O. L. Davies (Ed.), F. R. Hirnsworth & G. P. Silitto, The Design and Analysis of Industrial Experiments, Oliver & Boyd, Edinburgh, 1954.\n", "
  • \n", "\n", "\n", "
  • [2]\n", "I. J. Good, \"The interaction algorithm and practical Fourier series,\" J. Roy. Statist. Soc. Ser. B., v. 20, 1958, p. 361-372; Addendum, v. 22, 1960, p. 372-375. MR 21 #1674; MR 23 #A4231.\n", "
  • \n", "\n", "\n", "
\n", "
\n", "\n", "
\n", "

Bibliography

\n", "
[1]
G. E. P. Box, L. R. Connor, W. R. Cousins, O. L. Davies (Ed.), F. R. Hirnsworth & G. P. Silitto, The Design and Analysis of Industrial Experiments, Oliver & Boyd, Edinburgh, 1954.\n", "
[2]
I. J. Good, \"The interaction algorithm and practical Fourier series,\" J. Roy. Statist. Soc. Ser. B., v. 20, 1958, p. 361-372; Addendum, v. 22, 1960, p. 372-375. MR 21 #1674; MR 23 #A4231.\n", "
\n", "

\n", "

\n", " Similar Articles\n", "

\n", "\n", "

\n", " Retrieve articles in Mathematics of Computation\n", " with MSC:\n", " 65.90\n", "\n", "

Retrieve articles in all journals\n", " with MSC:\n", " 65.90\n", "

\n", "
\n", "

\n", "\n", "Additional Information\n", "\n", "\n", "\n", "
\n", "\n", "\n", "
\n", "DOI:\n", "http://dx.doi.org/10.1090/S0025-5718-1965-0178586-1\n", "\n", "
\n", "PII:\n", "S 0025-5718(1965)0178586-1\n", "\n", "
\n", "Article copyright:\n", "© Copyright 1965\n", "American Mathematical Society\n", "

\n", "
\n", " \n", " \n", " \n", " \n", "
\n", " \n", "
\n", "
\r\n", " \r\n", " \r\n", " \r\n", " \r\n", "

\r\n", "\r\n", "\n", "\n", "\n", "\n", "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "

Comments: Email Webmaster

\n", " © Copyright \n", " , American Mathematical Society \n", "
\n", "\t Contact Us ·\n", "\t Sitemap · \n", "\t Privacy Statement\n", " \n", "

\n", "
\n", " \n", "
\n", "\n", "\n", "\n", "\n", "\n", "
\n", "
\"Connect \"Facebook\" \"Twitter\" \"Google+\" \"LinkedIn\" \"Instagram\" \"RSS \"Blogs\" \"YouTube\" \"Podcasts\" \"Wikipedia\"
\n", "\n", "
\n", "
\n", "\n", "\n", "\n", "\r\n", "\r\n", "\n" ], "metadata": {}, "output_type": "pyout", "prompt_number": 9, "text": [ "" ] } ], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are several FFT implementations in python. We will use the NumPy and SciPy ones. The fastest is [PyFFTW](https://pypi.python.org/pypi/pyFFTW)." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import scipy as scp\n", "%pylab" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Using matplotlib backend: Qt4Agg\n", "Populating the interactive namespace from numpy and matplotlib\n" ] } ], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "help(np.fft)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Help on package numpy.fft in numpy:\n", "\n", "NAME\n", " numpy.fft\n", "\n", "FILE\n", " /home/jpsilva/anaconda/lib/python2.7/site-packages/numpy/fft/__init__.py\n", "\n", "DESCRIPTION\n", " Discrete Fourier Transform (:mod:`numpy.fft`)\n", " =============================================\n", " \n", " .. currentmodule:: numpy.fft\n", " \n", " Standard FFTs\n", " -------------\n", " \n", " .. autosummary::\n", " :toctree: generated/\n", " \n", " fft Discrete Fourier transform.\n", " ifft Inverse discrete Fourier transform.\n", " fft2 Discrete Fourier transform in two dimensions.\n", " ifft2 Inverse discrete Fourier transform in two dimensions.\n", " fftn Discrete Fourier transform in N-dimensions.\n", " ifftn Inverse discrete Fourier transform in N dimensions.\n", " \n", " Real FFTs\n", " ---------\n", " \n", " .. autosummary::\n", " :toctree: generated/\n", " \n", " rfft Real discrete Fourier transform.\n", " irfft Inverse real discrete Fourier transform.\n", " rfft2 Real discrete Fourier transform in two dimensions.\n", " irfft2 Inverse real discrete Fourier transform in two dimensions.\n", " rfftn Real discrete Fourier transform in N dimensions.\n", " irfftn Inverse real discrete Fourier transform in N dimensions.\n", " \n", " Hermitian FFTs\n", " --------------\n", " \n", " .. autosummary::\n", " :toctree: generated/\n", " \n", " hfft Hermitian discrete Fourier transform.\n", " ihfft Inverse Hermitian discrete Fourier transform.\n", " \n", " Helper routines\n", " ---------------\n", " \n", " .. autosummary::\n", " :toctree: generated/\n", " \n", " fftfreq Discrete Fourier Transform sample frequencies.\n", " rfftfreq DFT sample frequencies (for usage with rfft, irfft).\n", " fftshift Shift zero-frequency component to center of spectrum.\n", " ifftshift Inverse of fftshift.\n", " \n", " \n", " Background information\n", " ----------------------\n", " \n", " Fourier analysis is fundamentally a method for expressing a function as a\n", " sum of periodic components, and for recovering the function from those\n", " components. When both the function and its Fourier transform are\n", " replaced with discretized counterparts, it is called the discrete Fourier\n", " transform (DFT). The DFT has become a mainstay of numerical computing in\n", " part because of a very fast algorithm for computing it, called the Fast\n", " Fourier Transform (FFT), which was known to Gauss (1805) and was brought\n", " to light in its current form by Cooley and Tukey [CT]_. Press et al. [NR]_\n", " provide an accessible introduction to Fourier analysis and its\n", " applications.\n", " \n", " Because the discrete Fourier transform separates its input into\n", " components that contribute at discrete frequencies, it has a great number\n", " of applications in digital signal processing, e.g., for filtering, and in\n", " this context the discretized input to the transform is customarily\n", " referred to as a *signal*, which exists in the *time domain*. The output\n", " is called a *spectrum* or *transform* and exists in the *frequency\n", " domain*.\n", " \n", " Implementation details\n", " ----------------------\n", " \n", " There are many ways to define the DFT, varying in the sign of the\n", " exponent, normalization, etc. In this implementation, the DFT is defined\n", " as\n", " \n", " .. math::\n", " A_k = \\sum_{m=0}^{n-1} a_m \\exp\\left\\{-2\\pi i{mk \\over n}\\right\\}\n", " \\qquad k = 0,\\ldots,n-1.\n", " \n", " The DFT is in general defined for complex inputs and outputs, and a\n", " single-frequency component at linear frequency :math:`f` is\n", " represented by a complex exponential\n", " :math:`a_m = \\exp\\{2\\pi i\\,f m\\Delta t\\}`, where :math:`\\Delta t`\n", " is the sampling interval.\n", " \n", " The values in the result follow so-called \"standard\" order: If ``A =\n", " fft(a, n)``, then ``A[0]`` contains the zero-frequency term (the mean of\n", " the signal), which is always purely real for real inputs. Then ``A[1:n/2]``\n", " contains the positive-frequency terms, and ``A[n/2+1:]`` contains the\n", " negative-frequency terms, in order of decreasingly negative frequency.\n", " For an even number of input points, ``A[n/2]`` represents both positive and\n", " negative Nyquist frequency, and is also purely real for real input. For\n", " an odd number of input points, ``A[(n-1)/2]`` contains the largest positive\n", " frequency, while ``A[(n+1)/2]`` contains the largest negative frequency.\n", " The routine ``np.fft.fftfreq(n)`` returns an array giving the frequencies\n", " of corresponding elements in the output. The routine\n", " ``np.fft.fftshift(A)`` shifts transforms and their frequencies to put the\n", " zero-frequency components in the middle, and ``np.fft.ifftshift(A)`` undoes\n", " that shift.\n", " \n", " When the input `a` is a time-domain signal and ``A = fft(a)``, ``np.abs(A)``\n", " is its amplitude spectrum and ``np.abs(A)**2`` is its power spectrum.\n", " The phase spectrum is obtained by ``np.angle(A)``.\n", " \n", " The inverse DFT is defined as\n", " \n", " .. math::\n", " a_m = \\frac{1}{n}\\sum_{k=0}^{n-1}A_k\\exp\\left\\{2\\pi i{mk\\over n}\\right\\}\n", " \\qquad m = 0,\\ldots,n-1.\n", " \n", " It differs from the forward transform by the sign of the exponential\n", " argument and the normalization by :math:`1/n`.\n", " \n", " Real and Hermitian transforms\n", " -----------------------------\n", " \n", " When the input is purely real, its transform is Hermitian, i.e., the\n", " component at frequency :math:`f_k` is the complex conjugate of the\n", " component at frequency :math:`-f_k`, which means that for real\n", " inputs there is no information in the negative frequency components that\n", " is not already available from the positive frequency components.\n", " The family of `rfft` functions is\n", " designed to operate on real inputs, and exploits this symmetry by\n", " computing only the positive frequency components, up to and including the\n", " Nyquist frequency. Thus, ``n`` input points produce ``n/2+1`` complex\n", " output points. The inverses of this family assumes the same symmetry of\n", " its input, and for an output of ``n`` points uses ``n/2+1`` input points.\n", " \n", " Correspondingly, when the spectrum is purely real, the signal is\n", " Hermitian. The `hfft` family of functions exploits this symmetry by\n", " using ``n/2+1`` complex points in the input (time) domain for ``n`` real\n", " points in the frequency domain.\n", " \n", " In higher dimensions, FFTs are used, e.g., for image analysis and\n", " filtering. The computational efficiency of the FFT means that it can\n", " also be a faster way to compute large convolutions, using the property\n", " that a convolution in the time domain is equivalent to a point-by-point\n", " multiplication in the frequency domain.\n", " \n", " Higher dimensions\n", " -----------------\n", " \n", " In two dimensions, the DFT is defined as\n", " \n", " .. math::\n", " A_{kl} = \\sum_{m=0}^{M-1} \\sum_{n=0}^{N-1}\n", " a_{mn}\\exp\\left\\{-2\\pi i \\left({mk\\over M}+{nl\\over N}\\right)\\right\\}\n", " \\qquad k = 0, \\ldots, M-1;\\quad l = 0, \\ldots, N-1,\n", " \n", " which extends in the obvious way to higher dimensions, and the inverses\n", " in higher dimensions also extend in the same way.\n", " \n", " References\n", " ----------\n", " \n", " .. [CT] Cooley, James W., and John W. Tukey, 1965, \"An algorithm for the\n", " machine calculation of complex Fourier series,\" *Math. Comput.*\n", " 19: 297-301.\n", " \n", " .. [NR] Press, W., Teukolsky, S., Vetterline, W.T., and Flannery, B.P.,\n", " 2007, *Numerical Recipes: The Art of Scientific Computing*, ch.\n", " 12-13. Cambridge Univ. Press, Cambridge, UK.\n", " \n", " Examples\n", " --------\n", " \n", " For examples, see the various functions.\n", "\n", "PACKAGE CONTENTS\n", " fftpack\n", " fftpack_lite\n", " helper\n", " info\n", " setup\n", "\n", "DATA\n", " absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0...\n", " division = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192...\n", " print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0)...\n", " using_mklfft = True\n", "\n", "\n" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "#help(scp.fft)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's obtain the FFT of $$e^{\\frac{i2\\pi k}{8}}$$ for $k=1,...,8$" ] }, { "cell_type": "code", "collapsed": false, "input": [ "np.fft.fft(np.exp(2j * np.pi * np.arange(8) / 8))" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 15, "text": [ "array([ -3.44505240e-16 +1.14383329e-17j,\n", " 8.00000000e+00 -8.52057261e-16j,\n", " 2.33482938e-16 +1.22460635e-16j,\n", " 0.00000000e+00 +1.22460635e-16j,\n", " 9.95839695e-17 +2.33482938e-16j,\n", " -8.88178420e-16 +1.17293449e-16j,\n", " 1.14383329e-17 +1.22460635e-16j, 0.00000000e+00 +1.22460635e-16j])" ] } ], "prompt_number": 15 }, { "cell_type": "code", "collapsed": false, "input": [ "x = np.exp(2j * np.pi * np.arange(9) / 8)\n", "xt = np.fft.fft(x)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 16 }, { "cell_type": "code", "collapsed": false, "input": [ "plot(xt)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 17, "text": [ "[]" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 5, "metadata": {}, "source": [ "Calculate derivatives" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def sech(x):\n", " return 1.0/cosh(x)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": [ "L = 20\n", "n = 128\n", "x = linspace(-L/2,L/2,n+1)[:n]\n", "k = 2*pi/L*linspace(-n/2-1,n/2,n)\n", "k = flipud(k.reshape((2,-1))).flatten()\n", "\n", "u = sech(x)\n", "ud = -sech(x)*tanh(x)\n", "u2d = sech(x)-2*sech(x)**3\n", "\n", "ut = fft.fft(u)\n", "\n", "uds = fft.ifft((1j*k)*ut)\n", "u2ds = fft.ifft(((1j*k)**2)*ut)\n", "\n", "subplot(211)\n", "plot(x,ud,'r',x,uds,'bo')\n", "subplot(212)\n", "plot(x,u2d,'r',x,u2ds,'bo')" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stderr", "text": [ "/home/jpsilva/anaconda/lib/python2.7/site-packages/numpy/core/numeric.py:462: ComplexWarning: Casting complex values to real discards the imaginary part\n", " return array(a, dtype, copy=False, order=order)\n" ] }, { "metadata": {}, "output_type": "pyout", "prompt_number": 5, "text": [ "[,\n", " ]" ] } ], "prompt_number": 5 }, { "cell_type": "heading", "level": 5, "metadata": {}, "source": [ "Add noise" ] }, { "cell_type": "code", "collapsed": false, "input": [ "T = 30\n", "n = 512\n", "\n", "t = linspace(-T/2,T/2,n+1)[:n]\n", "\n", "k = 2*pi/T*linspace(-n/2-1,n/2,n)\n", "k = flipud(k.reshape((2,-1))).flatten()\n", "ks = fft.fftshift(k)\n", "\n", "u = sech(t)\n", "ut = fft.fft(u)\n", "noise = 20\n", "utn = ut + noise*(randn(1,n)+1j*randn(1,n))\n", "un = fft.ifft(utn)\n", "\n", "subplot(2,1,1)\n", "plot(t,u,'k',t,un.flatten(),'m')\n", "subplot(2,1,2)\n", "plot(ks,abs(fft.fftshift(ut)).flatten()/max(abs(ut).flatten()),'k',ks,abs(fft.fftshift(utn)).flatten()/max(abs(utn).flatten()),'m')\n", "axis([-25,25,0,1])" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "[-25, 25, 0, 1]" ] } ], "prompt_number": 7 }, { "cell_type": "heading", "level": 5, "metadata": {}, "source": [ "Filtering" ] }, { "cell_type": "code", "collapsed": false, "input": [ "filt = exp(-(k)**2)\n", "utnf = filt*utn\n", "unf = fft.ifft(utnf)\n", "\n", "subplot(211)\n", "plot(t,un.flatten(),'r', alpha=0.5)\n", "plot(t,unf.flatten(),'g')\n", "plot(t,0*t+0.5,'k--')\n", "\n", "subplot(212)\n", "plot(ks,abs(fft.fftshift(utn)).flatten()/max(abs(utn).flatten()),'b', alpha =0.5)\n", "plot(ks,fft.fftshift(filt),'r',alpha=0.5)\n", "plot(ks,abs(fft.fftshift(utnf)).flatten()/max(abs(utnf).flatten()),'g')\n", "axis([-25,25,0,1])" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 11, "text": [ "[-25, 25, 0, 1]" ] } ], "prompt_number": 11 }, { "cell_type": "heading", "level": 5, "metadata": {}, "source": [ "Resample N times" ] }, { "cell_type": "code", "collapsed": false, "input": [ "T = 30\n", "n = 512\n", "\n", "t = linspace(-T/2,T/2,n+1)[:n]\n", "\n", "k = 2*pi/T*linspace(-n/2-1,n/2,n)\n", "k = flipud(k.reshape((2,-1))).flatten()\n", "ks = fft.fftshift(k)\n", "\n", "u = sech(t)\n", "ut = fft.fft(u)\n", "\n", "noise = 20\n", "ave = zeros((1,n));\n", "nresamples = 30\n", "for i in range(nresamples):\n", " utn = ut + noise*(randn(1,n)+1j*randn(1,n))\n", " ave += utn\n", "\n", "ave = abs(fft.fftshift(ave)).flatten()/nresamples\n", "\n", "plot(ks,abs(fft.fftshift(ut)),'r')\n", "plot(ks,ave,'k')\n", "plot(ks,abs(fft.fftshift(utn)).flatten(),'c',alpha=0.5)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 18, "text": [ "[]" ] } ], "prompt_number": 18 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Optional" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- Install [FFTW](http://www.fftw.org/download.html)\n", " sudo apt-get install fftw3 libfftw3-dev\n", "\n", "- Install [PyFFTW](https://pypi.python.org/pypi/pyFFTW)\n", " pip install PyFFTW" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import pyfftw" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "code", "collapsed": false, "input": [ "%load_ext version_information\n", "%version_information numpy,scipy,pyfftw" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "The version_information extension is already loaded. To reload it, use:\n", " %reload_ext version_information\n" ] }, { "html": [ "
SoftwareVersion
Python2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
IPython2.3.1
OSposix [linux2]
numpy1.9.1
scipy0.14.0
pyfftw0.9.2
Fri Dec 05 14:20:07 2014 CET
" ], "json": [ "{ \"Software versions\" : [{ \"module\" : \"Python\", \"version\" : \"2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]\" }, { \"module\" : \"IPython\", \"version\" : \"2.3.1\" }, { \"module\" : \"OS\", \"version\" : \"posix [linux2]\" }, { \"module\" : \"numpy\", \"version\" : \"1.9.1\" }, { \"module\" : \"scipy\", \"version\" : \"0.14.0\" }, { \"module\" : \"pyfftw\", \"version\" : \"0.9.2\" } ] }" ], "latex": [ "\\begin{tabular}{|l|l|}\\hline\n", "{\\bf Software} & {\\bf Version} \\\\ \\hline\\hline\n", "Python & 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] \\\\ \\hline\n", "IPython & 2.3.1 \\\\ \\hline\n", "OS & posix [linux2] \\\\ \\hline\n", "numpy & 1.9.1 \\\\ \\hline\n", "scipy & 0.14.0 \\\\ \\hline\n", "pyfftw & 0.9.2 \\\\ \\hline\n", "\\hline \\multicolumn{2}{|l|}{Fri Dec 05 14:20:07 2014 CET} \\\\ \\hline\n", "\\end{tabular}\n" ], "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "Software versions\n", "Python 2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Aug 21 2014, 18:22:21) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]\n", "IPython 2.3.1\n", "OS posix [linux2]\n", "numpy 1.9.1\n", "scipy 0.14.0\n", "pyfftw 0.9.2\n", "\n", "Fri Dec 05 14:20:07 2014 CET" ] } ], "prompt_number": 7 }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.core.display import HTML\n", "def css_styling():\n", " styles = open(\"./styles/custom.css\", \"r\").read()\n", " return HTML(styles)\n", "css_styling()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "\n", "\n", "\n", "\n", "\n" ], "metadata": {}, "output_type": "pyout", "prompt_number": 2, "text": [ "" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }