def stSpectralRollOff(X, c, fs):
 totalEnergy = numpy.sum((X ** 2))
 fftLength = len(X)
 Thres = (c * totalEnergy)
 CumSum = (numpy.cumsum((X ** 2)) + eps)
 [a] = numpy.nonzero((CumSum > Thres))
 if (len(a) > 0):
  mC = (numpy.float64(a[0]) / float(fftLength))
 else:
  mC = 0.0
 return mC

def stSpectralRollOff ( X , c , fs ) : totalEnergy = numpy . sum ( ( X ** 2 ) ) fftLength = len ( X ) Thres = ( c * totalEnergy ) CumSum = ( numpy . cumsum ( ( X ** 2 ) ) + eps ) [ a ] = numpy . nonzero ( ( CumSum > Thres ) ) if ( len ( a ) > 0 ) : mC = ( numpy . float64 ( a [ 0 ] ) / float ( fftLength ) ) else : mC = 0.0 return mC
computes spectral roll-off .