The LNP_TEST function computes the Lomb Normalized Periodogram of two sample populations X and Y and tests the hypothesis that the populations represent a significant periodic signal against the hypothesis that they represent random noise.

LNP_TEST is based on the routine fasper described in section 13.8 of Numerical Recipes in C: The Art of Scientific Computing (Second Edition), published by Cambridge University Press, and is used by permission.

## Examples

This example tests the hypothesis that two sample, n-element populations X and Y represent a significant periodic signal against the hypothesis that they represent random noise:

`; Define two n-element sample populations:X = [ 1.0,  2.0,  5.0,  7.0,  8.0,  9.0, \$   10.0, 11.0, 12.0, 13.0, 14.0, 15.0, \$   16.0, 17.0, 18.0, 19.0, 20.0, 22.0, \$   23.0, 24.0, 25.0, 26.0, 27.0, 28.0]Y = [ 0.69502, -0.70425,  0.20632,  0.77206, -2.08339,  0.97806, \$   1.77324,  2.34086,  0.91354,  2.04189,  0.53560, -2.05348, \$   -0.76308, -0.84501, -0.06507, -0.12260,  1.83075,  1.41403, \$   -0.26438, -0.48142, -0.50929,  0.01942, -1.29268,  0.29697]; Test the hypothesis that X and Y represent a significant periodic; signal against the hypothesis that they represent random noise:result = LNP_TEST(X, Y, WK1 = wk1, WK2 = wk2, JMAX = jmax)PRINT, result`

IDL prints:

`4.69296    0.198157`

The small value of the significance represents the possibility of a significant periodic signal. A larger number of samples for X and Y would produce a more conclusive result. WK1 and WK2 are both 48-element vectors containing linear frequencies and corresponding Lomb values, respectively. JMAX is the indexed location of the maximum Lomb value in WK2.

## Syntax

Result = LNP_TEST( X, Y [, /DOUBLE] [, HIFAC=scale_factor] [, JMAX=variable] [, OFAC=value] [, WK1=variable] [, WK2=variable] )

## Return Value

The result is a two-element vector containing the maximum peak in the Lomb Normalized Periodogram and its significance. The significance is a value in the interval [0.0, 1.0]; a small value indicates that a significant periodic signal is present.

## Arguments

### X

An n-element integer, single-, or double-precision floating-point vector containing equally or unequally spaced time samples.

### Y

An n-element integer, single-, or double-precision floating-point vector containing amplitudes corresponding to Xi.

## Keywords

### DOUBLE

Set this keyword to force the computation to be done in double-precision arithmetic.

### HIFAC

Use this keyword to specify the scale factor of the average Nyquist frequency. The default value is 1.

### JMAX

Use this keyword to specify a named variable that will contain the index of the maximum peak in the Lomb Normalized Periodogram.

### OFAC

Use this keyword to specify the oversampling factor. The default value is 4.

### WK1

Use this keyword to specify a named variable that will contain a vector of increasing linear frequencies.

### WK2

Use this keyword to specify a named variable that will contain a vector of values from the Lomb Normalized Periodogram corresponding to the frequencies in WK1.

## Version History

 4 Introduced