autocorr
-
constexpr std::vector<Complex> autocorr(const std::vector<Complex> &X) noexcept
Performs the discrete auto-correlation operation [1] on a compelx sequence.
Parameters
Returns
- std::vector<Complex>
A complex sequence.
The discrete auto-correlation operation simply performs the cross-correlation using a single sequence \(X\) for both arguments.
Example
std::vector<Complex> X = {1, 2, 3, 4, 5};
std::vector<Complex> Z = autocorr(X);
for(int i = 0; i < Z.size(); i++){
std::cout << Z[i] << "\n";
}
Output:
5 - 9.86865e-15j
14 - 2.11467e-14j
26 - 3.04381e-14j
40 - 3.16419e-14j
55 - 1.323e-14j
40 - 1.64226e-14j
26 + 8.21365e-15j
14 + 1.71718e-14j
5 + 1.86516e-15j
References