shithub: sox

Download patch

ref: bea27204158fb70c8643450de60c5177ebcce1a0
parent: 927fea9015ba6b90973a637db0802ca51cc73e71
author: Rob Sykes <robs@users.sourceforge.net>
date: Mon Mar 5 13:53:49 EST 2012

minor refactoring to facilitate debug

--- a/src/effects_i_dsp.c
+++ b/src/effects_i_dsp.c
@@ -290,9 +290,10 @@
     sox_bool allow_aliasing,
     double att,     /* Stop-band attenuation in dB */
     int * num_taps, /* (Single phase.)  0: value will be estimated */
-    int k)          /* Number of phases; 0 for single-phase */
+    int k,          /* Number of phases; 0 for single-phase */
+    double beta)
 {
-  double tr_bw, beta;
+  double tr_bw;
 
   if (allow_aliasing)
     Fc += (Fc - Fp) * LSX_TO_3dB;
@@ -301,7 +302,8 @@
 
   if (!*num_taps)
     *num_taps = lsx_lpf_num_taps(att, tr_bw, k);
-  beta = lsx_kaiser_beta(att);
+  if (beta < 0)
+    beta = lsx_kaiser_beta(att);
   if (k)
     *num_taps = *num_taps * k - 1;
   else k = 1;
--- a/src/sox_i.h
+++ b/src/sox_i.h
@@ -109,7 +109,8 @@
     sox_bool allow_aliasing,
     double att,     /* Stop-band attenuation in dB */
     int * num_taps, /* (Single phase.)  0: value will be estimated */
-    int k);         /* Number of phases; 0 for single-phase */
+    int k,          /* Number of phases; 0 for single-phase */
+    double beta);
 void lsx_fir_to_phase(double * * h, int * len,
     int * post_len, double phase0);
 #define LSX_TO_6dB .5869