Changes in / [50961b9:ee6ca74]


Ignore:
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/fvec.c

    r50961b9 ree6ca74  
    108108}
    109109
    110 void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out) {
    111 #ifndef HAVE_ACCELERATE
    112   uint_t j;
    113   uint_t length = MIN(s->length, weight->length);
    114   for (j=0; j< length; j++) {
    115     out->data[j] = in->data[j] * weight->data[j];
    116   }
    117 #else
    118   aubio_vDSP_vmul(in->data, 1, weight->data, 1, out->data, 1, out->length);
    119 #endif /* HAVE_ACCELERATE */
    120 }
    121 
    122110void fvec_copy(fvec_t *s, fvec_t *t) {
    123111  if (s->length != t->length) {
  • src/fvec.h

    r50961b9 ree6ca74  
    163163void fvec_copy(fvec_t *s, fvec_t *t);
    164164
    165 /** make a copy of a vector, applying weights to each element
    166 
    167   \param in input vector
    168   \param weight weights vector
    169   \param out output vector
    170 
    171 */
    172 void fvec_weighted_copy(fvec_t *in, fvec_t *weight, fvec_t *out);
    173 
    174165#ifdef __cplusplus
    175166}
  • src/mathutils.c

    r50961b9 ree6ca74  
    254254fvec_shift (fvec_t * s)
    255255{
    256 #ifndef HAVE_ACCELERATE
    257256  uint_t j;
    258257  for (j = 0; j < s->length / 2; j++) {
    259258    ELEM_SWAP (s->data[j], s->data[j + s->length / 2]);
    260259  }
    261 #else
    262   uint_t half = s->length / 2;
    263   aubio_cblas_xswap(half, s->data, 1, s->data + half, 1);
    264 #endif
    265260}
    266261
     
    269264{
    270265  smpl_t energy = 0.;
    271 #ifndef HAVE_ACCELERATE
    272266  uint_t j;
    273267  for (j = 0; j < f->length; j++) {
    274268    energy += SQR (f->data[j]);
    275269  }
    276 #else
    277   energy = aubio_cblas_dot(f->length, f->data, 1, f->data, 1);
    278 #endif
    279270  return energy / f->length;
    280271}
  • src/pitch/pitch.c

    r50961b9 ree6ca74  
    240240aubio_pitch_slideblock (aubio_pitch_t * p, fvec_t * ibuf)
    241241{
    242   uint_t overlap_size = p->buf->length - ibuf->length;
    243 #if !HAVE_MEMCPY_HACKS
    244   uint_t j;
     242  uint_t j = 0, overlap_size = 0;
     243  overlap_size = p->buf->length - ibuf->length;
    245244  for (j = 0; j < overlap_size; j++) {
    246245    p->buf->data[j] = p->buf->data[j + ibuf->length];
     
    249248    p->buf->data[j + overlap_size] = ibuf->data[j];
    250249  }
    251 #else
    252   smpl_t *data = p->buf->data;
    253   smpl_t *newdata = ibuf->data;
    254   memmove(data, data + ibuf->length, overlap_size);
    255   memcpy(data + overlap_size, newdata, ibuf->length);
    256 #endif
    257250}
    258251
  • src/pitch/pitchyinfft.c

    r50961b9 ree6ca74  
    108108  smpl_t tmp = 0., sum = 0.;
    109109  // window the input
    110   fvec_weighted_copy(input, p->win, p->winput);
     110  for (l = 0; l < input->length; l++) {
     111    p->winput->data[l] = p->win->data[l] * input->data[l];
     112  }
    111113  // get the real / imag parts of its fft
    112114  aubio_fft_do_complex (p->fft, p->winput, fftout);
Note: See TracChangeset for help on using the changeset viewer.