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

change logic again

This commit is contained in:
2025-03-29 22:21:44 +01:00
parent b60ca005cb
commit 59a8359909

View File

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