From 4f1ee28d687d583601d41ff58e1618b381d2675f Mon Sep 17 00:00:00 2001 From: Katja Date: Sun, 6 Nov 2011 14:41:44 +0000 Subject: made creb compliant with double precision - changed float to t_float - adapted subnormal detection svn path=/trunk/externals/creb/; revision=15706 --- modules++/filters.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'modules++/filters.h') diff --git a/modules++/filters.h b/modules++/filters.h index e0d1c49..8485bec 100644 --- a/modules++/filters.h +++ b/modules++/filters.h @@ -4,7 +4,7 @@ /* the typedef */ #ifndef T -#define T float +#define T t_float #endif @@ -54,14 +54,14 @@ P vcmul2 (T A, T C) { cmul2(a,a+1,c,c+1); } /* norm */ -static inline float vcnorm(T X) { return hypot(x[0], x[1]); } +static inline t_float vcnorm(T X) { return hypot(x[0], x[1]); } /* swap */ P vcswap(T Y, T X) { - float t[2] = {x[0], x[1]}; + t_float t[2] = {x[0], x[1]}; x[0] = y[0]; x[1] = y[1]; y[0] = t[0]; @@ -72,14 +72,14 @@ P vcswap(T Y, T X) /* inverse */ P vcinv(T Y, T X) { - float scale = 1.0f / vcnorm(x); + t_float scale = 1.0 / vcnorm(x); y[0] = scale * x[0]; y[1] = scale * x[1]; } P vcinv1(T X) { - float scale = 1.0f / vcnorm(x); + t_float scale = 1.0 / vcnorm(x); x[0] *= scale; x[1] *= scale; } @@ -162,24 +162,24 @@ P two_pole_complex_conj (T X, T Y, T S, T A, T C) /* evaluate pole and allzero TF in z^-1 given the complex zeros/poles: p(z) (or p(z)^-1) = \product (1-z_i z^-1) */ -PP eval_zero_poly(float *val, float *arg, float *zeros, int nb_zeros) +PP eval_zero_poly(t_float *val, t_float *arg, t_float *zeros, int nb_zeros) { int i; - float a[2] = {arg[0], arg[1]}; + t_float a[2] = {arg[0], arg[1]}; vcinv1(a); - val[0] = 1.0f; - val[1] = 0.0f; + val[0] = 1.0; + val[1] = 0.0; a[0] *= -1; a[1] *= -1; for (i=0; i