feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 535d127 was
6938a20,
checked in by Paul Brossier <piem@piem.org>, 12 years ago
|
tests/src/spectral/: improve examples
|
-
Property mode set to
100644
|
File size:
798 bytes
|
Rev | Line | |
---|
[8701ec3] | 1 | #include <aubio.h> |
---|
[26499e4] | 2 | |
---|
[6938a20] | 3 | int main () |
---|
| 4 | { |
---|
| 5 | uint_t win_s = 8; // window size |
---|
| 6 | fvec_t * in = new_fvec (win_s); // input buffer |
---|
| 7 | cvec_t * fftgrain = new_cvec (win_s); // fft norm and phase |
---|
| 8 | fvec_t * out = new_fvec (win_s); // output buffer |
---|
| 9 | // create fft object |
---|
| 10 | aubio_fft_t * fft = new_aubio_fft(win_s); |
---|
| 11 | |
---|
| 12 | // fill input with some data |
---|
| 13 | in->data[0] = 1; |
---|
| 14 | in->data[1] = 2; |
---|
| 15 | in->data[2] = 3; |
---|
| 16 | in->data[3] = 4; |
---|
| 17 | in->data[4] = 5; |
---|
| 18 | in->data[5] = 6; |
---|
| 19 | in->data[6] = 5; |
---|
| 20 | in->data[7] = 6; |
---|
| 21 | fvec_print(in); |
---|
| 22 | |
---|
| 23 | // execute stft |
---|
| 24 | aubio_fft_do (fft,in,fftgrain); |
---|
| 25 | cvec_print(fftgrain); |
---|
| 26 | |
---|
| 27 | // execute inverse fourier transform |
---|
| 28 | aubio_fft_rdo(fft,fftgrain,out); |
---|
| 29 | |
---|
| 30 | // cleam up |
---|
| 31 | fvec_print(out); |
---|
| 32 | del_aubio_fft(fft); |
---|
| 33 | del_fvec(in); |
---|
| 34 | del_cvec(fftgrain); |
---|
| 35 | del_fvec(out); |
---|
| 36 | aubio_cleanup(); |
---|
| 37 | return 0; |
---|
[437fa65] | 38 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.