Fast Fourier Transform In SciPy

Today’s goal is to obtain a fft() of the interpolated data (the 32000+ sample values of the signal).

Understand the difference between Fourier Transform, Fast Fourier Transform, and Fourier Series.

  • Fourier Transform (wikipedia): expresses a mathematical function of time as a function of frequency, known as the frequency specturn. Inverse Fourier Transform expresses a frequency function in the time domain. Each value of the function is usually expressed as a complex number (magnitude and phase components). “Fourier transform” refers to both the transform operation and to the complex-valued function it produces.
    • Can be simplified to the calculation of a discrete set of complex amplitudes, called Fourier series coefficients.
  • Discrete-Time Fourier Transform
  • Fourier Series (wikipedia): decomposes periodic functions or periodic signals into the sum of a (possibly infinite) set of simple oscillating functions, namely sines and cosines.

What I’m starting off with:

  • originally 60 samples
  • old sampling rate of 24 samples/1 sec
  • length of time for data = 60 frames/24fps = 2.5 seconds
  • interpolation gives 32768 samples = N
  • new sampling rate of 32768/2.5 = 13107.2 samples/second

It looks like the fft assumes that the input data is defined as one period. However, my input data represents 3 periods in length.

In looking around on the SciPy documentation, I saw a section on “Discrete Cosine Transforms” and “Discrete Sine Transforms”.

Discrete Cosine Transform (wikipedia):

A DCT is a Fourier-related transform similar to the discrete Fourier transform (DFT), but using only real numbers. DCTs are equivalent to DFTs of roughly twice the length, operating on real data with even symmetry. There are eight standard DCT variants. The most common is the type-II DCT. Its inverse, the type-III DCT, is known as “the inverse DCT”.




Good animated GIF on Fourier Series:

Pyopengl, fft python example:

This is what I’ve been searching for:

Link to a StackOverflow question regarding the above example:

Reference for python instructions, including matplotlib examples and a fft() example:

Tagged , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: