Linear Interpolation

Hello All,

I’m trying to have linear interpolate between indices of my wavetable. In chapter 6 of The Audio programming book, they are saying:

If an index pos p falls between points x1 and x2, whose
table values are y1 and y2, then, by linear interpolation we have
y = y1 + (y2-y1)*(p-x1)

but how come not

y = y1 + (y2-y1/x2-x1)*(x-x1) ?

is it maybe because there is no X and Y in a wavetable?


I would assume x2-x1 would be always 1 so there’s no reason to do the divide in the wavetable use case.

oh that’s right. Thank you.