0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00

change logic a bit

This commit is contained in:
2025-03-29 22:20:42 +01:00
parent 53b974be94
commit b60ca005cb

View File

@@ -526,7 +526,7 @@ 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; 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); float mpower = measure_mpx(&power, output[i] * 75000);
if (mpower > mpx_power) { if (fabsf(mpower) > mpx_power) {
float excess = mpower - mpx_power; float excess = mpower - mpx_power;
float attenuation_db = excess * 0.5f; float attenuation_db = excess * 0.5f;
float attenuation_linear = dbr_to_deviation(attenuation_db)/75000; float attenuation_linear = dbr_to_deviation(attenuation_db)/75000;