mirror of
https://github.com/radio95-rnt/fm95.git
synced 2026-02-26 11:22:00 +01:00
clipper before
This commit is contained in:
10
src/fm95.c
10
src/fm95.c
@@ -214,6 +214,11 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
|
|||||||
r *= agc_gain;
|
r *= agc_gain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.clipper_threshold != 0) {
|
||||||
|
l = hard_clip(l * config.audio_volume, config.clipper_threshold);
|
||||||
|
r = hard_clip(r * config.audio_volume, config.clipper_threshold);
|
||||||
|
}
|
||||||
|
|
||||||
float mod_l, mod_r;
|
float mod_l, mod_r;
|
||||||
|
|
||||||
if(config.lpf_cutoff != 0) {
|
if(config.lpf_cutoff != 0) {
|
||||||
@@ -226,11 +231,6 @@ int run_fm95(const FM95_Config config, FM95_Runtime* runtime) {
|
|||||||
mod_r = apply_preemphasis(&runtime->preemp_r, mod_r);
|
mod_r = apply_preemphasis(&runtime->preemp_r, mod_r);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.clipper_threshold != 0) {
|
|
||||||
mod_l = hard_clip(mod_l * config.audio_volume, config.clipper_threshold);
|
|
||||||
mod_r = hard_clip(mod_r * config.audio_volume, config.clipper_threshold);
|
|
||||||
}
|
|
||||||
|
|
||||||
mpx = stereo_encode(&runtime->stencode, config.stereo, mod_l, mod_r);
|
mpx = stereo_encode(&runtime->stencode, config.stereo, mod_l, mod_r);
|
||||||
|
|
||||||
if(rds_on) {
|
if(rds_on) {
|
||||||
|
|||||||
Reference in New Issue
Block a user