Logo Search packages:      
Sourcecode: aubio version File versions  Download package

void vec_shift ( fvec_t s  ) 

implement 'fftshift' like function

a[0]...,a[n/2],a[n/2+1],...a[n]

becomes

a[n/2+1],...a[n],a[0]...,a[n/2]

Definition at line 150 of file mathutils.c.

References _fvec_t::channels, _fvec_t::data, and _fvec_t::length.

{
  uint_t i,j;
  //smpl_t tmp = 0.0f;
  for (i=0; i < s->channels; i++)
    for (j=0; j < s->length / 2 ; j++) {
      //tmp = s->data[i][j];
      //s->data[i][j] = s->data[i][j+s->length/2];
      //s->data[i][j+s->length/2] = tmp;
      ELEM_SWAP(s->data[i][j],s->data[i][j+s->length/2]);
    }
}


Generated by  Doxygen 1.6.0   Back to index