mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-07-30 08:49:15 +02:00
pragma once, maybe reduces size?
This commit is contained in:
+3
-6
@@ -29,9 +29,7 @@ void cleanup_rds_modulator(RDSModulator* rdsMod) {
|
||||
}
|
||||
|
||||
float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
|
||||
if (stream >= rdsMod->num_streams) {
|
||||
return 0.0f;
|
||||
}
|
||||
if (stream >= rdsMod->num_streams) return 0.0f;
|
||||
|
||||
rdsMod->data[stream].phase += 1187.5 / RDS_SAMPLE_RATE;
|
||||
|
||||
@@ -48,8 +46,7 @@ float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
|
||||
}
|
||||
|
||||
float sample = sinf(M_2PI * rdsMod->data[stream].phase + rdsMod->data[stream].symbol_shift);
|
||||
if(rdsMod->data[stream].cur_output == 0) sample = -sample; // do bpsk
|
||||
if(rdsMod->data[stream].cur_output == 0) sample = -sample; // do bpsk, if you comment this part out, nothing will be decoded
|
||||
|
||||
uint8_t tooutput = rdsMod->params.rdsgen > stream ? 1 : 0;
|
||||
return sample*rdsMod->params.level*tooutput;
|
||||
return sample*rdsMod->params.level*(rdsMod->params.rdsgen > stream ? 1 : 0);
|
||||
}
|
||||
Reference in New Issue
Block a user