Advertisement
Guest User

Untitled

a guest
Dec 4th, 2014
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. #ifndef FIXFFT_H
  2. #define FIXFFT_H
  3.  
  4. #include <Arduino.h>
  5.  
  6. /*
  7. fix_fft() - perform forward/inverse fast Fourier transform.
  8. fr[n],fi[n] are real and imaginary arrays, both INPUT AND
  9. RESULT (in-place FFT), with 0 <= n < 2**m; set inverse to
  10. 0 for forward transform (FFT), or 1 for iFFT.
  11. */
  12. int fix_fft(char fr[], char fi[], int m, int inverse);
  13.  
  14.  
  15.  
  16. /*
  17. fix_fftr() - forward/inverse FFT on array of real numbers.
  18. Real FFT/iFFT using half-size complex FFT by distributing
  19. even/odd samples into real/imaginary arrays respectively.
  20. In order to save data space (i.e. to avoid two arrays, one
  21. for real, one for imaginary samples), we proceed in the
  22. following two steps: a) samples are rearranged in the real
  23. array so that all even samples are in places 0-(N/2-1) and
  24. all imaginary samples in places (N/2)-(N-1), and b) fix_fft
  25. is called with fr and fi pointing to index 0 and index N/2
  26. respectively in the original array. The above guarantees
  27. that fix_fft "sees" consecutive real samples as alternating
  28. real and imaginary samples in the complex array.
  29. */
  30. int fix_fftr(char f[], int m, int inverse);
  31.  
  32.  
  33. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement