aboutsummaryrefslogtreecommitdiffstats
path: root/common/alcomplex.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-09-09 18:00:37 -0700
committerChris Robinson <[email protected]>2023-09-09 18:00:37 -0700
commit97830c3868e0ae1bc7f917f00ef3c7eca4d837b2 (patch)
treedda4c34b9de16bba2a68239fb27f274b1ee89460 /common/alcomplex.h
parent9a1352a9402c528d2925e0983e41016f0c04c921 (diff)
Improve the FFT bit reversal computation
This also allows to include 11-bit indices in the fast lookup table path, without exceeding GCC's internal limit of compile-time calculations.
Diffstat (limited to 'common/alcomplex.h')
-rw-r--r--common/alcomplex.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/common/alcomplex.h b/common/alcomplex.h
index 794c3526..042a3232 100644
--- a/common/alcomplex.h
+++ b/common/alcomplex.h
@@ -19,19 +19,17 @@ complex_fft(const al::span<std::complex<Real>> buffer, const al::type_identity_t
* Calculate the frequency-domain response of the time-domain signal in the
* provided buffer, which MUST BE power of two.
*/
-template<typename Real, size_t N>
-std::enable_if_t<std::is_floating_point<Real>::value>
-forward_fft(const al::span<std::complex<Real>,N> buffer)
-{ complex_fft(buffer.subspan(0), -1); }
+template<typename T, size_t N>
+void forward_fft(const al::span<T,N> buffer)
+{ complex_fft(al::span<T>{buffer}, -1); }
/**
* Calculate the time-domain signal of the frequency-domain response in the
* provided buffer, which MUST BE power of two.
*/
-template<typename Real, size_t N>
-std::enable_if_t<std::is_floating_point<Real>::value>
-inverse_fft(const al::span<std::complex<Real>,N> buffer)
-{ complex_fft(buffer.subspan(0), 1); }
+template<typename T, size_t N>
+void inverse_fft(const al::span<T,N> buffer)
+{ complex_fft(al::span<T>{buffer}, 1); }
/**
* Calculate the complex helical sequence (discrete-time analytical signal) of