feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since bfd4414 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
|
Rev | Line | |
---|
[8701ec3] | 1 | #include <aubio.h> |
---|
[26499e4] | 2 | |
---|
[158e031] | 3 | int main (void) |
---|
[6938a20] | 4 | { |
---|
[44755a0] | 5 | uint_t i, n_iters = 100; // number of iterations |
---|
| 6 | uint_t win_s = 500; // window size |
---|
[6938a20] | 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; |
---|
[44755a0] | 22 | //fvec_print(in); |
---|
[6938a20] | 23 | |
---|
[44755a0] | 24 | for (i = 0; i < n_iters; i++) { |
---|
| 25 | // execute stft |
---|
| 26 | aubio_fft_do (fft,in,fftgrain); |
---|
| 27 | cvec_print(fftgrain); |
---|
[6938a20] | 28 | |
---|
[44755a0] | 29 | // execute inverse fourier transform |
---|
| 30 | aubio_fft_rdo(fft,fftgrain,out); |
---|
| 31 | } |
---|
[6938a20] | 32 | |
---|
| 33 | // cleam up |
---|
[44755a0] | 34 | //fvec_print(out); |
---|
[6938a20] | 35 | del_aubio_fft(fft); |
---|
| 36 | del_fvec(in); |
---|
| 37 | del_cvec(fftgrain); |
---|
| 38 | del_fvec(out); |
---|
| 39 | aubio_cleanup(); |
---|
| 40 | return 0; |
---|
[437fa65] | 41 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.