Linear Interpolation For Excel
Linear Interpolation For Excel
Linear Interpolation For Excel
Before we even get into the obtuse EXCEL calculation, let's point out that there
is no excuse for Microsoft Excel not to have this function built in. MathCAD has it
(and tons more cool functions!), MathCAD calls it the LINTERP function. BTW,
what do you call the function when your kid wants help with their math
homework? That's MathDAD!
Interpolation means fitting Y-value data to to an X-value that is somewhere
between two data points, using a straight line. Simple in concept, a royal pain to
do in a spreadsheet.
1 Interpolation or extrapolation?
Interpolation is "faking" data points that are contained inside a wide dataset.
Extrapolation is faking data points outside the dataset. Extrapolation is wishful
thinking, and can get you in trouble in microwave engineering. Try to see what
extrapolating the response of a bandpass filter does outside the passband
sometime if you need proof!
2 What is interpolation?
Any high school graduate should be able to tell you the formula for linear
interpolation. Especially after they look it up on Wikipedia! Below is a close-up of
an interpolated data point. X1 and Y1 are "real" data points, so are X2 and Y2.
We seek to find the Y value for an arbitrary X value between these two points,
such that it is on the straight line that is drawn between them.
We entered the data into the interpolation spreadsheet, and interpolated values
between the calibrated points, shown below. Notice how interpolation tends to
smooth data!
.
5 Power head example
Here's an 8485A power head from Agilent, used in power meter measurements.
It has calibration data from 2 to 26.5 GHz. Actually the "reference cal factor" is
another data point at 50 MHz, in this case it is 99%.
We entered the data into the spreadsheet, and interpolated points between
calibration data as shown below.
6 S-parameter example
S-parameters can be interpolated over frequency, but there's two issues to
consider. Should you interpolate the magnitude in linear units, in dB, or should
you convert magnitude/phase to real/imaginary and interpolate that? In the case
of Agilent's Advanced Design System, you'd use the "native units", so you'd just
interpolate whatever the data came in as.
The other issue you have to deal with is when you interpolate phase data
between wo adjacent data points where the phase angle wraps from -180 to
+180 degrees; you can end up on the opposite side of the Smith chart.
Below is a plot of interpolated S-parameter angle data that we created from an
Hittite HMC548LP3 that we downloaded from the Hittite web site. The
frequencies are incremented every 11.962 MHz, which is a result of measuring
the device from 500 to 3000 MHz in 210 steps. If you look closely there is one
errant point in the interpolated S21 angle, this happened at 1500 MHz because
the phase of the two adjacent data points wrapped past 180 degrees. One of
these days we'll put in a fix for that!