# [PD] tabread4~ "broken" interpolation algorithm - was Re:, Max Smoother Audio than Pd?

Charles Henry czhenry at gmail.com
Fri Apr 2 18:52:16 CEST 2010

```> You're trying to restrict the analysis to a convenient (but reasonable)
> class of signals, and to assume that the signal to be interpolated, x,
> belongs to that class. Right?

Well, sort of.  What works well as an interpolator for one signal may
not work well for another.  The point I started from was asking the
question, what would make a good measure of the error when we use a
given interpolator?

So, if I just wanted to average across all frequencies the squared
error, I thought the problem would be equivaled to this one:

>> E=|f(x)-sinc(x)|^2 is minimized when
>>
>> f(x)={sinc(x) -2<x<2  ,    0 elsewhere

And then it's the same as having an operator acting on a flat spectrum signal.

> It doesn't make any sense, as far as I can see, to assume that the signal
> being interpolated belongs to the class of function whose spectrum has a
> flat modulus (and any phase).
> Why not assuming then, for example, that x(t) is a constant?
> (please don't take my tone as sarchastic)
>
> What does make some sense (it is a strong hypothesis but discussing its
> plausibility would bring the discussion to a much higher level) is to treat
> the signal x as a stochastic process with a given power spectrum - such as
> flat, or pink.

So, I assumed the signal spectrum flat so that I could average over
all the frequencies.  True it doesn't fit the actual use cases and
give us the error in a signal we'd actually like to see--it's just
sort of a toy problem, but it goes back to the reason why we're
looking at it in the first place, to consider what happens when we
just choose one measure (L2 normed error in signal reconstruction
averaged across all frequencies) and then find the best result.

This class of functions to consider is useful if we're going for
rigourous math here... but maybe we've strayed too far outside the
topic and should just stick to calculus?

Suppose we choose our metric and work it out.  If the correct result
doesn't behave well or doesn't fit our criteria, then how should we
create a better measure?

> But that means that the quantity you're minimizing is no longer an integral
> of the signal minus some other signal all squared: it is the expectation of
> something.
>
> The power spectrum of a stochastic process x(t) is not the fourier transform
> of x(t), it is the fourier transform of tha autocorrelation function of x
> (or something like that).

The hardest class I ever had was stochastic analysis (as recent as 4
years ago), where we solved problems like this.  Fundamentally, it's
not too hard, but the details of the calculus are tricky.  I'd prefer
to stay away unless there's a real good reason to do so :)

```