# Estimation of a spectral density function¶

Depending on the available data, we proceed differently:

if the data correspond to several independent realizations of the process, a

*statistical estimate*is performed using statistical average of a realization-based estimator;if the data correspond to one realization of the process at different time stamps (stored in a

*TimeSeries*object), the process being observed during a long period of time, an*ergodic estimate*is performed using a time average of an ergodic-based estimator.

*Welch*method is a

*non parametric*estimation technique, known to be performant. We detail it in the case where the available data on the process is a time series which values are associated to the time grid which is a discretization of the domain .

Applying the same decomposition,

and finally:

The objective is to get a statistical estimator from these
segments. We define the *periodogram* associated with the segment
by:

with and .

*periodogram*has bad statistical properties. Indeed, two quantities summarize the properties of an estimator: its

*bias*and its

*variance*. The bias is the expected error one makes on the average using only a finite number of time series of finite length, whereas the covariance is the expected fluctuations of the estimator around its mean value. For the periodogram, we have:

Bias where is the squared module of the Fourier transform of the function (

*Barlett window*) defined by:This estimator is

*biased*but this bias vanishes when as .Covariance as , which means that the fluctuations of the periodogram are of the same order of magnitude as the quantity to be estimated and thus the estimator is not convergent.

The periodogram’s lack of convergence may be easily fixed if we consider
the *averaged periodogram* over independent time series or
segments:

The averaging process has no effect on the significant bias of the periodogram.

The use of a *tapering window* may significantly reduce
it. The time series is replaced by a tapered time
series in the computation of
. One gets:

where is the square module of the Fourier transform
of at the frequency . A judicious choice of
tapering function such as the *Hanning window* can
dramatically reduce the bias of the estimate:

(1)¶

The library builds an estimation of the spectrum on a *TimeSeries* by
fixing the number of segments, the *overlap* size parameter and a
*FilteringWindows*. The available ones are:

The

*Hamming*windowwith =

The

*Hanning*window described in (1) which is supposed to be the most useful.

API:

See

`Hanning`

See

`Hamming`

See

`WelchFactory`

Examples: