def stSpectralEntropy(X, numOfShortBlocks=10):
    'Computes the spectral entropy'
    L = len(X)
    Eol = np.sum((X ** 2))
    subWinLength = int(np.floor((L / numOfShortBlocks)))
    if (L != (subWinLength * numOfShortBlocks)):
        X = X[0:(subWinLength * numOfShortBlocks)]
    subWindows = X.reshape(subWinLength, numOfShortBlocks, order='F').copy()
    s = (np.sum((subWindows ** 2), axis=0) / (Eol + eps))
    En = (- np.sum((s * np.log2((s + eps)))))
    return En
Computes the spectral entropy
def stSpectralEntropy(X, numOfShortBlocks=10):
    
    L = len(X)
    Eol = np.sum((X ** 2))
    subWinLength = int(np.floor((L / numOfShortBlocks)))
    if (L != (subWinLength * numOfShortBlocks)):
        X = X[0:(subWinLength * numOfShortBlocks)]
    subWindows = X.reshape(subWinLength, numOfShortBlocks, order='F').copy()
    s = (np.sum((subWindows ** 2), axis=0) / (Eol + eps))
    En = (- np.sum((s * np.log2((s + eps)))))
    return En