komm.cyclic_acorr
Computes the cyclic autocorrelation $\tilde{R}[\ell]$ of a real or complex sequence $x[n]$. This is defined as $$ \tilde{R}[\ell] = \sum_{n \in [0:L)} x[n] \tilde{x}^*_\ell[n], $$ where $\tilde{x}^*_\ell[n]$ is the complex conjugate of $x[n]$ cyclic-shifted by $\ell$ positions, and $L$ is the period of the sequence. The cyclic autocorrelation $\tilde{R}[\ell]$ is even symmetric and periodic with period $L$.
Parameters:
-
seq
(Array1D[float | complex]
) –A 1D-array containing the sequence $x[n]$, of length $L$.
-
shifts
(Optional[Array1D[int]]
) –A 1D-array containing the values of $\ell$ for which the cyclic autocorrelation will be computed. The default value is
range(len(seq))
, that is, $[0 : L)$. -
normalized
(Optional[bool]
) –If
True
, returns the cyclic autocorrelation divided by the sequence energy, so that $R[0] = 1$. The default value isFalse
.
Returns:
-
cyclic_acorr
(SameAsInput
) –The cyclic autocorrelation $\tilde{R}[\ell]$ of the sequence.
Examples:
>>> komm.cyclic_acorr([1.0, 2.0, 3.0, 4.0], shifts=[-2, -1, 0, 1, 2])
array([22., 24., 30., 24., 22.])