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

uint_t vec_max_elem ( fvec_t s  ) 

returns the index of the max of a vector

Bug:
mono

Definition at line 138 of file mathutils.c.

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

{
  uint_t i,j=0, pos=0.;
  smpl_t tmp = 0.0f;
  for (i=0; i < s->channels; i++)
    for (j=0; j < s->length; j++) {
      pos = (tmp > s->data[i][j])? pos : j;
      tmp = (tmp > s->data[i][j])? tmp : s->data[i][j]  ;
    }
  return pos;
}


Generated by  Doxygen 1.6.0   Back to index