0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00

reduce sampling rate

This commit is contained in:
2025-04-28 18:41:58 +02:00
parent 6e1a52cacb
commit 0e877bccc1
5 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
PLOT = True
FFT = PLOT and True
PLOT = False
FFT = PLOT and False
import math
import io, os
@@ -9,7 +9,7 @@ if FFT: import numpy as np
DATA_RATE = 1187.5
SIZE_RATIO = 1
ratio = 16
ratio = 4
sample_rate = DATA_RATE*ratio
print(f"{sample_rate=}")
if not sample_rate.is_integer(): raise ValueError("Need a even value")

View File

@@ -146,5 +146,5 @@ float get_rds_sample(RDSModulator* rdsMod, uint8_t stream) {
if (rdsMod->data[stream].out_sample_index == SAMPLE_BUFFER_SIZE) rdsMod->data[stream].out_sample_index = 0;
uint8_t tooutput = rdsMod->params.rdsgen > stream ? 1 : 0;
return sample*rdsMod->params.level*tooutput;
return sample*rdsMod->params.level*tooutput / 3.5; // 3.5 volts from piracz
}

View File

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

View File

@@ -6,5 +6,5 @@
Released under the GNU GPL v3 license.
*/
float waveform_biphase[16] = {0.0, 0.3826834323650898, 0.7071067811865475, 0.9238795325112867, 1.0, 0.9238795325112867, 0.7071067811865476, 0.3826834323650899, 1.2246467991473532e-16, -0.3826834323650892, -0.7071067811865475, -0.9238795325112868, -1.0, -0.923879532511287, -0.7071067811865477, -0.3826834323650904};
float waveform_biphase[4] = {0.0, 1.0, 1.2246467991473532e-16, -1.0};

View File

@@ -6,4 +6,4 @@
Released under the GNU GPL v3 license.
*/
extern float waveform_biphase[16];
extern float waveform_biphase[4];