source: tests/src/spectral/test-tss.c @ 986131d

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5
Last change on this file since 986131d was 986131d, checked in by Eduard Müller <mueller.eduard@googlemail.com>, 7 years ago

Intel IPP support for aubio

See emuell/aubio/ intel_ipp2 for details please

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#include <aubio.h>
2
3int main (void)
4{
5  aubio_init();
6 
7  uint_t n = 10; // compute n times
8  uint_t win_s = 1024; // window size
9  uint_t hop_s = 256;  // hop size
10
11  // create some vectors
12  fvec_t * in       = new_fvec (hop_s); // input buffer
13  cvec_t * fftgrain = new_cvec (win_s); // fft norm and phase
14  cvec_t * cstead   = new_cvec (win_s); // fft norm and phase
15  cvec_t * ctrans   = new_cvec (win_s); // fft norm and phase
16  fvec_t * stead    = new_fvec (hop_s); // output buffer
17  fvec_t * trans    = new_fvec (hop_s); // output buffer
18
19  // create phase vocoder for analysis of input signal
20  aubio_pvoc_t * pv = new_aubio_pvoc (win_s,hop_s);
21  // create transient/steady-state separation object
22  aubio_tss_t *  tss = new_aubio_tss(win_s,hop_s);
23  // create phase vocoder objects for synthesis of output signals
24  aubio_pvoc_t * pvt = new_aubio_pvoc(win_s,hop_s);
25  aubio_pvoc_t * pvs = new_aubio_pvoc(win_s,hop_s);
26
27  /* execute stft */
28  while ( n-- ) {
29    // fftgrain = pv(in)
30    aubio_pvoc_do (pv, in, fftgrain);
31    // ctrans, cstead = tss (fftgrain)
32    aubio_tss_do (tss, fftgrain, ctrans, cstead);
33    // stead = pvt_inverse (cstead)
34    // trans = pvt_inverse (ctrans)
35    aubio_pvoc_rdo (pvt, cstead, stead);
36    aubio_pvoc_rdo (pvs, ctrans, trans);
37  }
38
39  del_aubio_pvoc(pv);
40  del_aubio_pvoc(pvt);
41  del_aubio_pvoc(pvs);
42  del_aubio_tss(tss);
43
44  del_fvec(in);
45  del_cvec(fftgrain);
46  del_cvec(cstead);
47  del_cvec(ctrans);
48  del_fvec(stead);
49  del_fvec(trans);
50
51  aubio_cleanup();
52
53  return 0;
54}
Note: See TracBrowser for help on using the repository browser.