mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-07-31 00:39:17 +02:00
this is better than the powf func
This commit is contained in:
+7
-3
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user