HarmonicEstimation (FPScript)
Estimates the least-squares harmonic components of a signal.
Syntax
HarmonicEstimation(Signal, [ Result = HARMONIC_COMPONENTS ], [ Algorithm = HARMONIC_AUTO ], [ Components = 60 dB ], [ Order ] [ , Model = HARMONIC_SINE ])
The syntax of the HarmonicEstimation function consists of the following parts:
Part |
Description |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Signal |
The data to be analyzed. Permitted data structures are data series und signal. All real data types are permitted. If the argument is a list, then the function is executed for each element of the list and the result is also a list. |
||||||||||||||||||||
Result |
The harmonic information to be returned. The argument Result can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value HARMONIC_COMPONENTS. |
||||||||||||||||||||
Algorithm |
The algorithm for estimating the frequencies. The argument Algorithm can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value HARMONIC_AUTO. |
||||||||||||||||||||
Components |
Controls the number of components to be output or their frequencies. Can be specified via count, a positive number from 1 to 100, by a dB threshold, a negative number from -0.01 to -300 or as a data series with specified frequencies. If you specify a data series with frequencies, then the argument Algorithm must be set to the value HARMONIC_LINEARMODELING. Permitted data structures are scalar value und data series. All real data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value 60 dB. |
||||||||||||||||||||
Order |
The Autoregressive or Eigenanalysis model order. The valid range is between 1 and the smaller of 100 and 1/2 the data length - 1. The argument is optional. The default is the smaller of 50 and 1/2 the data length - 1. Permitted data structures are scalar value. All integral data types are permitted. If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. |
||||||||||||||||||||
Model |
The model to be used. The argument Model can have the following values:
If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated. If this argument is omitted, it will be set to the default value HARMONIC_SINE. |
Remarks
The HarmonicEstimation function generates a parametric (sinusoidal or attenuated sinusoidal) model of the signal. The harmonic modeling algorithm has two stages. In the first optional stage, an AR, Prony, Eigenanalysis, or Fourier algorithm is used to determine the number of spectral components and their frequencies. Alternatively you can provide these frequencies as a data series. In the second stage a linear fit is made to determine the amplitudes and phases.
Available in
Option Spectral Analysis
Examples
HarmonicEstimation(Signal, HARMONIC_COMPONENTS, HARMONIC_FOURIER, 10, 40, HARMONIC_SINE)
Harmonic estimation of the signal 'Signal'. For this, Fourier is selected as the algorithm and Sinusoidal is selected as the model. This is an example from the Harmonic Estimation Tutorial.