How to Calculate Differential Entropy when using Band Power Features with Python?

Viewed 182

I want to extract different types of Frequency-Domain features of a signal. For example, I'm calculating the average band power of an EEG signal based on this code:

from scipy import signal
from scipy.integrate import simps

#Calculate PSD features
def ComputePSDFeature(data,channelCount,low, high,samplerate):
    #Define window size 2/lowest freq
    win = (2/low) * samplerate
    features = []

    #Calculate psd based on welch method
    freqs, psd = signal.welch(data, samplerate, nperseg=win)
    
    #Frequency Resolution
    freq_res = freqs[1] - freqs[0]
    idx = np.logical_and(freqs >= low, freqs <= high)
    
    #Calculate Band Power with Simps
    power = simps(psd[idx], dx=freq_res)
    features.append(power)
return np.array(features)    

Now in my article I have this explanation

Differential Entropy (DE) Features is one of the most important frequency features, which is effective in emotion recognition With this image for the equation: enter image description here

I don't know exactly what these signs stand for so I want to find a package that can calculate DE from me.How Can I solve this equation in python?

0 Answers
Related