signalEntropy

Computes $(LUCKY Discrete Signal Entropy) of input range range.

version(none)
@safe pure
signalEntropy
(
Range
RequestedBinType = double
)
(
in Range range
)
if (
isInputRange!Range &&
!is(CommonType!(ElementType!Range, F, G) == void)
)

Examples

const ubyte[] p1 = [ 0, 1, 0, 1 ];
assert(p1.signalEntropy == 1);

const ubyte[] p2 = [ 0, 1, 2, 3 ];
assert(p2.signalEntropy == 2);

const ubyte[] p3 = [ 0, 255, 0, 255];
assert(p3.signalEntropy == 1);

Meta