WelchFactory¶
(Source code, png, hires.png, pdf)

class
WelchFactory
(*args)¶ Welch estimator of the spectral model of a stationary process.
Parameters: window :
FilteringWindows
The filtering window model.
By default, the filtering window model is the Hanning model.
blockNumber : int
Number of blocks.
By default, blockNumber=1.
overlap : float, .
Overlap rate parameter of the segments of the time series.
By default, overlap=0.5.
Notes
Let be a multivariate second order stationary process, with zero mean, where . We only treat here the case where the domain is of dimension 1: (n=1).
If we note its covariance function, then for all is (ie ), with as this quantity does not depend on .
The bilateral spectral density function exists and is defined as the Fourier transform of the covariance function :
where is the set of ddimensional positive definite hermitian matrices.
The Welch estimator is a non parametric estimator based on the segmentation of the time series into blockNumber segments possibly overlapping (size of overlap overlap). The length of each segment is deduced.
Examples
Create a time series from a stationary second order process:
>>> import openturns as ot >>> myTimeGrid = ot.RegularGrid(0.0, 0.1, 2**8) >>> model = ot.ExponentialCauchy([5.0], [3.0]) >>> gp = ot.SpectralGaussianProcess(model, myTimeGrid) >>> myTimeSeries = gp.getRealization()
Estimate the spectral model with WelchFactory:
>>> mySegmentNumber = 10 >>> myOverlapSize = 0.3 >>> myFactory = ot.WelchFactory(ot.Hanning(), mySegmentNumber , myOverlapSize) >>> myEstimatedModel_TS = myFactory.build(myTimeSeries)
Change the filtering window:
>>> myFactory.setFilteringWindows(ot.Hamming())
Methods
build
(*args)Estimate the spetral model. buildAsUserDefinedSpectralModel
(*args)getBlockNumber
()Accessor to the block number. getClassName
()Accessor to the object’s name. getFFTAlgorithm
()Accessor to the FFT algorithm used for the Fourier transform. getFilteringWindows
()Accessor to the filtering window. getId
()Accessor to the object’s id. getName
()Accessor to the object’s name. getOverlap
()Accessor to the overlap rate. getShadowedId
()Accessor to the object’s shadowed id. getVisibility
()Accessor to the object’s visibility state. hasName
()Test if the object is named. hasVisibleName
()Test if the object has a distinguishable name. setBlockNumber
(blockNumber)Accessor to the block number. setFFTAlgorithm
(fft)Accessor to the FFT algorithm used for the Fourier transform. setFilteringWindows
(window)Accessor to the filtering window. setName
(name)Accessor to the object’s name. setOverlap
(overlap)Accessor to the block number. setShadowedId
(id)Accessor to the object’s shadowed id. setVisibility
(visible)Accessor to the object’s visibility state. 
__init__
(*args)¶ x.__init__(…) initializes x; see help(type(x)) for signature

build
(*args)¶ Estimate the spetral model.
 Available usages:
build(myTimeSeries)
build(myProcessSample)
Parameters: myTimeSeries :
TimeSeries
One realization of the process.
myProcessSample :
ProcessSample
Several realizations of the process.
Returns: mySpectralModel :
UserDefinedSpectralModel
The spectral model estimated with the Welch estimator.

getBlockNumber
()¶ Accessor to the block number.
Returns: blockNumber : int
The number of blocks used in the Welch estimator.
By default, blockNumber = 1.

getClassName
()¶ Accessor to the object’s name.
Returns: class_name : str
The object class name (object.__class__.__name__).

getFFTAlgorithm
()¶ Accessor to the FFT algorithm used for the Fourier transform.
Returns: fftAlgo :
FFT
The FFT algorithm used for the Fourier transform.

getFilteringWindows
()¶ Accessor to the filtering window.
Returns: filteringWindow :
FilteringWindows
The filtering window used.
By default, the
Hanning
one.

getId
()¶ Accessor to the object’s id.
Returns: id : int
Internal unique identifier.

getName
()¶ Accessor to the object’s name.
Returns: name : str
The name of the object.

getOverlap
()¶ Accessor to the overlap rate.
Returns: overlap : float, .
The overlap rate of the time series.
By default, overlap = 0.5.

getShadowedId
()¶ Accessor to the object’s shadowed id.
Returns: id : int
Internal unique identifier.

getVisibility
()¶ Accessor to the object’s visibility state.
Returns: visible : bool
Visibility flag.

hasName
()¶ Test if the object is named.
Returns: hasName : bool
True if the name is not empty.

hasVisibleName
()¶ Test if the object has a distinguishable name.
Returns: hasVisibleName : bool
True if the name is not empty and not the default one.

setBlockNumber
(blockNumber)¶ Accessor to the block number.
Parameters: blockNumber : positive int
The number of blocks used in the Welch estimator.

setFFTAlgorithm
(fft)¶ Accessor to the FFT algorithm used for the Fourier transform.
Parameters: fftAlgo :
FFT
The FFT algorithm used for the Fourier transform.

setFilteringWindows
(window)¶ Accessor to the filtering window.
Parameters: filteringWindow :
FilteringWindows
The filtering window used.

setName
(name)¶ Accessor to the object’s name.
Parameters: name : str
The name of the object.

setOverlap
(overlap)¶ Accessor to the block number.
Parameters: blockNumber : int, .
The overlap rate of the times series.

setShadowedId
(id)¶ Accessor to the object’s shadowed id.
Parameters: id : int
Internal unique identifier.

setVisibility
(visible)¶ Accessor to the object’s visibility state.
Parameters: visible : bool
Visibility flag.
