hartley

constexpr Complex laplace(Complex (*f)(Complex), const Complex &z) noexcept

Performs the Hartley integral transform [1] of a complex function.

Parameters

Complex (*f)(Complex)

A complex function.

const Complex &z

A complex number.

Returns

type Complex

A complex number.

The Hartley transform performs the following integral transform on a function \(f\):

\[\DeclareMathOperator\cas{cas} H(\omega) = \{\mathcal{H}f\}(\omega) = \frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}f(t)\cas(\omega t)dt\]

where \(\DeclareMathOperator\cas{cas} \cas(t)\) is defined as:

\[\DeclareMathOperator\cas{cas} \cas(t) = \cos(t) + \sin(t)\]

Example

auto fn = [](Complex t) { return exp(-t * t); };


Complex z = 1;
std::cout << hartley(fn, z) << "\n";

Output:

0.550782 + 0j // True result: 0.550695 + 0j

References