Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #ifndef __DFT_H__
  2. #define __DFT_H__
  3.  
  4. #define _USE_MATH_DEFINES
  5. #include <complex>
  6. #include <iostream>
  7. #include <vector>
  8. using namespace std;
  9.  
  10. typedef complex<double> comp;
  11. typedef vector<complex<double>> veCo;
  12.  
  13. // Gets the complex conjugate of every element
  14. void conjugate(comp *array, int size);
  15.  
  16. // Multiplies two vectors element by element
  17. void multiply(comp *arr1, comp *arr2, comp *result, int size);
  18.  
  19. // Finds the convolution of two vectors
  20. void convolution(comp *arr1, comp *arr2, comp *result, int size);
  21.  
  22. // Discrete fourier transform. size must be a power of 2
  23.  
  24. veCo fft(comp *arr, int N);
  25.  
  26. // Inverse fourier transform. size must be a power of 2
  27. veCo ifft(comp *arr, int N);
  28.  
  29. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement