diff --git a/filter/bs412.c b/filter/bs412.c index 0bdc794..a612772 100644 --- a/filter/bs412.c +++ b/filter/bs412.c @@ -73,7 +73,7 @@ float bs412_compress(BS412Compressor* mpx, float sample) { mpx->gain = mpx->release * mpx->gain + (1.0f - mpx->release) * target_gain; } - mpx->gain = fmaxf(0.0f, fminf(sqrtf(2)*2.0f, mpx->gain)); + mpx->gain = fmaxf(0.0f, fminf(2.0f, mpx->gain)); float output_sample = sample * mpx->gain; if(deviation_to_dbr(avg_deviation * mpx->gain) > mpx->target && deviation_to_dbr(avg_deviation) < mpx->target) { @@ -81,7 +81,7 @@ float bs412_compress(BS412Compressor* mpx, float sample) { float overshoot_dbr = deviation_to_dbr(avg_deviation * mpx->gain) - mpx->target; float reduction_factor = powf(10.0f, -overshoot_dbr / 10.0f); mpx->gain *= reduction_factor; - mpx->gain = fmaxf(0.0f, fminf(sqrtf(2)*2.0f, mpx->gain)); + mpx->gain = fmaxf(0.0f, fminf(2.0f, mpx->gain)); } mpx->sample_counter++;