Skip to content

A C++ Implementation of the Fast Fourier Transform. Written using the radix 2 Cooley and Tukey Aglorithm

Notifications You must be signed in to change notification settings

ebudae/Fast-Fourier-Transform

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fast-Fourier-Transform

A C++ Implementation of the Fast Fourier Transform. Written using the radix 2 Cooley and Tukey Aglorithm. Also includes graphing in python.

File overview

  • fft.cpp : the main and only C++ file needed for the fast fourier transform
  • data.txt : contains the output of the last fft run
  • plot.py : python code to plot the contents of data.txt

Dependencies:

  • plot.py requires the 'matplotlib' for graphing easy to obtain by pip: python -m pip matplotlib or py -m pip matplotlib
  • (if using windows) must have the visual studio c++ tools

Compilation:

linux/mac:

simply run: 
g++ fft.cpp -o fft

windows:

1. type 'C++' into desktop search bar e.g cortana for windows 10
2. select 'Visual C++ [YEAR] [32/64 bit] Command prompt'
(if this doesn't work try 'Developer command prompt for VS [YEAR]')
3. navigate to the source code folder
4. run:
cl fft.cpp
5. you should now have an fft.exe in the folder

How to run:

linux: ./fft

windows: fft.exe

How to graph:

python plot.py data.txt

TWEAKING: The 'samples' variable in Main can be changed for a higher upper bound sampling frequency; it must be size 2^n. The signal itself can also be changed on line 165.

About

A C++ Implementation of the Fast Fourier Transform. Written using the radix 2 Cooley and Tukey Aglorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.9%
  • Python 24.1%