RGetFrequency()
Estimates the periodogram frequency of a signal.
Synopsis
int RGetFrequency( const dyn_float& data, int userData = 0);
Parameters
Parameter | Description |
---|---|
data | Vector of input data. |
userData | User data of the function call. The user data variable can be set to an integer value and be used to detect errors when calling R functions. Set the variable to an integer value and when the function is called and an error occurs, the specified integer value is returned. |
Return Value
The function returns the estimated frequency and negative values in case of errors.
Description
Estimates the periodogram frequency of a signal.
What is a periodogram:
To identify the important frequencies in the observed series, use the periodogram. The periodogram plots a measure to analyze the oscillation via frequency values of the observed data.
Example
Estimates the periodogram frequency of a signal.
/* Estimates the periodogram frequency of a signal. Returns the estimated frequency and negative values in case of errors.*/
#uses "CtrlR"
main()
{
dyn_float df1 = makeDynFloat(31,31,33,32,34,33,32,35,29,34,38,40,37,38,36,36,36,39,38,40,35,32,34,32,34,29,29,28,31,28,30,34,33,28,31,32,33,33,33,35,36,36,40,38,40,37,40,38,40,38);
int f;
f = RGetFrequency(df1);
DebugTN("the estimated frequency", f);
}
Assignment
Availability
See also