DSPRelated.com
Forums

sample rate conversion: Windowed-Sinc v.s. Lagrange v.s. B-Spline?

Started by lighthsu November 8, 2005
robert bristow-johnson wrote:
> in article hjvcf.26188$Q27.17475@trnddc02, Jon Harris at > jon99_harris7@hotmail.com wrote on 11/09/2005 18:07: > > > "Ron N." <rhnlogic@yahoo.com> wrote in message > > news:1131574772.921278.226370@g44g2000cwa.googlegroups.com... > >> robert bristow-johnson wrote: > >>> now, in my opinion, for an arbitrary sampling rate conversion ratio, i think > >>> the simplest and best method is to use a lookup table based (Kaiser windowed > >>> sinc or alternatively an optimally designed LPF) interpolation with a high > >>> but finite upsampling ratio and then use linear interpolation in between. > >> > >> How wide a windowed sinc is required to match a given order of > >> polynomial interpolator? e.g. would some 4.5 sample-width windowed > >> sinc FIR filter match a 3-rd order spline interpolation in quality, > >> given that they use the same number of input sample points? > >> Or would the windowed sinc need to be wider than the polynomial > >> interpolator. > > > > For the same number of input sample points (or taps), an optimally designed > > low-pass filter is going to be better than Lagrange interpolation, at least in > > terms of pass-band flatness and stop-band rejection. Plus, you can tune the > > filter to give you exactly what you want, rather than relying on what the > > frequency characteristics of a particular polynomial happen to be. I don't > > know about other types of splines, I've worked mostly with Lagrange. And the > > windowed sinc with a well-chosen window can be very close to the optimally > > designed filter. > > for table lookup, an optimally designed filter (using Parks-McClellan or, > perhaps, Least Square Error) will be better than a Kaiser windowed sinc() > besides being better than the polynomial interpolation. > > the advantage of polynomial interpolation is that it can have infinite > precision in its fractional time index where a table lookup is, of course, > discrete.
The precision of a polynomial interpolation will be limited to the number of bits in your fixed or floating point data type. The same precision (maybe minus a bit or two) is often available from most trig or bessel math libraries, so windowed sinc interpolation will have essentially the same precision available. Of course, if performance requires it, you could implement a lower precision math library using table lookup plus table interpolation (by storing finite difference tables, for instance). My question was how well this interpolation method works with a very small number of sample points (3,4, or 5, for instance) used for each interpolation. IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M
in article 1131754659.231097.24780@z14g2000cwz.googlegroups.com, Ron N. at
rhnlogic@yahoo.com wrote on 11/11/2005 19:17:

> robert bristow-johnson wrote:
...
>> >> the advantage of polynomial interpolation is that it can have infinite >> precision in its fractional time index where a table lookup is, of course, >> discrete. > > The precision of a polynomial interpolation will be limited to > the number of bits in your fixed or floating point data type.
but that's true for any of the interpolation methods. that (coefficient quantization, word width, etc.) is a different, sorta peripheral issue. my point was addressed to the possible question of why we would want to use polynomial interpolation at all, in the first place. and the answer is, you can calculate the coefficients on-the-fly, no matter where your instantaneous fractional time ends up. you can't do that for table lookup (unless you interpolate, but how would you do that which brings us back to the initial issue of why we would use piecewise polynomial interpolation in the first place). the word size for that time is another issue completely. let's assume it is infinite precision. ...
> My question was how well this interpolation method works with > a very small number of sample points (3,4, or 5, for instance) > used for each interpolation.
well, that paper Duane and i did does it for 4 sample points and it has some concrete results. Olli's paper has more results. it's not so great, unless the upsample ratio is large. but then how come the idea was only to apply that to oversampled cases in the first place. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
lighthsu wrote:
> Hi all, > I'm working on a DSP project, which needs an arbitrary sampling rate > converter. > I searched several interpolation algorithms - windowed-sinc, Lagrange, and > B-Spline. However, I can't determine which algorithm is suitable for > low-ordered interpolation filter. > According to my understanding, the performance of windowed-sinc > interpolation(with table look-up) can be easily estimated by the > specification of window(filter order, transition bandwidth, and stopband > attenuation are trade-off). But I can't estimate the performace of > Lagrange and B-Spline interpolater. > Is there any document or paper about the performance of Lagrange and > B-Spline interpolaters? I need the informations about filter order, > transition bandwidth, and stopband attenuation of these interpolation > algorithms. > > Thanks a lot for your help!! :) > > Sincerely yours, > Light Hsu
um.. if i got it right, you're trying to make some that can resample a signal to any specified length. i think I know how to do it (disclaimer : i'm a newbie and often am wrong or off-topic :-)). I just do the FFT of the signal i want to resample, I cut off samples in the highest frequencies if i want to shorten it or i zero-pad the real and imaginary bins if i want to make the signal longer and the I perform an IFFT.