0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00

add new preemp

This commit is contained in:
2025-01-31 16:48:13 +01:00
parent 0c9222393c
commit fa2ba7f71a
4 changed files with 57 additions and 24 deletions

View File

@@ -456,9 +456,9 @@ int main(int argc, char **argv) {
DelayLine monoDelay; // Hilbert introduces a delay, this should be here to sync the mono with stereo to a sample
init_delay_line(&monoDelay, (HILBERT_TAPS-1)/2);
ResistorCapacitor preemp_l, preemp_r;
init_rc_tau(&preemp_l, preemphasis_tau, SAMPLE_RATE);
init_rc_tau(&preemp_r, preemphasis_tau, SAMPLE_RATE);
BiquadFilter preemp_l, preemp_r;
init_preemphasis(&preemp_l, preemphasis_tau, SAMPLE_RATE);
init_preemphasis(&preemp_r, preemphasis_tau, SAMPLE_RATE);
FrequencyFilter lpf_l, lpf_r;
init_lpf(&lpf_l, LPF_CUTOFF, SAMPLE_RATE);
@@ -514,8 +514,8 @@ int main(int argc, char **argv) {
float ready_r = apply_frequency_filter(&lpf_r, l_in);
ready_l = apply_frequency_filter(&hpf_l, ready_l);
ready_r = apply_frequency_filter(&hpf_r, ready_r);
ready_l = apply_pre_emphasis(&preemp_l, ready_l)*2;
ready_r = apply_pre_emphasis(&preemp_r, ready_r)*2;
ready_l = apply_preemphasis(&preemp_l, ready_l);
ready_r = apply_preemphasis(&preemp_r, ready_r);
ready_l = soft_clip(ready_l, soft_clipper_threshold);
ready_r = soft_clip(ready_r, soft_clipper_threshold);
ready_l = hard_clip(ready_l, clipper_threshold);