Explanation of Interpolate Hermite method

旧巷老猫 提交于 2019-12-06 05:54:55

These are functions that do the following: Given a discrete sequence of samples, interpolate smoothly between them. That is: suppose your original data is x(0), x(1), x(2), etc. You want (let's say) to make it 1.234 times faster. Then you want samples x(0), x(1/1.234), x(2/1.234), x(3/1.234), etc. And you want these to look like samples from a nice smooth signal that goes through the sample points you have.

Both of these functions should be used as follows. You want to interpolate between x(n) and x(n+1). To get a value you can call x(n+t), call them with arguments x(n-1), x(n), x(n+1), x(n+2) and t. When t=0 you'll get x(n); when t=1 you'll get x(n+1); you shouldn't (except maybe at the ends of your data) use arguments that aren't between 0 and 1.

So, to speed up or slow down your signal, sample at times [integer]/[speed factor]; for each time t, take n-1,n,n+1,n+2 such that n <= t <= n+1, and call the interpolator with values x(n-1),x(n),x(n+1),x(n+2) and t-n. And see how it sounds :-).

Interpolation is a way to find new data points between discrete values.

The diagram above shows five values. X0, X1, X2, X3, X4. The values are for these five points are known. The in-between values aren't known and can only be approximated by interpolating from the known data points. Different interpolation algorithms will give different results.

For example, to find the value of the red dot (shown between the X1 and X2 values) we can use interpolation. The t specifies the point you wish to find. t will always be a value between 0 and 1. In this case t will be approximately 0.25.

The simplest interpolation method is linear interpolation. It is essentially the same as drawing a straight line between two points.

Linear Interpolation
y = x1 + (x2 - x1) * t

Cubic interpolation and hermite interpolation both function similary to linear interpolation except they use more data points to calculate curves instead of straight lines.

To understand what these functions are doing, it could be helpful to plot the functions in a graphing application.

To answer your questions:

  1. t has no relationship to pitch. It specifies the location of the in-between point the interpolation algorithm will calculate the value for.

  2. NA.

  3. These functions calculate values between discreet points. By themselves they do not pitch shift audio but they could be used in the algorithm that does.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!