// // C++ Interface: eq // // Description: // // // Author: reduzio@gmail.com (C) 2006 // // Copyright: See COPYING file that comes with this distribution // // #include "eq.h" #include #include "error_macros.h" #include "math_funcs.h" #define POW2(v) ((v)*(v)) /* Helper */ static int solve_quadratic(double a,double b,double c,double *r1, double *r2) { //solves quadractic and returns number of roots double base=2*a; if (base == 0.0f) return 0; double squared=b*b-4*a*c; if (squared<0.0) return 0; squared=sqrt(squared); *r1=(-b+squared)/base; *r2=(-b-squared)/base; if (*r1==*r2) return 1; else return 2; } EQ::BandProcess::BandProcess() { c1=c2=c3=history.a1=history.a2=history.a3=0; history.b1=history.b2=history.b3=0; } void EQ::recalculate_band_coefficients() { #define BAND_LOG( m_f ) ( log((m_f)) / log(2.) ) for (int i=0;i& p_bands) { band.resize(p_bands.size()); for (int i=0;i