0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 11:22:00 +01:00

that was 9 db lol

This commit is contained in:
2026-01-24 11:08:29 +01:00
parent 1fd679c4fa
commit 64e3f36e34

View File

@@ -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++;