-
Notifications
You must be signed in to change notification settings - Fork 0
/
fft.cpp
executable file
·25 lines (19 loc) · 734 Bytes
/
fft.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<complex>
#include"headers/fft.h"
#include<iostream>
#include<vector>
#include<functional>
using namespace std;
int main(){
vector<complex<double> > vec(4);
vec[1]=0.5;
vec[2]=0.5;
vector<complex<double> >ft = FourierTransform<fft::forward,
fft::Estimate>(vec);
copy(ft.begin(), ft.end(), ostream_iterator<complex<double> >(cout, "\n") );
vector<complex<double> >backft = FourierTransform<fft::backward, fft::Estimate>(ft);
copy(backft.begin(), backft.end(), ostream_iterator<complex<double> >(cout, "\n") );
ft = FourierTransform<fft::forward,
fft::Estimate>(backft);
copy(ft.begin(), ft.end(), ostream_iterator<complex<double> >(cout, "\n") );
}