this is better than the powf func

This commit is contained in:
2025-07-10 19:23:40 +02:00
parent 7abf177b5f
commit db60762057
+7 -3
View File
@@ -229,10 +229,14 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
mpx = stereo_encode(&stencode, config.stereo, l, r);
if(rds_on && !(config.stereo == 2)) { // disable rds on polar stereo
float rds_level = config.volumes.rds;
for(uint8_t stream = 0; stream < config.rds_streams; stream++) {
uint8_t osc_stream = 12+stream; // If the osc is a 4750 sine wave, then doing this would mean that stream 0 is 12, so 57 khz
if(osc_stream == 13) osc_stream++; // 61.75 KHz is not used, idk why but would be cool if it was
mpx += (rds_in[config.rds_streams*i+stream]*get_oscillator_cos_multiplier_ni(&osc, osc_stream)) * (config.volumes.rds * powf(config.volumes.rds_step, stream));
uint8_t osc_stream = 12 + stream;
if(osc_stream == 13) osc_stream++;
mpx += (rds_in[config.rds_streams * i + stream] * get_oscillator_cos_multiplier_ni(&osc, osc_stream)) * rds_level;
rds_level *= config.volumes.rds_step; // Prepare level for the next stream
}
}