Skip to contents

Shannon-energy envelope of a phonocardiogram (PCG): normalises the signal, computes \(-x^2 \log x^2\), then box-smooths over a 20 ms window. The standard envelope used for S1/S2 segmentation.

Usage

pcgenv(pcg, fs)

Arguments

pcg

Numeric vector (1-D PCG signal).

fs

Sampling frequency in Hz.

Value

List with filtered (envelope), name, fs, n_samples.

Details

Reference: Liang, H., Lukkarinen, S. & Hartimo, I. (1997) "Heart sound segmentation algorithm based on heart sound envelogram", Comput. Cardiol., pp. 105–108.

Examples

# \donttest{
set.seed(1)
pcg <- rnorm(4000)
res <- pcgenv(pcg, fs = 2000)
length(res$filtered)
#> [1] 4000
# }