alcomplex.h 931 B

12345678910111213141516171819202122232425
  1. #ifndef ALCOMPLEX_H
  2. #define ALCOMPLEX_H
  3. #include <complex>
  4. #include "alspan.h"
  5. /**
  6. * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
  7. * FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier
  8. * Transform (DFT) of the time domain data stored in the buffer. The buffer is
  9. * an array of complex numbers, and MUST BE power of two.
  10. */
  11. void complex_fft(const al::span<std::complex<double>> buffer, const double sign);
  12. /**
  13. * Calculate the complex helical sequence (discrete-time analytical signal) of
  14. * the given input using the discrete Hilbert transform (In-place algorithm).
  15. * Fills the buffer with the discrete-time analytical signal stored in the
  16. * buffer. The buffer is an array of complex numbers and MUST BE power of two,
  17. * and the imaginary components should be cleared to 0.
  18. */
  19. void complex_hilbert(const al::span<std::complex<double>> buffer);
  20. #endif /* ALCOMPLEX_H */