From 4e7b161e42a9bff3e044fce619c8c219cdd151c6 Mon Sep 17 00:00:00 2001 From: KubaPro010 Date: Tue, 11 Mar 2025 20:32:17 +0100 Subject: [PATCH] i really don't think this wil lwork --- .vscode/.server-controller-port.log | 2 +- gen_wave.py | 8 +++++++- src/rds.h | 6 +++--- src/waveforms.c | 2 +- src/waveforms.h | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.vscode/.server-controller-port.log b/.vscode/.server-controller-port.log index 8cba245..d709988 100644 --- a/.vscode/.server-controller-port.log +++ b/.vscode/.server-controller-port.log @@ -1,5 +1,5 @@ { "port": 13452, - "time": 1741711510603, + "time": 1741720487844, "version": "0.0.3" } \ No newline at end of file diff --git a/gen_wave.py b/gen_wave.py index b1ca6bb..4a62126 100644 --- a/gen_wave.py +++ b/gen_wave.py @@ -2,7 +2,7 @@ import math import io, os import matplotlib.pyplot as plt -sample_rate = 9500 +sample_rate = 4750 # next 2 funcs are modified from ChristopheJacquet's pydemod def rrcosfilter(NumSamples): @@ -57,6 +57,12 @@ def generate(): count = int(offset / 10**(len(str(offset)) - 1)) # 760 / 100 = 7 l = int(sample_rate / 1187.5) // 2 # 16/2 = 8 if l == 1: raise Exception("Sample rate too small") + if count*l < 2*l: + # idk from where is this + offset *= 2 + offset += 3 + count *= 4 + l *= 2 print(f"{offset=} {count=} {l=}") sample = [0.0] * (count*l) diff --git a/src/rds.h b/src/rds.h index fe3d099..f783f6b 100644 --- a/src/rds.h +++ b/src/rds.h @@ -10,9 +10,9 @@ #define GROUP_LENGTH 4 #define BITS_PER_GROUP (GROUP_LENGTH * (BLOCK_SIZE + POLY_DEG)) -#define RDS_SAMPLE_RATE 9500 -#define SAMPLES_PER_BIT 8 -#define FILTER_SIZE 24 +#define RDS_SAMPLE_RATE 4750 +#define SAMPLES_PER_BIT 4 +#define FILTER_SIZE 32 #define SAMPLE_BUFFER_SIZE (SAMPLES_PER_BIT + FILTER_SIZE) /* Text items diff --git a/src/waveforms.c b/src/waveforms.c index 78e2b96..c7078ca 100644 --- a/src/waveforms.c +++ b/src/waveforms.c @@ -6,5 +6,5 @@ Released under the GNU GPL v3 license. */ -float waveform_biphase[24] = {0.002532628775852384, -6.480266785053461e-18, -0.004522551385450683, 2.807603181808536e-17, 0.00940690688173742, -2.1836329850641248e-17, -0.025868993924777907, -1.1701083086090883e-17, 0.1552139635486674, 0.4, 0.5432488724203361, 0.4, 0.0, -0.4, -0.5432488724203361, -0.4, -0.1552139635486674, 1.1701083086090883e-17, 0.025868993924777907, 2.1836329850641248e-17, -0.00940690688173742, -2.807603181808536e-17, 0.004522551385450683, 6.480266785053461e-18}; +float waveform_biphase[32] = {0.00048792898537812, -0.0006259889636969852, 0.0008222549152560989, -0.0011115066443382834, 0.0015573307379464962, -0.0022850785947540293, 0.0035676349628880324, -0.006086822099947743, 0.011939535657589805, -0.030391545310228592, 0.16462087043040483, 0.5173798784955582, 0.1552139635486674, 0.0, -0.1552139635486674, -0.5173798784955582, -0.16462087043040483, 0.030391545310228592, -0.011939535657589805, 0.006086822099947743, -0.0035676349628880324, 0.0022850785947540293, -0.0015573307379464962, 0.0011115066443382834, -0.0008222549152560989, 0.0006259889636969852, -0.00048792898537812, 0.0003878864829215714, -0.0003135635627245806, 0.00025716303373497773, -0.00021357134703021155, 0.00017933642000528266}; diff --git a/src/waveforms.h b/src/waveforms.h index c657cad..de33dee 100644 --- a/src/waveforms.h +++ b/src/waveforms.h @@ -6,4 +6,4 @@ Released under the GNU GPL v3 license. */ -extern float waveform_biphase[24]; +extern float waveform_biphase[32];