summaryrefslogtreecommitdiff
path: root/log-fourier.hpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-18 23:02:43 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-18 23:02:43 -0300
commite4ab12ce914b2471355a99943b58c5b274d8754c (patch)
treece730c80936dba6ed4ac82e210cd5b7faddbc258 /log-fourier.hpp
parent92bd43e33e79a7d682267d3f6054e8b1dd9d00db (diff)
downloadcode-e4ab12ce914b2471355a99943b58c5b274d8754c.tar.gz
code-e4ab12ce914b2471355a99943b58c5b274d8754c.tar.bz2
code-e4ab12ce914b2471355a99943b58c5b274d8754c.zip
Refactor
Diffstat (limited to 'log-fourier.hpp')
-rw-r--r--log-fourier.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/log-fourier.hpp b/log-fourier.hpp
new file mode 100644
index 0000000..f57c6bc
--- /dev/null
+++ b/log-fourier.hpp
@@ -0,0 +1,33 @@
+#pragma once
+#include "types.hpp"
+
+#include <cmath>
+#include <fftw3.h>
+#include <vector>
+#include <gsl/gsl_sf_gamma.h>
+
+class LogarithmicFourierTransform {
+private:
+ Complex* a;
+ Complex* â;
+ fftw_plan a_to_â;
+ fftw_plan â_to_a;
+ unsigned N;
+ unsigned pad;
+ Real k;
+ Real Δτ;
+ Real τₛ;
+ Real ωₛ;
+ Real sₛ;
+public:
+ LogarithmicFourierTransform(unsigned N, Real k, Real Δτ, unsigned pad = 4);
+ ~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<Real> inverse(const std::vector<Complex>& ĉ);
+};
+