kfr

Fast, modern C++ DSP framework, FFT, Sample Rate Conversion, FIR/IIR/Biquad Filters (SSE, AVX, AVX-512, ARM NEON)
Log | Files | Refs | README

commit bc2d7ecf2549c8899d01ef24f2b211f5d483584a
parent 6f44e6e38b6538223ed68f6535289a4837aae83d
Author: d.levin256@gmail.com <d.levin256@gmail.com>
Date:   Mon, 29 Aug 2016 04:39:56 +0300

Filter design functions shouldn't be inline

Diffstat:
Minclude/kfr/dsp/biquad_design.hpp | 16++++++++--------
Minclude/kfr/dsp/fir_design.hpp | 14++++++--------
2 files changed, 14 insertions(+), 16 deletions(-)

diff --git a/include/kfr/dsp/biquad_design.hpp b/include/kfr/dsp/biquad_design.hpp @@ -38,7 +38,7 @@ namespace kfr * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_allpass(identity<T> frequency, identity<T> Q) +biquad_params<T> biquad_allpass(identity<T> frequency, identity<T> Q) { const T alpha = std::sin(frequency) / 2.0 * Q; const T cs = std::cos(frequency); @@ -59,7 +59,7 @@ CMT_INLINE biquad_params<T> biquad_allpass(identity<T> frequency, identity<T> Q) * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_lowpass(identity<T> frequency, identity<T> Q) +biquad_params<T> biquad_lowpass(identity<T> frequency, identity<T> Q) { const T K = std::tan(c_pi<T, 1> * frequency); const T K2 = K * K; @@ -79,7 +79,7 @@ CMT_INLINE biquad_params<T> biquad_lowpass(identity<T> frequency, identity<T> Q) * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_highpass(identity<T> frequency, identity<T> Q) +biquad_params<T> biquad_highpass(identity<T> frequency, identity<T> Q) { const T K = std::tan(c_pi<T, 1> * frequency); const T K2 = K * K; @@ -99,7 +99,7 @@ CMT_INLINE biquad_params<T> biquad_highpass(identity<T> frequency, identity<T> Q * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_bandpass(identity<T> frequency, identity<T> Q) +biquad_params<T> biquad_bandpass(identity<T> frequency, identity<T> Q) { const T K = std::tan(c_pi<T, 1> * frequency); const T K2 = K * K; @@ -119,7 +119,7 @@ CMT_INLINE biquad_params<T> biquad_bandpass(identity<T> frequency, identity<T> Q * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_notch(identity<T> frequency, identity<T> Q) +biquad_params<T> biquad_notch(identity<T> frequency, identity<T> Q) { const T K = std::tan(c_pi<T, 1> * frequency); const T K2 = K * K; @@ -140,7 +140,7 @@ CMT_INLINE biquad_params<T> biquad_notch(identity<T> frequency, identity<T> Q) * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_peak(identity<T> frequency, identity<T> Q, identity<T> gain) +biquad_params<T> biquad_peak(identity<T> frequency, identity<T> Q, identity<T> gain) { biquad_params<T> result; const T K = std::tan(c_pi<T, 1> * frequency); @@ -177,7 +177,7 @@ CMT_INLINE biquad_params<T> biquad_peak(identity<T> frequency, identity<T> Q, id * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_lowshelf(identity<T> frequency, identity<T> gain) +biquad_params<T> biquad_lowshelf(identity<T> frequency, identity<T> gain) { biquad_params<T> result; const T K = std::tan(c_pi<T, 1> * frequency); @@ -214,7 +214,7 @@ CMT_INLINE biquad_params<T> biquad_lowshelf(identity<T> frequency, identity<T> g * @return Biquad filter coefficients */ template <typename T = fbase> -CMT_INLINE biquad_params<T> biquad_highshelf(identity<T> frequency, identity<T> gain) +biquad_params<T> biquad_highshelf(identity<T> frequency, identity<T> gain) { biquad_params<T> result; const T K = std::tan(c_pi<T, 1> * frequency); diff --git a/include/kfr/dsp/fir_design.hpp b/include/kfr/dsp/fir_design.hpp @@ -33,8 +33,7 @@ namespace kfr namespace intrinsics { template <typename T> -KFR_SINTRIN void fir_lowpass(univector_ref<T> taps, T cutoff, const expression_pointer<T>& window, - bool normalize = true) +void fir_lowpass(univector_ref<T> taps, T cutoff, const expression_pointer<T>& window, bool normalize = true) { const T scale = 2.0 * cutoff; taps = bind_expression(fn::sinc(), @@ -51,8 +50,7 @@ KFR_SINTRIN void fir_lowpass(univector_ref<T> taps, T cutoff, const expression_p } } template <typename T> -KFR_SINTRIN void fir_highpass(univector_ref<T> taps, T cutoff, const expression_pointer<T>& window, - bool normalize = true) +void fir_highpass(univector_ref<T> taps, T cutoff, const expression_pointer<T>& window, bool normalize = true) { const T scale = 2.0 * -cutoff; taps = bind_expression(fn::sinc(), @@ -70,8 +68,8 @@ KFR_SINTRIN void fir_highpass(univector_ref<T> taps, T cutoff, const expression_ } template <typename T> -KFR_SINTRIN void fir_bandpass(univector_ref<T> taps, T frequency1, T frequency2, - const expression_pointer<T>& window, bool normalize = true) +void fir_bandpass(univector_ref<T> taps, T frequency1, T frequency2, const expression_pointer<T>& window, + bool normalize = true) { const T scale1 = 2.0 * frequency1; const T scale2 = 2.0 * frequency2; @@ -94,8 +92,8 @@ KFR_SINTRIN void fir_bandpass(univector_ref<T> taps, T frequency1, T frequency2, } template <typename T> -KFR_SINTRIN void fir_bandstop(univector_ref<T> taps, T frequency1, T frequency2, - const expression_pointer<T>& window, bool normalize = true) +void fir_bandstop(univector_ref<T> taps, T frequency1, T frequency2, const expression_pointer<T>& window, + bool normalize = true) { const T scale1 = 2.0 * frequency1; const T scale2 = 2.0 * frequency2;