diff options
author | Chris Robinson <[email protected]> | 2019-12-25 17:09:14 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-12-25 17:09:14 -0800 |
commit | 0897927419a8b59e9481c20495831c773c1bbf92 (patch) | |
tree | 027c3a70de263042d1e59e24669852e4515f760f /alc | |
parent | de2c64c06f256323dad457a353fd396f01ef1f21 (diff) |
Make a couple more functions private
Diffstat (limited to 'alc')
-rw-r--r-- | alc/filters/biquad.h | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/alc/filters/biquad.h b/alc/filters/biquad.h index d7a195a9..402c76b2 100644 --- a/alc/filters/biquad.h +++ b/alc/filters/biquad.h @@ -47,6 +47,27 @@ class BiquadFilterR { void setParams(BiquadType type, Real f0norm, Real gain, Real rcpQ); + /** + * Calculates the rcpQ (i.e. 1/Q) coefficient for shelving filters, using + * the reference gain and shelf slope parameter. + * \param gain 0 < gain + * \param slope 0 < slope <= 1 + */ + static Real rcpQFromSlope(Real gain, Real slope) + { return std::sqrt((gain + 1.0f/gain)*(1.0f/slope - 1.0f) + 2.0f); } + + /** + * Calculates the rcpQ (i.e. 1/Q) coefficient for filters, using the + * normalized reference frequency and bandwidth. + * \param f0norm 0 < f0norm < 0.5. + * \param bandwidth 0 < bandwidth + */ + static Real rcpQFromBandwidth(Real f0norm, Real bandwidth) + { + const Real w0{al::MathDefs<Real>::Tau() * f0norm}; + return 2.0f*std::sinh(std::log(Real{2.0f})/2.0f*bandwidth*w0/std::sin(w0)); + } + public: void clear() noexcept { mZ1 = mZ2 = 0.0f; } @@ -105,27 +126,6 @@ public: z2 = in*mB2 - out*mA2; return out; } - - /** - * Calculates the rcpQ (i.e. 1/Q) coefficient for shelving filters, using - * the reference gain and shelf slope parameter. - * \param gain 0 < gain - * \param slope 0 < slope <= 1 - */ - static Real rcpQFromSlope(Real gain, Real slope) - { return std::sqrt((gain + 1.0f/gain)*(1.0f/slope - 1.0f) + 2.0f); } - - /** - * Calculates the rcpQ (i.e. 1/Q) coefficient for filters, using the - * normalized reference frequency and bandwidth. - * \param f0norm 0 < f0norm < 0.5. - * \param bandwidth 0 < bandwidth - */ - static Real rcpQFromBandwidth(Real f0norm, Real bandwidth) - { - const Real w0{al::MathDefs<Real>::Tau() * f0norm}; - return 2.0f*std::sinh(std::log(Real{2.0f})/2.0f*bandwidth*w0/std::sin(w0)); - } }; using BiquadFilter = BiquadFilterR<float>; |