source: examples/tests/test-phasevoc.c @ ba11e53

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since ba11e53 was 437fa65, checked in by Paul Brossier <piem@altern.org>, 19 years ago

added examples, bumped VERSION to 0.2.0beta1

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[437fa65]1/* test sample for phase vocoder
2 *
3 * this program should start correctly using JACK_START_SERVER=true and
4 * reconstruct each audio input frame perfectly on the corresponding input with
5 * a delay equal to the window size, hop_s.
6 */
7
8#include "aubio.h"
9
10int main(){
11        uint_t win_s    = 1024; /* window size                       */
12        uint_t hop_s    = 256;  /* hop size                          */
13        uint_t channels = 4;  /* number of channels                */
14        /* allocate some memory */
15        fvec_t * in       = new_fvec (hop_s, channels); /* input buffer       */
16        cvec_t * fftgrain = new_cvec (win_s, channels); /* fft norm and phase */
17        fvec_t * out      = new_fvec (hop_s, channels); /* output buffer      */
18        /* allocate fft and other memory space */
19        aubio_pvoc_t * pv = new_aubio_pvoc(win_s,hop_s,channels);
20        /* fill input with some data */
21        printf("initialised\n");
22        /* execute stft */
23        aubio_pvoc_do (pv,in,fftgrain);
24        printf("computed forward\n");
25        /* execute inverse fourier transform */
26        aubio_pvoc_rdo(pv,fftgrain,out);
27        printf("computed backard\n");
28        del_aubio_pvoc(pv);
29        del_fvec(in);
30        del_cvec(fftgrain);
31        del_fvec(out);
32        printf("memory freed\n");
33        return 0;
34}
Note: See TracBrowser for help on using the repository browser.