source: tests/src/spectral/test-fft.c @ 5f9df77

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since 5f9df77 was 5f9df77, checked in by Paul Brossier <piem@piem.org>, 9 years ago

tests/: move tests around

  • Property mode set to 100644
File size: 1.1 KB
Line 
1
2#include <aubio.h>
3
4int main(){
5        /* allocate some memory */
6        uint_t win_s      = 8;                       /* window size        */
7        fvec_t * in       = new_fvec (win_s); /* input buffer       */
8        cvec_t * fftgrain = new_cvec (win_s); /* fft norm and phase */
9        fvec_t * out      = new_fvec (win_s); /* output buffer      */
10        in->data[0] = 1;
11        in->data[1] = 2;
12        in->data[2] = 3;
13        in->data[3] = 4;
14        in->data[4] = 5;
15        in->data[5] = 6;
16        in->data[6] = 5;
17        in->data[7] = 6;
18        /* allocate fft and other memory space */
19        aubio_fft_t * fft = new_aubio_fft(win_s);
20        /* fill input with some data */
21        fvec_print(in);
22        /* execute stft */
23        aubio_fft_do (fft,in,fftgrain);
24        cvec_print(fftgrain);
25        /* execute inverse fourier transform */
26        aubio_fft_rdo(fft,fftgrain,out);
27        fvec_print(out);
28        del_aubio_fft(fft);
29        del_fvec(in);
30        del_cvec(fftgrain);
31        del_fvec(out);
32        aubio_cleanup();
33        return 0;
34}
Note: See TracBrowser for help on using the repository browser.