VJManager._ConvertRawSpectrumToBandLevels C# (CSharp) Метод

_ConvertRawSpectrumToBandLevels() приватный Метод

private _ConvertRawSpectrumToBandLevels ( ) : void
Результат void
    private void _ConvertRawSpectrumToBandLevels()
    {
        float coeff = Mathf.Log(rawSpectrum.Length);
        int offs = 0;
        for (int i = 0; i < bandLevels.Length; i++) {
            float next = Mathf.Exp(coeff / bandLevels.Length * (i + 1));
            float weight = 1.0f / (next - offs);
            float sum = 0.0f;
            for (; offs < next; offs++) {
                sum += rawSpectrum[offs];
            }
            bandLevels[i] = Mathf.Sqrt(weight * sum);
        }
    }