summaryrefslogtreecommitdiff
path: root/fourier.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-17 17:45:26 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-17 17:45:26 -0300
commit7bd8f97aea0545c3d0da438cde3fd3d7ba4083b4 (patch)
treeaff1be03708d1a4e7461b3ff900488f74f45aab9 /fourier.hpp
parentfc7d01ebfb5682df2fbbd6c668cce1569e0d9df5 (diff)
downloadcode-7bd8f97aea0545c3d0da438cde3fd3d7ba4083b4.tar.gz
code-7bd8f97aea0545c3d0da438cde3fd3d7ba4083b4.tar.bz2
code-7bd8f97aea0545c3d0da438cde3fd3d7ba4083b4.zip
Started implementing log-Fourier method, not working right now.
Diffstat (limited to 'fourier.hpp')
-rw-r--r--fourier.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/fourier.hpp b/fourier.hpp
index 791953b..22a57e7 100644
--- a/fourier.hpp
+++ b/fourier.hpp
@@ -4,6 +4,7 @@
#include <complex>
#include <vector>
#include <tuple>
+#include <gsl/gsl_sf_gamma.h>
#ifndef FFTW_THREADS
#define FFTW_THREADS 1
@@ -36,6 +37,37 @@ public:
std::vector<Real> convolve(const std::vector<Real>& Γh, const std::vector<Real>& 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<Complex> fourier(const std::vector<Real>& c, bool symmetric);
+ std::vector<Complex> fourier();
+ std::vector<Real> inverse(const std::vector<Complex>& ĉ);
+ void writeToA(unsigned i, Real ai);
+ std::vector<Real> convolve(const std::vector<Real>& Γh, const std::vector<Real>& 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<Real>& C, const std::vector<Real>& R, unsigned p, unsigned s, Real λ, Real y, Real Δτ);
std::tuple<std::vector<Complex>, std::vector<Complex>> RddfCtdfCt(FourierTransform& fft, const std::vector<Real>& C, const std::vector<Real>& R, unsigned p, unsigned s, Real λ);