public static invERBVal ( double v ) : double | ||
v | double | |
Résultat | double |
/// <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); }
public static double bin2f(double bin, uint sr) { double scale = (_bins / ERB.ERBVal(sr / 2)); return(ERB.invERBVal(bin / scale)); }