From 139d3d731b1070e888cdeb93bb6b6e57d9bbfd06 Mon Sep 17 00:00:00 2001 From: ha7ilm Date: Sat, 18 Feb 2017 16:01:14 +0100 Subject: [PATCH] single samples bad, possibly at the beginning --- libcsdr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcsdr.c b/libcsdr.c index 6b8fc62..23bca76 100644 --- a/libcsdr.c +++ b/libcsdr.c @@ -729,6 +729,7 @@ void fractional_decimator_ff(float* input, float* output, int input_size, fracti //The pre-filter can be switched off by applying taps=NULL. //fprintf(stderr, "drate=%f\n", d->rate); if(DEBUG_ASSERT) assert(d->rate > 1.0); + if(DEBUG_ASSERT) assert(d->where >= -d->xifirst); int oi=0; //output index int index_high; #define FD_INDEX_LOW (index_high-1) @@ -757,10 +758,9 @@ void fractional_decimator_ff(float* input, float* output, int input_size, fracti } output[oi++]=acc; } - d->input_processed=FD_INDEX_LOW + d->xifirst; - d->where-=d->input_processed; - if(DEBUG_ASSERT) assert(d->where >= -d->xifirst); - d->output_size=oi; + d->input_processed = FD_INDEX_LOW + d->xifirst; + d->where -= d->input_processed + d->xifirst + 1; + d->output_size = oi; } /*