zeroCross: Find the Zero Crossing of a Time Series

Description Usage Arguments See Also Examples

Description

Finds positive-negative of negative-positive zero crossings of the input time series.

Usage

1
zeroCross(x, slope="positive")

Arguments

x

a numeric vector representing a time series.

slope

a character string defining the typeo of zero-crossings to find: specifying a "negative" slope identifies all positive- to negative-valued zero-crossings, while a "positive" slope identifies all negative- to positive-valued zero crossings. Default: "positive".

See Also

msExtrema.

Examples

1
2
3
4
5
6
x <- sin(seq(0,10,length=1000))
pos <- zeroCross(x, "positive")
neg <- zeroCross(x, "negative")
plot(x, cex=0.5, type="b")
abline(v=pos, col="red", lty="solid")
abline(v=neg, col="blue", lty="dashed")

zeehio/msProcess documentation built on May 4, 2019, 10:15 p.m.