From 6b2b8c53d1dd290091c5f751657831e9ea7bfa95 Mon Sep 17 00:00:00 2001 From: kevin Date: Fri, 6 May 2022 16:01:40 -0400 Subject: [PATCH] cwAudioTransforms.h : Change _cmSpecDist to use doubles for some operations to avoid distortion. --- cwAudioTransforms.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/cwAudioTransforms.h b/cwAudioTransforms.h index f753818..e99b2b3 100644 --- a/cwAudioTransforms.h +++ b/cwAudioTransforms.h @@ -785,16 +785,16 @@ namespace cw } template< typename T0, typename T1 > - void _cmSpecDist2Bump( struct obj_str* p, T0* x, unsigned binCnt, T1 thresh, T1 expo) + void _cmSpecDist2Bump( struct obj_str* p, double* x, unsigned binCnt, double thresh, double expo) { unsigned i = 0; - T1 minDb = -100.0; + double minDb = -100.0; thresh = -fabs(thresh); for(i=0; i - void _cmSpecDist2BasicMode( struct obj_str* p, T0* X1m, unsigned binCnt, T1 thresh, T1 upr, T1 lwr ) + void _cmSpecDist2BasicMode( struct obj_str* p, double* X1m, unsigned binCnt, double thresh, double upr, double lwr ) { unsigned i=0; @@ -823,8 +823,8 @@ namespace cw for(i=0; i -150.0 ) { @@ -890,7 +890,6 @@ namespace cw return rc; } - }