SignalProcessing - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Signal Processing : Transforms : SignalProcessing/LSSpectrum

SignalProcessing

  

LSSpectrum

  

compute the Lomb-Scargle power spectrum of irregularly spaced data

 

Calling Sequence

Parameters

Options

Description

Examples

References

Compatibility

Calling Sequence

LSSpectrum(t, f, options)

Parameters

t

-

rtable ; the time

f

-

rtable ; the signal

Options

• 

outputdata : posint : specify the number of the output data points

• 

errors : rtable or realcons 

• 

precise : truefalse : indicates the methods to use

• 

minimumfrequency : float : indicates minimum frequency

• 

maximumfrequency : float : indicates maximum frequency

• 

normalization : identical('standard', 'model', 'log', 'psd') ; indicates the type of normalization

• 

oversamplingfactor : numeric : indicates the oversampling factor

• 

nyquistfactor : numeric : indicates the multiple of the average Nyquist frequency

• 

centerdata : truefalse : indicates whether the data needs to subtract the weighted mean

• 

generalized : truefalse : indicates the methods to use for the Lomb Scargle Fast Approximation

Description

• 

The LSSpectrum(t, f) command computes the frequencies and power spectrum based on provided time and signal using Lomb Scargle Periodogram Method, and returns the result in an Array of datatype float[8].

• 

f and t can only be Vectors or one-dimensional Arrays.

• 

There are two ways to compute the Lomb Scargle Periodogram: one can compute the exact values, or an approximation. Computing the approximation is generally much faster. If the precise option is set to true, then the actual formula is used for computation, otherwise the fast approximation is used. The default value is false.

• 

The errors option specifies the expected magnitude of the errors, which is used to get the normalized weight for generalized Lomb Scargle periodogram. It can only be a real number or an one-dimensional array. The default value is NULL.

• 

The outputdata option specifies the number of output data points. These output data points correspond to equally spaced frequencies.

• 

The minimumfrequency option specifies the minimum frequency.

• 

The maximumfrequency option specifies the maximum frequency.

• 

If one of maximumfrequency, minimumfrequency and outputdata is specified, then all of them must be provided. If all of them are not provided, then the frequencies used run from 1Toversamplingfactor to nyquistfactorNf, where T=maxtmint and Nf=n2T where n is the number of elements in t. Output frequencies are equally spaced.  

• 

The nyquistfactor option has a default value 1.

• 

The normalization option controls the normalization used on the power and can be one of standard, model, log or psd. The default value is standard. Standard Normalization : Pstandardf=χref2χf2χref2. Model Normalization : Pmodelf=χref2χf2χf2. Logarithmic Normalization:  Plogf=logχref2χf2. PSD Normalization : Ppsdf=χref22χf22. In all normalization methods, let fi be the measurement in time ti with errors σi, then χf2=i=1nfifti2σi2 where n is the number of elements in f, and χref2 is the non-varying reference model which is the χf2 for weighted mean.

• 

The oversamplingfactor option specifies the oversampling factor. The default value is 5.

• 

If the centerdata=false option is provided, then the weighted mean will not be subtracted from signal data. The default value is true.

• 

If the generalized=false option is provided, then the generalized Lomb Scargle Periodogram will not be used. The default value is true.

Examples

withSignalProcessing:

Generate a time vector

tsortLinearAlgebra:-RandomVector200,generator=0..12Pi,datatype=float8

t0.1747061339360980.4486974492913810.5806959187938451.200070035865891.298586641434811.346298564672411.621959110612081.740620419354291.871927922354452.03387155755973200 element Vector[column]

(1)

Generate a signal using frequencies of 1 Hz and 2 Hz:

f11.0:

f22.0:

sVector200,i→sinf12Piti+1.5sinf22Piti,datatype=float8

s2.106939846966700.5846321103955350.7878914338841811.831801921931060.09377638321058260.5810223772636760.8054367363959020.8218720792055912.219505476930890.830577485506060200 element Vector[column]

(2)

frequency,powerLSSpectrumt,s

frequency,power0.005350642596648310.01070128519329660.01605192778994490.02140257038659320.02675321298324150.03210385557988980.03745449817653810.04280514077318640.04815578336983470.0535064259664830500 element Vector[column],0.04231909727391090.04180521644309110.03956614344816590.03582772225981260.02959659388695690.02065190329691040.01038149731362690.001806248111400980.001777089905015720.00762512462490697500 element Vector[column]

(3)

plotfrequency,power

References

  

Lomb, Nicholas R. "Least-Squares Frequency Analysis of Unequally Spaced Data." Astrophysics and Space Science. Vol. 39, 1976, pp. 447–462.

  

Press, William H., and Rybicki, George B. "Fast Algorithm for Spectral Analysis of Unevenly Sampled Data." Astrophysical Journal. Vol. 338, 1989, pp. 277–280.

  

Zechmeister, M., and Kürster, M. "The generalised Lomb-Scargle periodogram. A new formalism for the floating-mean and Keplerian periodograms." Astronomy & Astrophysics. Vol. 496, 2009, pp. 577-584

Compatibility

• 

The SignalProcessing[LSSpectrum] command was introduced in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

SignalProcessing