[PD] better tabread4~
Charles Henry
czhenry at gmail.com
Sat Jul 19 21:40:44 CEST 2008
Sorry it took me so long to make something usable out of that mess. I
played around with factoring but it seems like it got me nowhere, so I
finally just multiplied out all the polynomials to get the usual form.
(given input points g[-2] g[-1] g[0] g[1] g[2] g[3]
a5 = 3/64*g[-2] + 13/64*g[-1] - 27/32*g[0] + 27/32*g[1] - 13/64*g[2]
- 3/64*g[3]
a4 = -3/16*g[-2] - 19/64*g[-1] + 63/32*g[0] - 9/4*g[1] +
23/32*g[2] + 3/64*g[3]
a3 = 9/32*g[-2] - 9/16*g[-1] + 9/16*g[1] - 9/32*g[2]
a2 = -3/16*g[-2] + 5/4*g[-1] - 17/8*g[0] + 5/4*g[1] - 3/16*g[2]
a1 = 3/64*g[-2] - 19/32*g[-1] + 19/32*g[1] - 3/64*g[2]
a0=g[0]
output[x]=((((a5*x+a4)*x+a3)*x+a2*x)+a1)*x+a0
and I did some analysis of the function:
This function is continuous up to the 3rd derivative with derivative
approximations:
g'(0)=3/64*g[-2] - 19/32*g[-1] + 19/32*g[1] - 3/64*g[2]
g''(0)=-3/8*g[-2] + 5/2*g[-1] - 17/4*g[0] + 5/2*g[1] - 3/8*g[2]
g'''(0)=27/16*g[-2] - 27/8*g[-1] + 27/8*g[1] - 27/16*g[2]
but here's the rub. These approximations of the derivatives are
horrible. They have terrible spectral response and are not very good
for higher frequencies. I'm not sure what this all means in terms of
how they sound, but I've got a solid grasp on how this problem works.
1st off: the number of computations is roughly linearly proportional
to the number of points, and the degree of the polynomial.
2nd: High frequency response can be obtained by increasing the number
of points, beyond the number of points required to constrain the
problem for a given degree of polynomial.
3rd: The set of functions specifying the impulse response as sums of
(|t|-a)^n*(|t| < a) should be used to construct interpolating
polynomials for two clear reasons. First, the lowest degree of
polynomial, n, that is used determines the number of continuous
derivatives (for n=2, there is 1 continuous derivative, for n=4, there
are 3 continuous derivatives). Second, n determines the fastest
possible rate of attenuation in the stop-band (for n=2, 1/w^3, for
n=4, 1/w^5, etc...)
In the accompanying graphs, the newest spectrum has been added in magenta.
And the question is, where do we go from here.... are there any
remaining problems with tabread's? Is the high-frequency response
good enough? Do we need faster attenuation?
I think there is little point in trying to increase the rate of
attenuation. 1/w^3 is good for a fast interpolator..... 1/w^5
should be good enough for a high-accuracy interpolator (in my
opinion).... so if this were carried out to 8-point, 10-point and so
on.... we could get better high-frequency response..... ahhhh..... I
don't know!
Chuck
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spectrum_tab6.png
Type: image/png
Size: 19066 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20080719/a3efe057/attachment.png>
More information about the Pd-list
mailing list