0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00
This commit is contained in:
2025-03-29 20:10:54 +01:00
parent 61d0d7eb83
commit b404e80e39
2 changed files with 5 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
#include "bs412.h"
void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
mpx->i = 0;
mpx->i = 1;
mpx->sample = 0;
mpx->sample_rate = sample_rate;
}
@@ -9,11 +9,11 @@ void init_modulation_power_measure(MPXPowerMeasurement* mpx, int sample_rate) {
float measure_mpx(MPXPowerMeasurement* mpx, int deviation) {
mpx->sample += 10*log10f(deviation/19000.0f);
float modulation_power = mpx->sample/(mpx->i++);
float modulation_power = mpx->sample/mpx->i;
if (mpx->i >= mpx->sample_rate*60) {
mpx->sample = 0;
mpx->i = 0;
mpx->i = 1;
}
return modulation_power;
}

View File

@@ -515,10 +515,10 @@ int main(int argc, char **argv) {
}
}
if(rds_on && polar_stereo == 0) {
float rds_carrier = get_oscillator_sin_multiplier_ni(&osc, 12);
float rds_carrier = get_oscillator_cos_multiplier_ni(&osc, 12);
output[i] += (current_rds_in*rds_carrier)*RDS_VOLUME;
if(!sca_on) {
float rds2_carrier_66 = get_oscillator_sin_multiplier_ni(&osc, 14);
float rds2_carrier_66 = get_oscillator_cos_multiplier_ni(&osc, 14);
output[i] += (current_rds2_in*rds2_carrier_66)*RDS2_VOLUME;
}
}