0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-27 04:43:52 +01:00
This commit is contained in:
2025-05-01 14:05:14 +02:00
parent 02818f9d22
commit 70f61bfd83
5 changed files with 8 additions and 35 deletions

View File

@@ -90,7 +90,7 @@ void init_rds_modulator(RDSModulator* rdsMod, RDSEncoder* enc) {
rdsMod->enc = enc;
if(STREAMS > 0) rdsMod->data[1].symbol_shifting.symbol_shift = SAMPLES_PER_BIT / 2;
if(STREAMS > 0) rdsMod->data[1].symbol_shifting.symbol_shift = FILTER_SIZE / 2;
for (uint8_t i = 0; i < 2; i++) {
for (uint16_t j = 0; j < FILTER_SIZE; j++) {
@@ -108,7 +108,7 @@ void init_rds_modulator(RDSModulator* rdsMod, RDSEncoder* enc) {
float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
float *cur_waveform;
if (rdsMod->data[stream].sample_count == SAMPLES_PER_BIT) {
if (rdsMod->data[stream].sample_count == FILTER_SIZE) {
if (rdsMod->data[stream].bit_pos == BITS_PER_GROUP) {
get_rds_bits(rdsMod->enc, rdsMod->data[stream].bit_buffer, stream);
rdsMod->data[stream].bit_pos = 0;
@@ -126,7 +126,7 @@ float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
if (idx == SAMPLE_BUFFER_SIZE) idx = 0;
}
rdsMod->data[stream].in_sample_index += SAMPLES_PER_BIT;
rdsMod->data[stream].in_sample_index += FILTER_SIZE;
if (rdsMod->data[stream].in_sample_index == SAMPLE_BUFFER_SIZE) rdsMod->data[stream].in_sample_index = 0;
rdsMod->data[stream].sample_count = 0;

View File

@@ -11,9 +11,8 @@
#define GROUP_LENGTH 4
#define BITS_PER_GROUP (GROUP_LENGTH * (BLOCK_SIZE + POLY_DEG))
#define RDS_SAMPLE_RATE 4750
#define SAMPLES_PER_BIT 4
#define FILTER_SIZE 4
#define SAMPLE_BUFFER_SIZE (SAMPLES_PER_BIT + FILTER_SIZE)
#define SAMPLE_BUFFER_SIZE (FILTER_SIZE*2)
#define STREAMS 2

View File

@@ -94,8 +94,8 @@ int main(int argc, char **argv) {
format.rate = RDS_SAMPLE_RATE;
buffer.prebuf = 0;
buffer.tlength = NUM_MPX_FRAMES*4;
buffer.maxlength = NUM_MPX_FRAMES*4;
buffer.tlength = NUM_MPX_FRAMES*2;
buffer.maxlength = NUM_MPX_FRAMES*2;
rds_device = pa_simple_new(
NULL,