From 7bd8f97aea0545c3d0da438cde3fd3d7ba4083b4 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 17 Apr 2025 17:45:26 -0300 Subject: Started implementing log-Fourier method, not working right now. --- fourier.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'fourier.hpp') diff --git a/fourier.hpp b/fourier.hpp index 791953b..22a57e7 100644 --- a/fourier.hpp +++ b/fourier.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #ifndef FFTW_THREADS #define FFTW_THREADS 1 @@ -36,6 +37,37 @@ public: std::vector convolve(const std::vector& Γh, const std::vector& R); }; +class LogarithmicFourierTransform { +private: + Complex* a; + Complex* â; + fftw_plan a_to_â; + fftw_plan â_to_a; + unsigned N; + Real k; + Real Δτ; + Real Δω; + Real Δs; + Real τₛ; + Real ωₛ; + Real sₛ; +public: + LogarithmicFourierTransform(unsigned N, Real k, Real Δω, Real Δτ, Real Δs); + ~LogarithmicFourierTransform(); + Real τ(unsigned n) const; + Real ω(unsigned n) const; + Real t(unsigned n) const; + Real ν(unsigned n) const; + Real s(unsigned n) const; + std::vector fourier(const std::vector& c, bool symmetric); + std::vector fourier(); + std::vector inverse(const std::vector& ĉ); + void writeToA(unsigned i, Real ai); + std::vector convolve(const std::vector& Γh, const std::vector& R); +}; + +Complex gamma(Complex z); + std::string fourierFile(std::string prefix, unsigned p, unsigned s, Real λ, Real τ₀, Real y, unsigned log2n, Real τₘₐₓ); Real energy(const std::vector& C, const std::vector& R, unsigned p, unsigned s, Real λ, Real y, Real Δτ); std::tuple, std::vector> RddfCtdfCt(FourierTransform& fft, const std::vector& C, const std::vector& R, unsigned p, unsigned s, Real λ); -- cgit v1.2.3-70-g09d2