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

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampler
Last change on this file since be6e8e6 was 44755a0, checked in by Paul Brossier <piem@piem.org>, 10 years ago

tests/src/spectral/test-fft.c: quieten and clarify

  • Property mode set to 100644
File size: 907 bytes
Line 
1#include <aubio.h>
2
3int main (void)
4{
5  uint_t i, n_iters = 100; // number of iterations
6  uint_t win_s = 500; // 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  // create fft object
11  aubio_fft_t * fft = new_aubio_fft(win_s);
12
13  // fill input with some data
14  in->data[0] = 1;
15  in->data[1] = 2;
16  in->data[2] = 3;
17  in->data[3] = 4;
18  in->data[4] = 5;
19  in->data[5] = 6;
20  in->data[6] = 5;
21  in->data[7] = 6;
22  //fvec_print(in);
23
24  for (i = 0; i < n_iters; i++) {
25    // execute stft
26    aubio_fft_do (fft,in,fftgrain);
27    cvec_print(fftgrain);
28
29    // execute inverse fourier transform
30    aubio_fft_rdo(fft,fftgrain,out);
31  }
32
33  // cleam up
34  //fvec_print(out);
35  del_aubio_fft(fft);
36  del_fvec(in);
37  del_cvec(fftgrain);
38  del_fvec(out);
39  aubio_cleanup();
40  return 0;
41}
Note: See TracBrowser for help on using the repository browser.