6.3 Interpolations
Interpolation determines a value between two points on a curve. For any given discrete data set (e.g., measured values), a continuous function must be found that maps this data. Interpolation is used to predict trends or curve progressions.
The SciPy function interp1d(x,y,kind='linear',...) from the interpolate submodule can solve interpolation problems in the plane. The x and y parameters are arrays with the x-y coordinates of the measuring points. The third parameter specifies the interpolation method, such as linear, next, previous, quadratic, or cubic.
The discrete data shown in Figure 6.3 represents some sampled values of a sine wave. Let’s now search for the interpolating function.
Figure 6.3 Sampled Signal
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access