Changes in tests/src/spectral/test-tss.c [9d6001cb:6938a20]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tests/src/spectral/test-tss.c ¶
r9d6001cb r6938a20 1 /* test sample for phase vocoder2 *3 * this program should start correctly using JACK_START_SERVER=true and4 * reconstruct each audio input frame perfectly on the corresponding input with5 * a delay equal to the window size, hop_s.6 */7 8 #include <stdio.h>9 #define AUBIO_UNSTABLE 110 1 #include <aubio.h> 11 2 12 int main(){ 13 int i; 14 uint_t win_s = 1024; /* window size */ 15 uint_t hop_s = 256; /* hop size */ 3 int main () 4 { 5 uint_t n = 10; // compute n times 6 uint_t win_s = 1024; // window size 7 uint_t hop_s = 256; // hop size 16 8 17 /* allocate some memory */ 18 fvec_t * in = new_fvec (hop_s); /* input buffer */ 19 cvec_t * fftgrain = new_cvec (win_s); /* fft norm and phase */ 20 cvec_t * cstead = new_cvec (win_s); /* fft norm and phase */ 21 cvec_t * ctrans = new_cvec (win_s); /* fft norm and phase */ 22 fvec_t * stead = new_fvec (hop_s); /* output buffer */ 23 fvec_t * trans = new_fvec (hop_s); /* output buffer */ 24 /* allocate phase vocoders and transient steady-state separation */ 9 // create some vectors 10 fvec_t * in = new_fvec (hop_s); // input buffer 11 cvec_t * fftgrain = new_cvec (win_s); // fft norm and phase 12 cvec_t * cstead = new_cvec (win_s); // fft norm and phase 13 cvec_t * ctrans = new_cvec (win_s); // fft norm and phase 14 fvec_t * stead = new_fvec (hop_s); // output buffer 15 fvec_t * trans = new_fvec (hop_s); // output buffer 16 17 // create phase vocoder for analysis of input signal 25 18 aubio_pvoc_t * pv = new_aubio_pvoc (win_s,hop_s); 19 // create transient/steady-state separation object 20 aubio_tss_t * tss = new_aubio_tss(win_s,hop_s); 21 // create phase vocoder objects for synthesis of output signals 26 22 aubio_pvoc_t * pvt = new_aubio_pvoc(win_s,hop_s); 27 23 aubio_pvoc_t * pvs = new_aubio_pvoc(win_s,hop_s); 28 aubio_tss_t * tss = new_aubio_tss(win_s,hop_s);29 30 /* fill input with some data */31 printf("initialised\n");32 24 33 25 /* execute stft */ 34 for (i = 0; i < 10; i++) { 35 aubio_pvoc_do (pv,in,fftgrain); 36 aubio_tss_do (tss,fftgrain,ctrans,cstead); 37 aubio_pvoc_rdo(pvt,cstead,stead); 38 aubio_pvoc_rdo(pvs,ctrans,trans); 26 while ( n-- ) { 27 // fftgrain = pv(in) 28 aubio_pvoc_do (pv, in, fftgrain); 29 // ctrans, cstead = tss (fftgrain) 30 aubio_tss_do (tss, fftgrain, ctrans, cstead); 31 // stead = pvt_inverse (cstead) 32 // trans = pvt_inverse (ctrans) 33 aubio_pvoc_rdo (pvt, cstead, stead); 34 aubio_pvoc_rdo (pvs, ctrans, trans); 39 35 } 40 36 … … 50 46 del_fvec(stead); 51 47 del_fvec(trans); 48 52 49 aubio_cleanup(); 53 printf("memory freed\n"); 50 54 51 return 0; 55 52 }
Note: See TracChangeset
for help on using the changeset viewer.