source: tests/src/test-fft.c @ 4621cd6

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 4621cd6 was 38e9732, checked in by Paul Brossier <piem@piem.org>, 15 years ago

tests/src/: various updates

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