0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 11:22:00 +01:00
This commit is contained in:
2025-03-29 19:12:23 +01:00
parent 9e9075d27d
commit 3fc39b2df9
2 changed files with 4 additions and 9 deletions

View File

@@ -9,15 +9,10 @@ void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
float measure_mpx(MPXPowerMeasurement* mpx, int deviation) {
mpx->sample += 20*log10f(deviation/19000.0f);
mpx->i++;
float modulation_power = mpx->sample/mpx->i;
if (mpx->i >= mpx->sample_rate) {
float modulation_power = mpx->sample/mpx->i;
mpx->sample = 0.0f;
mpx->i = 0;
return modulation_power;
} else {
return -9999.0f;
}
}
return modulation_power;
}

View File

@@ -517,7 +517,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;
float mpower = measure_mpx(&power, output[i]*75000);
if(mpower != 9999.0f) {
if(mpower > 3) {
printf("MPX Power (%f)\n", mpower);
}