From 2cc5d96e62870961e926732d519609faba6e9872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Sch=C3=B6ck?= Date: Sat, 12 Mar 2016 18:16:45 +0100 Subject: [PATCH] switched the filter to a much better sounding one previouse filter was described by: y[n] = bx[n]-bx[n-1]+ay[n-1] filter is now described by: y(n) = x(n) - a x(n-1) with 'a' = old 'b' even i have no idea if that coefficient 'a' is selected correctly, it sounds much better than before --- src/fm_mpx.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/fm_mpx.c b/src/fm_mpx.c index 0d4ac85..011b484 100644 --- a/src/fm_mpx.c +++ b/src/fm_mpx.c @@ -66,11 +66,13 @@ float fir_buffer_stereo[FIR_SIZE] = {0}; int fir_index = 0; int channels; +//3.185kHz for Europe, 2.120kHz for US +const float PREEMPHASIS_US = 2120; +const float PREEMPHASIS_EU = 3185; float *last_buffer_val; float preemphasis_corner_freq; float preemphasis_prewarp; -float preemphasis_coefficient_a; -float preemphasis_coefficient_b; +float preemphasis_coefficient; SNDFILE *inf; @@ -126,11 +128,10 @@ int fm_mpx_open(char *filename, size_t len) { last_buffer_val = (float*) malloc(sizeof(float)*channels); for(int i=0;i