Calculating renyi entropy on singular values of time-frequency matrix?
3 views (last 30 days)
Show older comments
svd_wvd = svd(tfrwvd); function [r,rmax,rmin] = entropy_renyi(n,alpha)
then I applied this code %ENTROPY_RENYI Renyi's entropy of a distribution % function [r,rmax,rmin] = entropy_renyi(n,alpha) % Given a frequency vector calculates its entropy by 1/(1-alpha)*log2(sum_i(pi^alpha)) % log2 is equivalent to ln (just scaling) % n - vector with counts % alpha>=0 - order, default=2 % r - entropy (Renyi) - always between rmin and rmax for given n % rmax - maximum entropy for the same number of classes = log2(length(n)), % or alpha=0 % rmin - minimum entropy achieved for alpha->inf
p = n(:)./sum(n(:)); %frequency to probability
if alpha==1 %Shannon's entropy p(p==0)=1; r = -sum(p.*log2(p)); disp(['Renyi''s entropy for alpha=' num2str(alpha) ' or Shannon''s entropy = ' num2str(r)]); else r = 1/(1-alpha)*log2(sum(p.^alpha)); disp(['Renyi''s entropy for alpha=' num2str(alpha) ' is ' num2str(r) ]); end rmax = log2(length(n)); %achieved for the uniform distribution in that set or for alpha=0 rmin = -log2(max(p)); %achieved for alpha->inf
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!