diff options
Diffstat (limited to 'Alc/filters/splitter.h')
-rw-r--r-- | Alc/filters/splitter.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Alc/filters/splitter.h b/Alc/filters/splitter.h index b39c3491..e1122577 100644 --- a/Alc/filters/splitter.h +++ b/Alc/filters/splitter.h @@ -6,30 +6,34 @@ /* Band splitter. Splits a signal into two phase-matching frequency bands. */ -class BandSplitter { - float coeff{0.0f}; - float lp_z1{0.0f}; - float lp_z2{0.0f}; - float ap_z1{0.0f}; +template<typename Real> +class BandSplitterR { + Real coeff{0.0f}; + Real lp_z1{0.0f}; + Real lp_z2{0.0f}; + Real ap_z1{0.0f}; public: - void init(float f0norm); + void init(Real f0norm); void clear() noexcept { lp_z1 = lp_z2 = ap_z1 = 0.0f; } - void process(float *RESTRICT hpout, float *RESTRICT lpout, const float *input, int count); + void process(Real *RESTRICT hpout, Real *RESTRICT lpout, const Real *input, int count); }; +using BandSplitter = BandSplitterR<float>; /* The all-pass portion of the band splitter. Applies the same phase shift * without splitting the signal. */ -class SplitterAllpass { - float coeff{0.0f}; - float z1{0.0f}; +template<typename Real> +class SplitterAllpassR { + Real coeff{0.0f}; + Real z1{0.0f}; public: - void init(float f0norm); + void init(Real f0norm); void clear() noexcept { z1 = 0.0f; } - void process(float *RESTRICT samples, int count); + void process(Real *RESTRICT samples, int count); }; +using SplitterAllpass = SplitterAllpassR<float>; struct FrontStablizer { |