示例#1
0
        public static double logRootMeanSquare(double[] samples)
        {
            if (!SpeechClassifier.assertionsDisabled && samples.Length <= 0)
            {
                throw new AssertionError();
            }
            double num  = (double)0f;
            int    num2 = samples.Length;

            for (int i = 0; i < num2; i++)
            {
                double num3 = samples[i];
                num += num3 * num3;
            }
            double num4 = Math.sqrt(num / (double)samples.Length);

            num4 = Math.max(num4, (double)1f);
            return((double)(LogMath.log10((float)num4) * 20f));
        }