From 1c868c8740c499fd0e861d9aa5b5733b263be030 Mon Sep 17 00:00:00 2001 From: Damien Zammit Date: Wed, 14 Oct 2015 23:56:34 +1100 Subject: More accurate 1/3rd octave band filters Signed-off-by: Damien Zammit --- plugins/ZamGEQ31/ZamGEQ31Plugin.cpp | 14 ++++++++++---- plugins/ZamGEQ31/ZamGEQ31Plugin.hpp | 4 ++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/ZamGEQ31/ZamGEQ31Plugin.cpp b/plugins/ZamGEQ31/ZamGEQ31Plugin.cpp index 06870a5..ce22f28 100644 --- a/plugins/ZamGEQ31/ZamGEQ31Plugin.cpp +++ b/plugins/ZamGEQ31/ZamGEQ31Plugin.cpp @@ -519,10 +519,16 @@ void ZamGEQ31Plugin::geq(int i, float srate, float g) { int mm; float w, omegaB, omegaM, glinear, alpham; - const int stack[29] = { 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 3 }; + // 2dB tolerance + //const int stack[29] = { 2, 1, 1, 1, 1, 1, 1, 1, + // 1, 1, 1, 1, 1, 1, 1, 1, + // 1, 1, 1, 1, 1, 1, 1, 1, + // 1, 1, 1, 2, 3 }; + + const int stack[29] = { 16, 14, 10, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 10, 14, 16 }; w = 2. * M_PI / srate; omegaB = w * (omegaU[i] - omegaL[i]); diff --git a/plugins/ZamGEQ31/ZamGEQ31Plugin.hpp b/plugins/ZamGEQ31/ZamGEQ31Plugin.hpp index 1ad2735..239873d 100644 --- a/plugins/ZamGEQ31/ZamGEQ31Plugin.hpp +++ b/plugins/ZamGEQ31/ZamGEQ31Plugin.hpp @@ -138,9 +138,9 @@ protected: void geq(int i, float srate, float g); double run_filter(int i, double in); - double omegaL[29], omegaU[29], k[29], v[29], a[29], cm[29][6], a0m[29][6]; + double omegaL[29], omegaU[29], k[29], v[29], a[29], cm[29][17], a0m[29][17]; int m[29]; - double w11[29][6], w12[29][6], w21[29][6], w22[29][6]; + double w11[29][17], w12[29][17], w21[29][17], w22[29][17]; // ------------------------------------------------------------------- private: -- cgit v1.2.3