diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-20 00:32:46 -0300 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2025-04-20 00:32:46 -0300 |
commit | 48e3caa0152e0606ce10157b9bd61431117baae6 (patch) | |
tree | d86a9dce6790bf29fa5b23c7d1f8221547ad8600 /log-fourier.cpp | |
parent | 70101b6e893f2260216a8e5a1ea41ec22d118110 (diff) | |
download | code-48e3caa0152e0606ce10157b9bd61431117baae6.tar.gz code-48e3caa0152e0606ce10157b9bd61431117baae6.tar.bz2 code-48e3caa0152e0606ce10157b9bd61431117baae6.zip |
Fixed serious mistake in log inverse transform
Diffstat (limited to 'log-fourier.cpp')
-rw-r--r-- | log-fourier.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/log-fourier.cpp b/log-fourier.cpp index 3ffa3c6..7461a70 100644 --- a/log-fourier.cpp +++ b/log-fourier.cpp @@ -1,4 +1,5 @@ #include "log-fourier.hpp" +#include <complex> LogarithmicFourierTransform::LogarithmicFourierTransform(unsigned N, Real k, Real Δτ, unsigned pad) : N(N), pad(pad), k(k), Δτ(Δτ) { τₛ = -0.5 * N; @@ -83,7 +84,11 @@ std::vector<Real> LogarithmicFourierTransform::inverse(const std::vector<Complex for (Real σ : σs) { for (unsigned n = 0; n < pad * N; n++) { if (n < N) { - a[n] = ĉ[n] * exp((1 - k) * ω(n)); + if (σ < 0) { + a[n] = std::conj(ĉ[n]) * exp((1 - k) * ω(n)); + } else { + a[n] = ĉ[n] * exp((1 - k) * ω(n)); + } } else { a[n] = 0; } |