R/measureDeviation.R

Defines functions .measureDeviation

# Deviation sigma_h = |m / a| of the envelope mean m relative to the envelope
# amplitude a at every sample (emd.model:169-181); the caller forms m and a.
# Where a = 0 the ratio is undefined when m = 0, returned as NA, and +Inf when
# m != 0, as in emd.m and emd 0.8.1 (emd.rilling.implementation:189;
# sift.implementation:5).
.measureDeviation <- function(mean, amplitude) {
    OUT <- abs(mean / amplitude)
    OUT[mean == 0 & amplitude == 0] <- NA_real_
    OUT
}

Try the xemd package in your browser

Any scripts or data that you put into this service are public.

xemd documentation built on Nov. 9, 2026, 1:09 a.m.