Giter Club home page Giter Club logo

fft-implement's Introduction

In-place Cooley-Tukey FFT implementation

This is a toy FFT implementation. Numpy has a fantastic production quality implementation

Note: Source code is here, sorry about all the boiler plate, I used some project generator and shouldn't have!

Note2: I used memoization to decrease the speed FFT. Big thanks to the original repo

Fourier transforms are really cool and I want to learn the maths and concepts behind it all. This continues from fourier-exp-01, a small C program that performs a temporal to frequency domain transform. This is a port of the C program, Python seems to have a better selection of libraries for parsing wave files, drawing graphs and doing maths.

This project includes a Python implementation of the Discrete Fourier Transform (DFT) in the C project above, it also contains an implementation of the Cooley-Tukey Fast Fourier Transform (FFT). The key differences between this project and the earlier C project is that this one uses Python's built in support for complex numbers, it also uses the correct divisor in the argument for the complex exponent operation (which expands cis(x)).

Building

git clone github.com/spacekitcat/<repository-name>
cd <repository-name>
python setup.py develop
python src/fourier_exp_000/fft.py resources/440hz.wav

The graph below shows the frequency graph for an input wave file made up of a single 440hz sine wave.

A graph with the frequencies from 0hz to 20050hz plotted along the x-axis (the frequency domain) and the magnitude plotted along the y-axis (the amplitude or magnitude, i.e. the contribution this frequency makes to the signal). The graph spikes at 440hz, showing 440hz as the dominant frequency

The graph below shows the frequency graph for an input wave file made up of a 500hz and a 1200hz sine wave.

A graph with the frequencies from 0hz to 20050hz plotted along the x-axis (the frequency domain) and the magnitude plotted along the y-axis (the amplitude or magnitude, i.e. the contribution this frequency makes to the signal). The graph spikes at 500hz and 1200hz, showing 500hz and 1200hz as the dominant frequencies

Learning Material

Fourier Series (Dover Books on Mathematics) - Georgi P. Tolstov

Wikipedia: Cooley–Tukey FFT algorithm

fft-implement's People

Contributors

mrzaizai2k avatar spacekitcat avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.