mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-27 12:53:53 +01:00
reduce sampling rate
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
PLOT = True
|
PLOT = False
|
||||||
FFT = PLOT and True
|
FFT = PLOT and False
|
||||||
|
|
||||||
import math
|
import math
|
||||||
import io, os
|
import io, os
|
||||||
@@ -9,7 +9,7 @@ if FFT: import numpy as np
|
|||||||
DATA_RATE = 1187.5
|
DATA_RATE = 1187.5
|
||||||
SIZE_RATIO = 1
|
SIZE_RATIO = 1
|
||||||
|
|
||||||
ratio = 16
|
ratio = 4
|
||||||
sample_rate = DATA_RATE*ratio
|
sample_rate = DATA_RATE*ratio
|
||||||
print(f"{sample_rate=}")
|
print(f"{sample_rate=}")
|
||||||
if not sample_rate.is_integer(): raise ValueError("Need a even value")
|
if not sample_rate.is_integer(): raise ValueError("Need a even value")
|
||||||
|
|||||||
@@ -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;
|
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;
|
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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
#define GROUP_LENGTH 4
|
#define GROUP_LENGTH 4
|
||||||
#define BITS_PER_GROUP (GROUP_LENGTH * (BLOCK_SIZE + POLY_DEG))
|
#define BITS_PER_GROUP (GROUP_LENGTH * (BLOCK_SIZE + POLY_DEG))
|
||||||
#define RDS_SAMPLE_RATE 19000
|
#define RDS_SAMPLE_RATE 4750
|
||||||
#define SAMPLES_PER_BIT 16
|
#define SAMPLES_PER_BIT 4
|
||||||
#define FILTER_SIZE 16
|
#define FILTER_SIZE 4
|
||||||
#define SAMPLE_BUFFER_SIZE (SAMPLES_PER_BIT + FILTER_SIZE)
|
#define SAMPLE_BUFFER_SIZE (SAMPLES_PER_BIT + FILTER_SIZE)
|
||||||
|
|
||||||
#define STREAMS 2
|
#define STREAMS 2
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
Released under the GNU GPL v3 license.
|
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};
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
Released under the GNU GPL v3 license.
|
Released under the GNU GPL v3 license.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern float waveform_biphase[16];
|
extern float waveform_biphase[4];
|
||||||
|
|||||||
Reference in New Issue
Block a user