From 59a8359909230819fb50f20fe7dca82cd81c3a8f Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Sat, 29 Mar 2025 22:21:44 +0100 Subject: [PATCH] change logic again --- src/fm95.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fm95.c b/src/fm95.c index cf8d5c3..40e9a4c 100644 --- a/src/fm95.c +++ b/src/fm95.c @@ -526,9 +526,9 @@ int main(int argc, char **argv) { if(sca_on) output[i] += modulate_fm(&sca_mod, hard_clip(current_sca_in, sca_clipper_threshold))*SCA_VOLUME; float mpower = measure_mpx(&power, output[i] * 75000); - if (fabsf(mpower) > mpx_power) { + if (mpower > mpx_power) { float excess = mpower - mpx_power; - float attenuation_db = excess * 0.5f; + float attenuation_db = excess * 0.75f; float attenuation_linear = dbr_to_deviation(attenuation_db)/75000; output[i] *= attenuation_linear; printf("Overpower! %f*%f/%f\n", mpower, attenuation_linear, mpx_power);