komm.ComplexSequence
General complex sequence. It is denoted by $x[n]$, with elements in $\mathbb{C}$. Its length (or period) is denoted by $L$.
__init__
Constructor for the class.
Parameters:
-
sequence
(Array1D[complex]
) –The complex sequence. Must be a 1D-array of length $L$ with elements in $\mathbb{C}$.
Examples:
>>> seq = ComplexSequence([1, 1j, -1, -1j])
>>> seq.sequence
array([ 1.+0.j, 0.+1.j, -1.+0.j, -0.-1.j])
sequence
property
The complex sequence $x[n]$.
length
property
The length (or period) $L$ of the complex sequence.
autocorrelation
Returns the autocorrelation $R[\ell]$ of the complex sequence. See komm.autocorrelation
for more details.
Parameters:
-
shifts
(Optional[Array1D[int]]
) –See
komm.autocorrelation
. The default value yields $[0 : L)$. -
normalized
(Optional[bool]
) –See
komm.autocorrelation
. The default value isFalse
.
Returns:
-
autocorrelation
(Array1D[complex]
) –The autocorrelation $R[\ell]$ of the complex sequence.
Examples:
>>> seq = ComplexSequence([1, 1j, -1, -1j])
>>> seq.autocorrelation(shifts=[-2, -1, 0, 1, 2])
array([-2.+0.j, 0.-3.j, 4.+0.j, 0.+3.j, -2.+0.j])
cyclic_autocorrelation
Returns the cyclic autocorrelation $\tilde{R}[\ell]$ of the complex sequence. See komm.cyclic_autocorrelation
for more details.
Parameters:
-
shifts
(Optional[Array1D[int]]
) –See
komm.cyclic_autocorrelation
. The default value yields $[0 : L)$. -
normalized
(Optional[bool]
) –See
komm.cyclic_autocorrelation
. The default value isFalse
.
Returns:
-
cyclic_autocorrelation
(Array1D[complex]
) –The cyclic autocorrelation $\tilde{R}[\ell]$ of the complex sequence.
Examples:
>>> seq = ComplexSequence([1, 1j, -1, -1j])
>>> seq.cyclic_autocorrelation(shifts=[-2, -1, 0, 1, 2])
array([-4.+0.j, 0.-4.j, 4.+0.j, 0.+4.j, -4.+0.j])