0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00

clip bs412 and make it simpler to understand, both by me and the compiler

This commit is contained in:
2025-07-08 23:04:38 +02:00
parent dced0383d5
commit 58a37da27c
3 changed files with 10 additions and 9 deletions

View File

@@ -167,7 +167,7 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
init_preemphasis(&preemp_r, config.preemphasis, config.sample_rate, config.preemp_unity_freq);
BS412Compressor bs412;
init_bs412(&bs412, config.mpx_power, config.bs412_attack, config.bs412_release, config.sample_rate);
init_bs412(&bs412, config.mpx_deviation, config.mpx_power, config.bs412_attack, config.bs412_release, config.sample_rate);
TiltCorrectionFilter tilter;
tilt_init(&tilter, config.tilt);
@@ -232,7 +232,7 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
}
}
mpx = bs412_compress(&bs412, mpx*config.mpx_deviation) / config.mpx_deviation;
mpx = bs412_compress(&bs412, mpx);
output[i] = hard_clip(tilt(&tilter, (mpx_in[i]+mpx))*config.master_volume, 1.0); // Ensure peak deviation of 75 khz, assuming we're calibrated correctly (lower)
advance_oscillator(&osc);