Hello Do any of you smart, crusty old types have a rule of thumb for figuring out the smallest length for which a sinc interpolator is more effective than something like a linear (or in my 2D case, bilinear) interpolator? Ie, "n samples works when there are k periods in that length n window", or something along that line. I suppose for the moment it is reasonable to say that the data is bandlimited.
Minimum useful sinc length
Started by ●June 4, 2009
Reply by ●June 4, 20092009-06-04
On Jun 4, 5:46�pm, "alexryu" <ryu.a...@gmail.com> wrote: ..> Do any of you smart, crusty old types have a rule of thumb for figuring > out the smallest length for which a sinc interpolator is more effective > than something like a linear (or in my 2D case, bilinear) interpolator? > Ie, "n samples works when there are k periods in that length n window", or > something along that line. �I suppose for the moment it is reasonable to > say that the data is bandlimited.i think some commercial ASRC chips have had 64-tap FIR filters which implies a sinc(x) (with the pi in it) ranging from -32 to +32. now it's unlikely that just windowing that sinc will be the absolute best (in stopband attenuation which affects SNR). designing this "sinc- like" function (or h(t)) with something like Park-McClellan or least- square error fit might be better than a windowed sinc(), but if you do make it a windowed sinc, probably use the Kaiser window with that beta factor around 5 (i don't remember exactly). now there is also the number of places that you sample that windowed sinc. this means the number of different fractional delays or phases. now, if you linearly interpolate between neighboring discrete delays, you probably only need to sample that at an upsample rate of 512 (32 K words total). but linearly interpolating means you evaluate the FIR calculation twice. making it 128 MACs per sample-channel instead of 64. otherwize, if you have a lot of memory to waste, you can upsample by a factor of 512K (32 Meg words) and use "drop-sample" interpolation (which is none at all). then it's only 64 MACs per sample-channel, less computation for more space. r b-j
Reply by ●June 5, 20092009-06-05
alexryu wrote:> Hello > Do any of you smart, crusty old types have a rule of thumb for > figuring out the smallest length for which a sinc interpolator is > more effective than something like a linear (or in my 2D case, > bilinear) interpolator? Ie, "n samples works when there are k periods > in that length n window", or something along that line. I suppose > for the moment it is reasonable to say that the data is bandlimited.I think it's important to focus on the interpolation factor and the underlying data / sample rate. You probably know a lot of this but just to be complete: If the data is bandlimited and the band limit is related to the original sample rate then sincs can be used to "reconstruct" which means infinite interpolation factor. - Convolution in time with a sinc. - Perfect lowpass filter of the samples in frequency. Now, if you're doing a practical version of this then the sincs will be time-limited and your question surely applies. Let's start with the idea of a localized interpolation about a trio of samples: - each of the samples in the entire sequence contribute a sinc component in between the samples to be interpolated. - if the distant samples are equal for some reason then their respective sinc contributions will largely cancel because the sidelobes alternate in sign at the frequency of the samples. So, you might want to decide how much energy is distant and how much difference distant samples should really make. To get a feel for this, take a couple of adjacent sincs and add them together to see what the residual is. Of course, if there's an antisymmetric doublet of samples then the sinc sidelobe magnitudes will add. Perhaps that's not what you have in mind. So, here's another case: Let's say that the interpolation factor is 2 - meaning you want to double the sample rate. A common way of doing this in frequency is to repeat the frequency samples so there are twice as many and then lowpass filter the result to take out the "middle" part at the old fs or the new fs/2. The time domain equivalent is to intersperse the samples with zeros and then lowpass the result to get interpolated values in place of the zero values. This could be done by convolving with a sinc-like sequence which is at the new sample rate. The filter unit sample response looks like this: o | | | | | < | | o | o | | | o | | | o | | | | | o---o---o---+---o---o---o- | time -> | o o This is the unit sample response of a halfband filter. The length of the filter can be anything you want. Note that a length 3 halfband filter also looks like a 1/2 1 1/2 filter which is a linear interpolator - when you're "on" the sample it's weighted by 1, when you're "off" one of the original samples the output is the sum of 1/2 X each of the adjacent samples. There's a halfband filter .exe program at: ftp://ftp.mission-systems-inc.com/outgoing/Halfband/ email me for login. Fred
Reply by ●June 5, 20092009-06-05
alexryu wrote:> Hello > Do any of you smart, crusty old types have a rule of thumb for > figuring out the smallest length for which a sinc interpolator > is more effective than something like a linear (or in my 2D > case, bilinear) interpolator?This article has a formula for the minimum length as a function of passband and transition widths, attenuation, and the specific applied window's parameter: http://www.hindawi.com/getarticle.aspx?doi=10.1155/asp.2005.1910 Also of possible interest: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.79.2898 http://dx.doi.org/10.1109/42.932749 Martin -- Quidquid latine scriptum est, altum videtur.
Reply by ●June 5, 20092009-06-05
alexryu wrote:> Hello > Do any of you smart, crusty old types have a rule of thumb for figuring > out the smallest length for which a sinc interpolator is more effective > than something like a linear (or in my 2D case, bilinear) interpolator? > Ie, "n samples works when there are k periods in that length n window", or > something along that line. I suppose for the moment it is reasonable to > say that the data is bandlimited.I do, but I would need to be addressed a little more respectfully before I considered sharing it with you.
Reply by ●June 5, 20092009-06-05
On Jun 5, 8:58�pm, John Monro <johnmo...@optusnet.com.au> wrote:> alexryu wrote:...> > Do any of you smart, crusty old types have a rule of thumb for figuring > > out ......> I do, but I would need to be addressed a little more > respectfully before I considered sharing it with you.are you serious, John? this wasn't bad. i've seen worse. ... here at comp.dsp. r b-j
Reply by ●June 6, 20092009-06-06
robert bristow-johnson wrote:> On Jun 5, 8:58 pm, John Monro <johnmo...@optusnet.com.au> wrote: >> alexryu wrote: > ... >>> Do any of you smart, crusty old types have a rule of thumb for figuring >>> out ... > ... >> I do, but I would need to be addressed a little more >> respectfully before I considered sharing it with you. > > are you serious, John? this wasn't bad. > > i've seen worse. > > > > ... here at comp.dsp. > > r b-jYou're quite right Robert, it wasn't bad at all. It did irritate me a little though -- enough for me to decide not to contribute. I thought I would be a good idea to tell alexryu why, but maybe I could have phrased it in a way that was more friendly to the young whippersnapper :=) Regards, John
Reply by ●June 6, 20092009-06-06
John Monro wrote:> robert bristow-johnson wrote: >> On Jun 5, 8:58 pm, John Monro <johnmo...@optusnet.com.au> wrote: >>> alexryu wrote: >> ... >>>> Do any of you smart, crusty old types have a rule of thumb for >>>> figuring out ... >> ...I just thought it was a nod to the likelihood that some of us might be ..... Otherwise, to me it was metaphorical where "smart, crusty old" just referred to "wise" or "experienced" which need not really mean "old". Fred
Reply by ●June 6, 20092009-06-06
I would like to thank everyone for their helpful advice, and apologize to those smooth-skinned, clear-eyed practitioners who possess wisdom far beyond their years that I might have inadvertently offended.
Reply by ●June 6, 20092009-06-06






