Пример #1
0
Файл: fvec.c Проект: aubio/aubio
void fvec_zeros(fvec_t *s) {
#if defined(HAVE_INTEL_IPP)
  aubio_ippsZero(s->data, (int)s->length);
#elif defined(HAVE_ACCELERATE)
  aubio_vDSP_vclr(s->data, 1, s->length);
#elif defined(HAVE_MEMCPY_HACKS)
  memset(s->data, 0, s->length * sizeof(smpl_t));
#else
  fvec_set_all(s, 0.);
#endif
}
Пример #2
0
void fvec_zeros(fvec_t *s) {
#if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE)
  fvec_set_all (s, 0.);
#else
#if defined(HAVE_MEMCPY_HACKS)
  memset(s->data, 0, s->length * sizeof(smpl_t));
#else
  aubio_vDSP_vclr(s->data, 1, s->length);
#endif
#endif
}
Пример #3
0
int main (void)
{
  uint_t n = 6; // compute n times
  uint_t win_s = 32; // window size
  uint_t hop_s = win_s / 4; // hop size

  fvec_t * in = new_fvec (hop_s); // input buffer
  cvec_t * fftgrain = new_cvec (win_s); // fft norm and phase
  fvec_t * out = new_fvec (hop_s); // output buffer

  // allocate fft and other memory space
  aubio_pvoc_t * pv = new_aubio_pvoc(win_s,hop_s);

  // fill input with some data
  fvec_set_all (in, 1.);
  fvec_print (in);

  while ( n-- ) {
    // get some fresh input data
    // ..

    // execute phase vocoder
    aubio_pvoc_do (pv,in,fftgrain);

    // do something with fftgrain
    // ...
    cvec_print (fftgrain);

    // optionally rebuild the signal
    aubio_pvoc_rdo(pv,fftgrain,out);

    // and do something with the result
    // ...
    fvec_print (out);
  }

  // clean up
  del_fvec(in);
  del_cvec(fftgrain);
  del_fvec(out);
  del_aubio_pvoc(pv);
  aubio_cleanup();

  return 0;
}
Пример #4
0
Файл: fvec.c Проект: aubio/aubio
void fvec_ones(fvec_t *s) {
  fvec_set_all (s, 1.);
}