Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __DFT_H__
- #define __DFT_H__
- #define _USE_MATH_DEFINES
- #include <complex>
- #include <iostream>
- #include <vector>
- using namespace std;
- typedef complex<double> comp;
- typedef vector<complex<double>> veCo;
- // Gets the complex conjugate of every element
- void conjugate(comp *array, int size);
- // Multiplies two vectors element by element
- void multiply(comp *arr1, comp *arr2, comp *result, int size);
- // Finds the convolution of two vectors
- void convolution(comp *arr1, comp *arr2, comp *result, int size);
- // Discrete fourier transform. size must be a power of 2
- veCo fft(comp *arr, int N);
- // Inverse fourier transform. size must be a power of 2
- veCo ifft(comp *arr, int N);
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement