0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00
This commit is contained in:
2025-08-02 18:14:24 +02:00
parent 55981533b8
commit a7a3b49452
4 changed files with 8 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
{
"port": 13452,
"time": 1754149596407,
"time": 1754151185891,
"version": "0.0.3"
}

View File

@@ -6,6 +6,7 @@
#include <math.h>
#include <string.h>
#include <stdint.h>
#ifdef BS412_DEBUG
#include "../lib/debug.h"
#endif
@@ -14,7 +15,7 @@ typedef struct
{
int mpx_deviation;
int average_counter;
int sample_rate;
uint32_t sample_rate;
float target;
float attack;
float release;

View File

@@ -1,5 +1,6 @@
#pragma once
#include <math.h>
#include <stdint.h>
typedef struct {
float targetLevel;
@@ -11,7 +12,7 @@ typedef struct {
float currentGain;
float currentLevel;
int sampleRate;
uint32_t sampleRate;
float attackCoef;
float releaseCoef;

View File

@@ -445,7 +445,7 @@ void init_runtime(FM95_Runtime* runtime, FM95_Config config, bool rds_on) {
}
float last_gain = 0.0f;
if((uint32_t)runtime->bs412.sample_rate == config.sample_rate) last_gain = runtime->bs412.gain;
if(runtime->bs412.sample_rate == config.sample_rate) last_gain = runtime->bs412.gain;
init_bs412(&runtime->bs412, config.mpx_deviation, config.mpx_power, config.bs412_attack, config.bs412_release, config.bs412_max, config.sample_rate);
runtime->bs412.gain = last_gain;
@@ -454,7 +454,8 @@ void init_runtime(FM95_Runtime* runtime, FM95_Config config, bool rds_on) {
init_stereo_encoder(&runtime->stencode, 4.0f, &runtime->osc, (config.stereo == 2), config.volumes.mono, config.volumes.pilot, config.volumes.stereo);
if(config.agc_max != 0.0) {
if((uint32_t)runtime->agc.sampleRate == config.sample_rate) last_gain = runtime->agc.currentGain;
last_gain = 0.0f;
if(runtime->agc.sampleRate == config.sample_rate) last_gain = runtime->agc.currentGain;
initAGC(&runtime->agc, config.sample_rate, config.agc_target, config.agc_min, config.agc_max, config.agc_attack, config.agc_release);
runtime->agc.currentGain = last_gain;
}