Skip to contents

-x^2 * log(x^2) with a small floor to guard log(0). Amplifies moderate-energy components, useful as a preprocessor for heart-sound segmentation.

Usage

morie_dsp_shannon_energy(x)

Arguments

x

Numeric vector.

Value

Numeric vector, length(x).

References

Rangayyan & Krishnan (2015), Ch. 4, sec. 4.5; Liang et al. (1997).

Examples

set.seed(1L)
x <- rnorm(50)
morie_dsp_shannon_energy(x)
#>  [1] 0.2020746931 0.0342395755 0.2775188022 0.3404373701 0.0843506811
#>  [6] 0.2725660629 0.1466461728 0.2441690056 0.1821081998 0.0753447219
#> [11] 0.3558330472 0.1076494778 0.2000405091 0.0000000000 0.3495377598
#> [16] 0.0032088521 0.0005256993 0.3098143727 0.2728142716 0.1892941402
#> [21] 0.3029007574 0.2596273298 0.0076881816 0.1731633045 0.1994875636
#> [26] 0.0047212244 0.0262702772 0.3610493060 0.1429078061 0.1187695611
#> [31] 0.3677824177 0.0132266635 0.1067958161 0.0043883142 0.3674103864
#> [36] 0.1175974444 0.1094002962 0.0051930060 0.3452784150 0.2530203520
#> [41] 0.0286945615 0.0567482161 0.2289972748 0.1744822245 0.2259269841
#> [46] 0.2329091938 0.0977813878 0.2549003374 0.0153433739 0.2917723952