problem in calculating normalized spectral entropy
Show older comments
Hello, I wrote this code for calculating normalized spectral entropy. I do not know how to calculate NFFT, (the number of frequencies within band[0 50];
function E = FFT_entropy(x)
NFFT = length(x);
Y = fft(x,NFFT);
S = abs(Y(1:NFFT/2+1))/NFFT;
S = S./sum(S);
% S=S(find(S~=0)); % elimino los valores iguales a cero para poder calcular el logaritmo
p = S/sum(S);
ppp = p * log2(1/p);
syms ppp;
out1 = symsum(ppp,0,50);
E = out1/log2(NFFT);
Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!