Hi list,
I hope my repeating questions don't annoy anyone. I've sent a similar question a while back to [pd-ot] but with out response, have been thinking over it, found no answer so far.
Although I had never concerned it till recently, I've learned that 4 point interpolation may at times return values less than -1 or greater than 1 even when the 4 reference points are with in that range.
i.e., having a table of [-1 1 1 -1], an index of 1.5 will return 1.25 with [tabread4]
Are there any common practices to avoid unexpected clipping introduced by [tabread4] or [tabosc4~] ?
Further more, under what circumstances (what 4 values referred to) will the returned value exceed the range most?
Thanks in advance..
-- David Shimamoto
On Mon, Aug 25, 2008 at 7:48 AM, PSPunch shima@pspunch.com wrote:
i.e., having a table of [-1 1 1 -1], an index of 1.5 will return 1.25 with [tabread4]
This is correct. The interpolated values can exceed the values in the samples. Think about drawing a polynomial through your points, and where the maximum actually can occur.
Are there any common practices to avoid unexpected clipping introduced by [tabread4] or [tabosc4~] ?
Common practices, not sure. But I think we can establish an upper bound on the peak value, analytically.
Our polynomial for tabread4~:
g(x)= f[-1]*x(x-1)(x-2)/-6
So, the maximum value must occur as a function of x between 0 and 1. Taking our input peak value as 1, the maximum output peak is the sum of the absolute value of the coefficients of f[-1], f[0], f[1], f[2]
x(x-1)(x-2)/6 + (x+1)(x-1)(x-2)/2 - (x+1)x(x-2)/2 - (x+1)x(x-1)/6
= -x^2 + x + 1
vertex: x=1/2, f(1/2) = 1.25
Further more, under what circumstances (what 4 values referred to) will the returned value exceed the range most?
How do you like answering your own questions :) Your example is exactly it.
Chuck
Thanks in advance..
-- David Shimamoto
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Charles,
Common practices, not sure. But I think we can establish an upper bound on the peak value, analytically.
Ok,
So to be secure, [* 0.8] (1/1.25) will prevent such clips I guess. As the series being somewhat are, perhaps for wavetable synthesis, I guess a larger factor or a simple [clip] may be practical as well. Anyway I appreciate you backing me up with my question.
How do you like answering your own questions :) Your example is exactly it.
It was a rough guess taken from my understanding of what the formula did, however, I had no idea "why".
The whole idea of polynomial interpolation to me, was something I had to read multiple explanations before understanding. Yours certainly carried me through the last few steps to reach my goal.
Thank you so much.
-- David Shimamoto