GETVALLEY

Purpose:

Finds the valleys of a series or table.

Syntax:

GETVALLEY(series, threshold, width, size, padmode, fillval)

series

-

An input series.

threshold

-

Optional. A real, the maximum value below which valleys will be accepted. Defaults to the maximum of the series.

width

-

Optional. An integer that specifies the minimum number of points that comprise a valley. Defaults to 1.

size

-

Optional. Specifies the minimum acceptable peak to valley height of a valley. Defaults to 0.0.

padmode

-

Optional. An integer, determines whether the values between the valleys in the resulting series will be padded.

0:

do not pad

1:

pad (default)

2:

linear interpolation

fillval

-

Optional. A real, the padding value to use when padmode is on. Defaults to 0.0.

Returns:

A series or table

Example:

getvalley(W1)

 

finds all the valleys of Window 1.

Example:

W2: gsin(128, 1/128, 4)

getvalley(W2)

 

finds the four valleys associated with the valley of each sine wave.

Example:

getvalley(W1, max(W1), 1, 0.0, 1, 0.0)

 

Same as above. Note that because the default fillval is 0.0, it is possible that peaks and valleys of height 0.0 will be indistinguishable from the fillval. If this is a problem, set the fillval to be the minimum of the input series for GETPEAK and the maximum value of the input series for GETVALLEY. For example, to uniquely find all the valleys of a series:

 

getvalley(W1, max(W1), 1, 0.0, 1, max(W1))

Remarks:

The default values for the optional arguments suffice for most applications.

See Also:

GETPEAK

LEVELCROSS