src/pitch/pitchyinfft.c: use fvec_weighted_copy
authorPaul Brossier <piem@piem.org>
Sat, 5 Sep 2015 09:50:47 +0000 (11:50 +0200)
committerPaul Brossier <piem@piem.org>
Sat, 5 Sep 2015 09:50:47 +0000 (11:50 +0200)
src/pitch/pitchyinfft.c

index 940ae4f..9084547 100644 (file)
@@ -107,9 +107,7 @@ aubio_pitchyinfft_do (aubio_pitchyinfft_t * p, fvec_t * input, fvec_t * output)
   fvec_t *yin = p->yinfft;
   smpl_t tmp = 0., sum = 0.;
   // window the input
   fvec_t *yin = p->yinfft;
   smpl_t tmp = 0., sum = 0.;
   // window the input
-  for (l = 0; l < input->length; l++) {
-    p->winput->data[l] = p->win->data[l] * input->data[l];
-  }
+  fvec_weighted_copy(input, p->win, p->winput);
   // get the real / imag parts of its fft
   aubio_fft_do_complex (p->fft, p->winput, fftout);
   // get the squared magnitude spectrum, applying some weight
   // get the real / imag parts of its fft
   aubio_fft_do_complex (p->fft, p->winput, fftout);
   // get the squared magnitude spectrum, applying some weight