This example shows the different values of entropy of a random signal.
For purposes of reproducibility, reset the random seed and generate a random signal.
Compute the Shannon entropy of x
.
Compute the log energy entropy of x
.
Compute the threshold entropy of x
with the threshold entropy equal to 0.2.
Compute the Sure entropy of x
with the threshold equal to 3.
Compute the norm entropy of x
with power equal to 1.1
You can use your own entropy function ABC
with wentropy
. Your function must be defined in a .m
file, and the first line must be of the form:
function e = ABC(x)
where x
is a vector and e
is a real number. The new entropy can be used by typing
e = wentropy(x,'user','ABC')
or more directly
e = wentropy(x,'ABC')
The function file myEntropy.m
returns the normalized Shannon entropy of a signal. Compute the normalized Shannon entropy of x
.