Skip to contents

Polygonal length: sum(sqrt(1 + diff(x)^2)). Curve length under unit time-step.

Usage

morie_dsp_arc_length(x)

Arguments

x

Numeric vector.

Value

Scalar.

References

Rangayyan & Krishnan (2015), Ch. 5, sec. 5.3.

Examples

t <- seq(0, 1, length.out = 100)
x <- sin(2 * pi * 5 * t)
morie_dsp_arc_length(x)
#> [1] 101.427
morie_dsp_arc_length(rep(0, 5))  # flat signal: n - 1
#> [1] 4