I am going to use Spectral Energy and Spectral Entropy as features for window-based time-series data. However, I'm bit confused about the formula being used for it online, especially about the the special Entropy.
I used entropy from Matlab but that doesn't work with time-series data. It just give me zero for everything. http://www.mathworks.nl/help/images/ref/entropy.html Test window Entropy result for this version = 0
Then I used this version. http://www.mathworks.com/matlabcentral/fileexchange/28692-entropy Test window Entropy result for this version = 4.3219
I also tried the -sum(p.*log2(p)) after applying imhist to a data window ( p = imhist(aw1(:));). Got this from an online help.
Test window Entropy result for this version = 0.0369
All of them reported different values.
For spectral energy, I am using the squared sum of fft coefficients. sum(abs(fft(data-window)).^2)
Can any body give me any suggestion which is the correct version ?
For Spectral Entropy the steps are:
Calculate the Entropy
−∑(P)log2(P)
, where P = PSD