aboutsummaryrefslogtreecommitdiffstats
path: root/alc/filters
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-09 20:09:47 -0700
committerChris Robinson <[email protected]>2019-08-10 14:41:55 -0700
commit98029d64b96c2f5edc5dc1e290fa4d30a1338bb4 (patch)
tree20af999604ece4f66564a129484a8606931e7c69 /alc/filters
parent8f93656f5301b0db1bda15b4c79397f322cf18fe (diff)
Fix and clarify the peaking biquad filter
Diffstat (limited to 'alc/filters')
-rw-r--r--alc/filters/biquad.cpp1
-rw-r--r--alc/filters/biquad.h9
2 files changed, 5 insertions, 5 deletions
diff --git a/alc/filters/biquad.cpp b/alc/filters/biquad.cpp
index 6a3cef64..871c4af4 100644
--- a/alc/filters/biquad.cpp
+++ b/alc/filters/biquad.cpp
@@ -47,7 +47,6 @@ void BiquadFilterR<Real>::setParams(BiquadType type, Real gain, Real f0norm, Rea
a[2] = (gain+1.0f) + (gain-1.0f)*cos_w0 - sqrtgain_alpha_2;
break;
case BiquadType::Peaking:
- gain = std::sqrt(gain);
b[0] = 1.0f + alpha * gain;
b[1] = -2.0f * cos_w0;
b[2] = 1.0f - alpha * gain;
diff --git a/alc/filters/biquad.h b/alc/filters/biquad.h
index 893a69a9..f8d7f0ba 100644
--- a/alc/filters/biquad.h
+++ b/alc/filters/biquad.h
@@ -11,10 +11,11 @@
* EQ biquad filter coefficients" by Robert Bristow-Johnson
* http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
*/
-/* Implementation note: For the shelf filters, the specified gain is for the
- * reference frequency, which is the centerpoint of the transition band. This
- * better matches EFX filter design. To set the gain for the shelf itself, use
- * the square root of the desired linear gain (or halve the dB gain).
+/* Implementation note: For the shelf and peaking filters, the specified gain
+ * is for the centerpoint of the transition band. This better fits EFX filter
+ * behavior, which expects the shelf's reference frequency to reach the given
+ * gain. To set the gain for the shelf or peak itself, use the square root of
+ * the desired linear gain (or halve the dB gain).
*/
enum class BiquadType {