comnum.cyclic_autocorrelation#

comnum.cyclic_autocorrelation(x, alpha, *, lag=0, fs=1.0)#

The cyclic autocorrelation R^α(τ) = mean x[n+τ] x*[n] e^{-j2π α n/f_s}.

Parameters:
  • x (array_like) – the samples (complex).

  • alpha (float) – the cycle frequency (Hz).

  • lag (int) – the lag τ (samples).

  • fs (float) – the sampling rate (Hz).

Returns:

the cyclic autocorrelation.

Return type:

complex

Raises:

ValueError – for an input that is not an array of numbers of the expected shape.

Examples

>>> import comnum, numpy as np
>>> x = np.ones(100, dtype=complex)
>>> abs(comnum.cyclic_autocorrelation(x, 0.0, lag=0, fs=1.0))
1.0