extrema function

Finding Local Extrema and Zero-crossings

Finding Local Extrema and Zero-crossings

This function indentifies extrema and zero-crossings.

extrema(y, ndata = length(y), ndatam1 = ndata - 1)

Arguments

  • y: input signal
  • ndata: the number of observation
  • ndatam1: the number of observation - 1

Details

This function indentifies extrema and zero-crossings.

Returns

  • minindex: matrix of time index at which local minima are attained. Each row specifies a starting and ending time index of a local minimum

  • maxindex: matrix of time index at which local maxima are attained. Each row specifies a starting and ending time index of a local maximum.

  • nextreme: the number of extrema

  • cross: matrix of time index of zero-crossings. Each row specifies a starting and ending time index of zero-crossings.

  • ncross: the number of zero-crossings

See Also

extrema2dC, extractimf, emd.

Examples

y <- c(0, 1, 2, 1, -1, 1:4, 5, 6, 0, -4, -6, -5:5, -2:2) #y <- c(0, 0, 0, 1, -1, 1:4, 4, 4, 0, 0, 0, -5:5, -2:2, 2, 2) #y <- c(0, 0, 0, 1, -1, 1:4, 4, 4, 0, 0, 0, -5:5, -2:2, 0, 0) plot(y, type = "b"); abline(h = 0) extrema(y)
  • Maintainer: Donghoh Kim
  • License: GPL (>= 3)
  • Last published: 2022-01-04

Useful links