Skip to content

Instantly share code, notes, and snippets.

Avatar

Łukasz Wieczorek wieczorek1990

View GitHub Profile
@wieczorek1990
wieczorek1990 / simple-dft.cpp
Created Oct 6, 2014
Simple Discrete Fourier Transform
View simple-dft.cpp
// Based on: http://nayuki.eigenstate.org/page/how-to-implement-the-discrete-fourier-transform
#include <iostream>
#include <vector>
#include <complex>
#include <cmath>
#include <cstdlib>
using namespace std;
vector<complex<double> > compute_dft(vector<complex<double> > in) {
int n = in.size();