11.9.2. astroML.filters.wiener_filter

astroML.filters.wiener_filter(t, h, signal='gaussian', noise='flat', return_PSDs=False, signal_params=None, noise_params=None)[source]

Compute a Wiener-filtered time-series

Parameters
tarray_like

evenly-sampled time series, length N

harray_like

observations at each t

signalstr (optional)

currently only ‘gaussian’ is supported

noisestr (optional)

currently only ‘flat’ is supported

return_PSDsbool (optional)

if True, then return (PSD, P_S, P_N)

signal_guesstuple (optional)

A starting guess at the parameters for the signal. If not specified, a suitable guess will be estimated from the data itself. (see Notes below)

noise_guesstuple (optional)

A starting guess at the parameters for the noise. If not specified, a suitable guess will be estimated from the data itself. (see Notes below)

Returns
h_smoothndarray

a smoothed version of h, length N

See also

scipy.signal.wiener

a static (non-adaptive) wiener filter

Notes

The Wiener filter operates by fitting a functional form to the PSD:

PSD = P_S + P_N

The resulting frequency-space filter is given by:

Phi = P_S / (P_S + P_N)

This entire operation is equivalent to a kernel smoothing by a kernel whose Fourier transform is Phi.

the arguments signal_guess and noise_guess specify the initial guess for the characteristics of signal and noise used in the minimization. They are generally expected to be tuples, and the meaning varies depending on the form of signal and noise used. For gaussian, the params are (amplitude, width). For flat, the params are (amplitude,).