feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change
on this file since 1094f52 was
de2a8af,
checked in by Paul Brossier <piem@piem.org>, 17 years ago
|
move python/tests to tests/python, examples/tests to tests/src, add .bzrignore
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[40536fa] | 1 | /* test sample for phase vocoder */ |
---|
[437fa65] | 2 | |
---|
[40536fa] | 3 | #include <aubio.h> |
---|
[437fa65] | 4 | |
---|
| 5 | int main(){ |
---|
| 6 | uint_t win_s = 1024; /* window size */ |
---|
| 7 | uint_t hop_s = 256; /* hop size */ |
---|
| 8 | uint_t channels = 4; /* number of channels */ |
---|
| 9 | /* allocate some memory */ |
---|
| 10 | fvec_t * in = new_fvec (hop_s, channels); /* input buffer */ |
---|
| 11 | cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */ |
---|
| 12 | fvec_t * out = new_fvec (hop_s, channels); /* output buffer */ |
---|
| 13 | /* allocate fft and other memory space */ |
---|
| 14 | aubio_pvoc_t * pv = new_aubio_pvoc(win_s,hop_s,channels); |
---|
| 15 | /* fill input with some data */ |
---|
| 16 | printf("initialised\n"); |
---|
| 17 | /* execute stft */ |
---|
| 18 | aubio_pvoc_do (pv,in,fftgrain); |
---|
| 19 | printf("computed forward\n"); |
---|
| 20 | /* execute inverse fourier transform */ |
---|
| 21 | aubio_pvoc_rdo(pv,fftgrain,out); |
---|
| 22 | printf("computed backard\n"); |
---|
| 23 | del_aubio_pvoc(pv); |
---|
| 24 | del_fvec(in); |
---|
| 25 | del_cvec(fftgrain); |
---|
| 26 | del_fvec(out); |
---|
[40536fa] | 27 | aubio_cleanup(); |
---|
[437fa65] | 28 | printf("memory freed\n"); |
---|
| 29 | return 0; |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.