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

smpl_t vec_alpha_norm ( fvec_t DF,
smpl_t  alpha 
)

return alpha norm.

alpha=2 means normalise variance. alpha=1 means normalise abs value. as alpha goes large, tends to normalisation by max value.

Bug:
should not use POW :(

Definition at line 183 of file mathutils.c.

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

{
  smpl_t tmp = 0.;
  uint_t i,j;
  for (i=0;i<DF->channels;i++)
    for (j=0;j<DF->length;j++)
      tmp += POW(ABS(DF->data[i][j]),alpha);
  return POW(tmp/DF->length,1./alpha);
}


Generated by  Doxygen 1.6.0   Back to index