Hi list,
Has anybody implemented a cubic spline interpolation? Or what could I use to do nonlinear interpolation without getting into deep mathematics?
I am transferring a matlab script from a colleague to pd--there a signal is spline interpolated at the beginning using the interp1 function (yi = interp1(x, y, xi, 'method') from matlab(octave).
Thank you.
Gerda
Hi,
I don't know what a cubic spline is, but I would be also interested. Currently I use a patch Thomas Grill made ages ago "smooth" that does low-pass filtering of control data. Gerda, what are you filtering? control data or sound?
Whats the best collection of interpolators? for things like ease-in, ease-out and so on... ?
would be useful for processing sensor data too...
.b.
Gerda Strobl wrote:
Hi list,
Has anybody implemented a cubic spline interpolation? Or what could I use to do nonlinear interpolation without getting into deep mathematics?
I am transferring a matlab script from a colleague to pd--there a signal is spline interpolated at the beginning using the interp1 function (yi = interp1(x, y, xi, 'method') from matlab(octave).
Thank you.
Gerda
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi,
I don't know what a cubic spline is, but I would be also interested. Currently I use a patch Thomas Grill made ages ago "smooth" that does low-pass filtering of control data. Gerda, what are you filtering? control data or sound?
I am not filtering. So far I have the signal as control data-the time domain-uniformly sampled point. I would like to get the whole data through a function(spline interpolation) that spaces the signal points non-uniformally (some sort of nonlinear resampling).
Best, Gerda
On Thursday 02 Mar 2006 08:47, Gerda Strobl wrote:
Has anybody implemented a cubic spline interpolation? Or what could I use to do nonlinear interpolation without getting into deep mathematics?
Hi,
Have you looked at tabread4~ ? From its description as a '4 point interpolation', I've always assumed it to be a cubic bezier spline.
robert.
On Thu, 2 Mar 2006, Robert Scott wrote:
Have you looked at tabread4~ ? From its description as a '4 point interpolation', I've always assumed it to be a cubic bezier spline.
It's a cubic but not a Bézier: a Bézier would use 2 points plus the derivatives at those points. To identify a cubic you always need to get 4 values but they don't have to be points. When all you have is points and not derivatives, the best you can do is get 4 points and do some kind of non-Bézier cubic with it. Conversely, when you have 4 points you can always build a cubic with it.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
On Thu, 2 Mar 2006, Mathieu Bouchard wrote:
On Thu, 2 Mar 2006, Robert Scott wrote:
Have you looked at tabread4~ ? From its description as a '4 point interpolation', I've always assumed it to be a cubic bezier spline.
It's a cubic but not a Bézier: a Bézier would use 2 points plus the derivatives at those points. To identify a cubic you always need to get 4 values but they don't have to be points. When all you have is points and not derivatives, the best you can do is get 4 points and do some kind of non-Bézier cubic with it. Conversely, when you have 4 points you can always build a cubic with it.
tabread4 uses lagrange interpolation, which assures that the resulting polynomial goes through the sample points.
bezier curves use 4 points as well, but the result only goes through point 1 and 4, 2 and 3 are used to describe the derivative.
bezier works well for graphics, whereas lagrange works better for sound. In sound you normally want to have the interpolation exactly on the points, otherwise you do unwanted lowpass filtering.
further info at: http://ccrma.stanford.edu/~jos/resample/resample.html
Günter
Indeed, I reviewed my maths and realised that if it were just a bezier curve using the four samples as the control points (as was my assumption), there would be horrible jumps at the boundary of each sample, because of course, as you say, bezier curves usually don't pass through the control points.
This is what a lack of a formal mathematical education does to you.
robert.
On Friday 03 Mar 2006 09:34, geiger wrote:
On Thu, 2 Mar 2006, Mathieu Bouchard wrote:
On Thu, 2 Mar 2006, Robert Scott wrote:
Have you looked at tabread4~ ? From its description as a '4 point interpolation', I've always assumed it to be a cubic bezier spline.
It's a cubic but not a Bézier: a Bézier would use 2 points plus the derivatives at those points. To identify a cubic you always need to get 4 values but they don't have to be points. When all you have is points and not derivatives, the best you can do is get 4 points and do some kind of non-Bézier cubic with it. Conversely, when you have 4 points you can always build a cubic with it.
tabread4 uses lagrange interpolation, which assures that the resulting polynomial goes through the sample points.
bezier curves use 4 points as well, but the result only goes through point 1 and 4, 2 and 3 are used to describe the derivative.
bezier works well for graphics, whereas lagrange works better for sound. In sound you normally want to have the interpolation exactly on the points, otherwise you do unwanted lowpass filtering.
further info at: http://ccrma.stanford.edu/~jos/resample/resample.html
Günter
Hallo, Gerda Strobl hat gesagt: // Gerda Strobl wrote:
Has anybody implemented a cubic spline interpolation? Or what could I use to do nonlinear interpolation without getting into deep mathematics?
You could use [spline_path] from Gem. AFAIR it is doing a cubic spline interpolation, but I didn't check the source and the help patch is not mentioning the exact algorithm.
Frank Barknecht _ ______footils.org_ __goto10.org__