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);
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!