bicubic

How do you do bicubic (or other non-linear) interpolation of re-sampled audio data?

拥有回忆 提交于 2019-11-27 11:09:18
I'm writing some code that plays back WAV files at different speeds, so that the wave is either slower and lower-pitched, or faster and higher-pitched. I'm currently using simple linear interpolation, like so: 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

Android: Bitmap resizing using better resampling algorithm than bilinear (like Lanczos3)

折月煮酒 提交于 2019-11-27 01:39:36
问题 Is there any way or external library that can resize image using Lanczos (ideally) or at least bicubic alg. under Android ? ( faster is better of course, but quality is priority, a processing time is secondary) Everything what I've got so far is this: Bitmap resized = Bitmap.createScaledBitmap(yourBitmap, newWidth, newHeight, true); However it uses bilinear filter and the output quality is terrible. Especially if you want to preserve details (like thin lines or readable texts). There are many

How do you do bicubic (or other non-linear) interpolation of re-sampled audio data?

☆樱花仙子☆ 提交于 2019-11-26 15:26:55
问题 I'm writing some code that plays back WAV files at different speeds, so that the wave is either slower and lower-pitched, or faster and higher-pitched. I'm currently using simple linear interpolation, like so: 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