From 0974b6b47c55b58989dde329160474ac0d58140a Mon Sep 17 00:00:00 2001
From: Chris Robinson <chris.kcat@gmail.com>
Date: Sun, 13 Sep 2020 04:18:40 -0700
Subject: Use inline wrappers to clarify forward/inverse FFTs

---
 common/alcomplex.h | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

(limited to 'common/alcomplex.h')

diff --git a/common/alcomplex.h b/common/alcomplex.h
index 12b86436..23b8114a 100644
--- a/common/alcomplex.h
+++ b/common/alcomplex.h
@@ -7,12 +7,25 @@
 
 /**
  * Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
- * FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier
- * Transform (DFT) of the time domain data stored in the buffer. The buffer is
- * an array of complex numbers, and MUST BE power of two.
+ * FFT and 1 is inverse FFT. Applies the Discrete Fourier Transform (DFT) to
+ * the data supplied in the buffer, which MUST BE power of two.
  */
 void complex_fft(const al::span<std::complex<double>> buffer, const double sign);
 
+/**
+ * Calculate the frequency-domain response of the time-domain signal in the
+ * provided buffer, which MUST BE power of two.
+ */
+inline void forward_fft(const al::span<std::complex<double>> buffer)
+{ complex_fft(buffer, -1.0); }
+
+/**
+ * Calculate the time-domain signal of the frequency-domain response in the
+ * provided buffer, which MUST BE power of two.
+ */
+inline void inverse_fft(const al::span<std::complex<double>> buffer)
+{ complex_fft(buffer, 1.0); }
+
 /**
  * Calculate the complex helical sequence (discrete-time analytical signal) of
  * the given input using the discrete Hilbert transform (In-place algorithm).
-- 
cgit v1.2.3