Interpolation

In this lesson, we will learn about the need for interpolation and how to implement it.

We'll cover the following

The need for interpolation

If a reading is missing between two consecutive readings, one approach is to replace the missing value using interpolation over the values that are present.

The signal in a weakly linked circuit is a good real-world example of a noisy signal. It is easy to identify the shape of the signal by looking at it, but difficult to quantify its mathematical form. This causes a lot of frustration amongst engineers, and that is why interpolation is a necessary tool to have.

The interp1d() function from the scipy.interpolate sub-package interpolates the data based on splines of varying order. interp1d returns an object which behaves like a function. When this function is given an arbitrary value of xx, it returns the corresponding interpolated yy value.

This is a very useful technique when plotting data. Let’s see a code example of this along with the graphs below:

Get hands-on with 1200+ tech skills courses.