#define YULE_ORDER 10\r
#define BUTTER_ORDER 2\r
#define RMS_PERCENTILE 0.95 // percentile which is louder than the proposed level\r
-#define MAX_SAMP_FREQ 48000. // maximum allowed sample frequency [Hz]\r
-#define RMS_WINDOW_TIME 0.050 // Time slice size [s]\r
-#define STEPS_per_dB 100. // Table entries per dB\r
-#define MAX_dB 120. // Table entries for 0...MAX_dB (normal max. values are 70...80 dB)\r
+#define MAX_SAMP_FREQ 48000 // maximum allowed sample frequency [Hz]\r
+#define RMS_WINDOW_TIME 50 // Time slice size [ms]\r
+#define STEPS_per_dB 100 // Table entries per dB\r
+#define MAX_dB 120 // Table entries for 0...MAX_dB (normal max. values are 70...80 dB)\r
\r
#define MAX_ORDER (BUTTER_ORDER > YULE_ORDER ? BUTTER_ORDER : YULE_ORDER)\r
-#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME) // max. Samples per Time slice\r
+#define MAX_SAMPLES_PER_WINDOW (MAX_SAMP_FREQ * RMS_WINDOW_TIME / 1000) // max. Samples per Time slice\r
#define PINK_REF 64.82 //298640883795 // calibration value\r
\r
Float_t linprebuf [MAX_ORDER * 2];\r
default: return INIT_GAIN_ANALYSIS_ERROR;\r
}\r
\r
- sampleWindow = (int) ceil (samplefreq * RMS_WINDOW_TIME);\r
+ sampleWindow = (int) ceil (samplefreq * ( (float_t) RMS_WINDOW_TIME) / 1000);\r
\r
lsum = 0.;\r
rsum = 0.;\r
cursamplepos += cursamples;\r
totsamp += cursamples;\r
if ( totsamp == sampleWindow ) { // Get the Root Mean Square (RMS) for this set of samples\r
- double val = STEPS_per_dB * 10. * log10 ( (lsum+rsum) / totsamp * 0.5 + 1.e-37 );\r
+ double val = (float_t) STEPS_per_dB * 10. * log10 ( (lsum+rsum) / totsamp * 0.5 + 1.e-37 );\r
int ival = (int) val;\r
if ( ival < 0 ) ival = 0;\r
if ( ival >= sizeof(A)/sizeof(*A) ) ival = sizeof(A)/sizeof(*A) - 1;\r