#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
+/* [JEC] the following was originally #defined as:\r
+ * (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME)\r
+ * but that seemed to fail to take into account the ceil() part of the\r
+ * sampleWindow calculation in ResetSampleFrequency(), and was causing\r
+ * buffer overflows for 48kHz analysis, hence the +1.\r
+ */\r
+#define MAX_SAMPLES_PER_WINDOW (size_t) (MAX_SAMP_FREQ * RMS_WINDOW_TIME + 1.) /* max. Samples per Time slice */\r
#define PINK_REF 64.82 /* 298640883795 */ /* calibration value */\r
\r
static Float_t linprebuf [MAX_ORDER * 2];\r