mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
a-EQ: DSP bugfix
Previously there were large spurious spikes in the signal when the bandwidth parameter was adjusted on a pure sine tone for the peaking circuits. This has been *greatly* reduced if not eliminated by fixing a typo in two of the equations.
This commit is contained in:
parent
c4a4857b87
commit
ca815acd61
1 changed files with 2 additions and 2 deletions
|
|
@ -270,12 +270,12 @@ activate(LV2_Handle instance)
|
||||||
static void linear_svf_set_peq(struct linear_svf *self, float gdb, float sample_rate, float cutoff, float bandwidth)
|
static void linear_svf_set_peq(struct linear_svf *self, float gdb, float sample_rate, float cutoff, float bandwidth)
|
||||||
{
|
{
|
||||||
double f0 = (double)cutoff;
|
double f0 = (double)cutoff;
|
||||||
double q = (double)pow(2.0, 1.0 / bandwidth) / (pow(2.0, bandwidth) - 1.0);
|
double q = (double)pow(2.0, 0.5 * bandwidth) / (pow(2.0, bandwidth) - 1.0);
|
||||||
double sr = (double)sample_rate;
|
double sr = (double)sample_rate;
|
||||||
double A = pow(10.0, gdb/40.0);
|
double A = pow(10.0, gdb/40.0);
|
||||||
|
|
||||||
self->g = tan(M_PI * (f0 / sr));
|
self->g = tan(M_PI * (f0 / sr));
|
||||||
self->k = 1.0 / (q * A);
|
self->k = 1.0 / q;
|
||||||
|
|
||||||
self->a[0] = 1.0 / (1.0 + self->g * (self->g + self->k));
|
self->a[0] = 1.0 / (1.0 + self->g * (self->g + self->k));
|
||||||
self->a[1] = self->g * self->a[0];
|
self->a[1] = self->g * self->a[0];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue