相关疑难解决方法(0)

你如何对重新采样的音频数据进行双三次(或其他非线性)插值?

我正在编写一些以不同速度播放WAV文件的代码,因此波浪要么慢,要么低音,要么更快,音高更高.我目前正在使用简单的线性插值,如下所示:

            int newlength = (int)Math.Round(rawdata.Length * lengthMultiplier);
            float[] output = new float[newlength];

            for (int i = 0; i < newlength; i++)
            {
                float realPos = i / lengthMultiplier;
                int iLow = (int)realPos;
                int iHigh = iLow + 1;
                float remainder = realPos - (float)iLow;

                float lowval = 0;
                float highval = 0;
                if ((iLow >= 0) && (iLow < rawdata.Length))
                {
                    lowval = rawdata[iLow];
                }
                if ((iHigh >= 0) && (iHigh < rawdata.Length))
                {
                    highval = rawdata[iHigh];
                }

                output[i] = …
Run Code Online (Sandbox Code Playgroud)

audio interpolation signal-processing resampling bicubic

16
推荐指数
2
解决办法
1万
查看次数