ERBVal() 공개 정적인 메소드

ERB value for a given frequency
public static ERBVal ( double f ) : double
f double Frequency (Hz)
리턴 double
예제 #1
0
        /// <summary>
        /// Return a list of freq/gain, at the ERB centers
        /// Assuming you smoothed the data...
        /// </summary>
        /// <param name="data">data from ERB.smooth</param>
        /// <param name="sr">sample rate</param>
        /// <param name="scaleFactor">1.0 for ~38 bands.  0.5 for twice as many...</param>
        /// <returns></returns>
        public static FilterProfile profile(double[] data, uint sr, double scaleFactor)
        {
            FilterProfile pts = new FilterProfile();
            int           dl  = data.Length;

            for (double j = 1; j < ERB.ERBVal(sr / 2) + 1; j += scaleFactor)
            {
                double f = ERB.invERBVal(j);
                double n = f * 2 * dl / sr;
                if (n < dl)
                {
                    double g = data[(int)n];
                    pts.Add(new FreqGain(f, g));
                }
            }
            return(pts);
        }
예제 #2
0
        public static double bin2f(double bin, uint sr)
        {
            double scale = (_bins / ERB.ERBVal(sr / 2));

            return(ERB.invERBVal(bin / scale));
        }
예제 #3
0
        public static double f2bin(double f, uint sr)
        {
            double scale = (_bins / ERB.ERBVal(sr / 2));

            return(ERB.ERBVal(f) * scale);
        }