ESP-DSP Biquad peak gain
Posted: Sat Nov 11, 2023 9:11 pm
I'm using ESP-DSP to process audio and I wanted to add Peaking EQ, but I can't understand why there is no gain parameter ?
If I understand the current implementation, the gain is fixed to 1.
I would have like to write my own implementation based on the current one but I do not understand how the coefficients are calculated ?
In the lib there is:
But with my limited knowledge of digital filters, I would have thought that the coefficients should have been:
And with gain:
Am I missing something ? How do I apply gain to a peak EQ in ESP-DSP implemetation ?
Code: Select all
esp_err_t dsps_biquad_gen_peakingEQ_f32(float *coeffs, float f, float qFactor);
I would have like to write my own implementation based on the current one but I do not understand how the coefficients are calculated ?
In the lib there is:
Code: Select all
float b0 = alpha;
float b1 = 0;
float b2 = -alpha;
float a0 = 1 + alpha;
float a1 = -2 * c;
float a2 = 1 - alpha;
Code: Select all
float b0 = 1 + alpha;
float b1 = -2 * c;
float b2 = 1 - alpha;
float a0 = 1 + alpha;
float a1 = -2 * c;
float a2 = 1 - alpha;
Code: Select all
float A = sqrtf(pow(10, (double)gain / 20.0));
float b0 = 1 + alpha * A;
float b1 = -2 * c;
float b2 = 1 - alpha * A;
float a0 = 1 + alpha / A;
float a1 = -2 * c;
float a2 = 1 - alpha / A;