twistpy.tilt.correction.transfer_function#

transfer_function(response: ndarray, source: ndarray, dt: float, smooth: float) tuple[source]#

Calculate transfer function and complex coherence between two signals. The transfer function is calculated from smoothed cross- and non-smoothed autospectral densities of source and response signal. Smoothing is done by convolution with a Blackman window. The complex transfer function, the autospectral densities, and a corresponding frequency vector are returned.

Parameters
responsenumpy.ndarray

Sample data of the response signal.

sourcenumpy.ndarray

Sample data of the source signal.

dtfloat

Sampling interval [s].

smoothfloat

Size of the Blackman window used for smoothing [Hz].

Returns
output5-tuple of numpy.ndarray

(freq, XX, YY, Ars, coh) freq: array of frequencies Grr: autospectral density of response signal, Gss: autospectral density of source signal, Ars: source to response transfer function, coh: smoothed complex coherence between source and response signal