def stEnergyEntropy(frame, numOfShortBlocks=10):
 Eol = numpy.sum((frame ** 2))
 L = len(frame)
 subWinLength = int(numpy.floor((L / numOfShortBlocks)))
 if (L != (subWinLength * numOfShortBlocks)):
  frame = frame[0:(subWinLength * numOfShortBlocks)]
 subWindows = frame.reshape(subWinLength, numOfShortBlocks, order='F').copy()
 s = (numpy.sum((subWindows ** 2), axis=0) / (Eol + eps))
 Entropy = (- numpy.sum((s * numpy.log2((s + eps)))))
 return Entropy

def stEnergyEntropy ( frame , numOfShortBlocks = 10 ) : Eol = numpy . sum ( ( frame ** 2 ) ) L = len ( frame ) subWinLength = int ( numpy . floor ( ( L / numOfShortBlocks ) ) ) if ( L != ( subWinLength * numOfShortBlocks ) ) : frame = frame [ 0 : ( subWinLength * numOfShortBlocks ) ] subWindows = frame . reshape ( subWinLength , numOfShortBlocks , order = 'F' ) . copy ( ) s = ( numpy . sum ( ( subWindows ** 2 ) , axis = 0 ) / ( Eol + eps ) ) Entropy = ( - numpy . sum ( ( s * numpy . log2 ( ( s + eps ) ) ) ) ) return Entropy
computes entropy of energy .