problem in calculating normalized spectral entropy

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);

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by