crosscorr
-
constexpr Complex crosscorr(Complex (*f)(Complex), Complex (*g)(Complex), const Complex &z) noexcept
Performs the cross-correlation operation [1] on two complex functions.
Parameters
Returns
- type Complex
A complex number.
The cross-correlation operation performs the following integral transform on two functions \(f\) and \(g\):
\[\newcommand{\compconj}[1]{%
\overline{#1}%
}
(f \star g)(t) = \int_{-\infty}^{\infty}\compconj{f(\tau)}g(t + \tau)d\tau\]
Example
auto f = [](Complex t) { return exp(-t * t); };
auto g = [](Complex t) { return exp(-t * t); };
Complex z = 1;
std::cout << crosscorr(f, g, z) << "\n";
Output:
0.760276 + 0j
References