Esempio n. 1
0
        //Frame Comparison
        private double EuclideanDistance(MFCC.MFCCFrame vec1, MFCC.MFCCFrame vec2)
        {
            double Distance = 0.0;

            for (int K = 0; K < 13; K++)
            {
                Distance += (vec1.Features[K] - vec2.Features[K]) * (vec1.Features[K] - vec2.Features[K]);
            }

            return(Math.Sqrt(Distance));
        }
        //Calculates the distance between two frames
        private static double distance(MFCCFrame frame1, MFCCFrame frame2)
        {
            double difference_distance = 0;

            for (int i = 0; i < 13; i++)
            {
                difference_distance +=
                    (frame1.Features[i] - frame2.Features[i]) * (frame1.Features[i] - frame2.Features[i]);
            }

            return Math.Sqrt(difference_distance);
        }