DSPRelated.com
Forums

Sinc Interpolation

Started by Dhawan December 5, 2005
Hi

I have a data set obtained by combining elements from 3 different
arrays. The elements in each array are repeating at a same interval but
after combining the array, the data is not uniformaly spaced,e.g.
DATA1 = 0 10 20 30 40...
DATA2 = 2 4 6 8 10
DATA3 = 11 12 13 14 15...

combined data = 0 2 4 6 8 10 11 12 13 14 15 16....
And I have a complex value associated to each data value.

How can I interpolate my data sample using Sinc function? I dont know
how to use Sinc interpolator. Can anyone explain me the basics??

Thanks

Dhawan wrote:
> Hi > > I have a data set obtained by combining elements from 3 different > arrays. The elements in each array are repeating at a same interval but > after combining the array, the data is not uniformaly spaced,e.g. > DATA1 = 0 10 20 30 40... > DATA2 = 2 4 6 8 10 > DATA3 = 11 12 13 14 15... > > combined data = 0 2 4 6 8 10 11 12 13 14 15 16.... > And I have a complex value associated to each data value. > > How can I interpolate my data sample using Sinc function? I dont know > how to use Sinc interpolator. Can anyone explain me the basics??
Is the signal represented by the data bandlimited? If so, what is the maximum frequency present in the data? If it's not bandlimited (as per most samples in the real world) then what is the maximum frequency above which you don't care whether any energy at any frequencies above gets aliased into low frequency noise? That might tell you whether any of your data sets will produce useful results given traditional Sinc interpolation methods. IMHO. YMMV. -- rhn A.T nicholson d.O.t C-o-M
"Dhawan" <anshu.dhawan@gmail.com> wrote in message 
news:1133826794.043746.327610@f14g2000cwb.googlegroups.com...
> Hi > > I have a data set obtained by combining elements from 3 different > arrays. The elements in each array are repeating at a same interval but > after combining the array, the data is not uniformaly spaced,e.g. > DATA1 = 0 10 20 30 40... > DATA2 = 2 4 6 8 10 > DATA3 = 11 12 13 14 15... > > combined data = 0 2 4 6 8 10 11 12 13 14 15 16.... > And I have a complex value associated to each data value. > > How can I interpolate my data sample using Sinc function? I dont know > how to use Sinc interpolator. Can anyone explain me the basics??
For Data1, use a sinc that has zero spacing of 10 For Data2, use a sinc that has zero spacing of 2 For Data3, use a sinc that has zero spacing of 1 Interpolate each data set by convolving with a sinc - which is the same as a discrete sum of shifted/centered sincs on and weighted by the samples. After the data sets are interpolated, as long as you have maintained temporal registration, then you could add them together directly with no filtering required. You will choose the "output" sample rate ahead of time. This just means those points in time where you compute the discrete sum. Implied above is that the sample rate will be the same for all 3 data sets. So, it has to be at least the sample rate of Data3 (in which case you wouldn't have to interpolate Data3 at all). Or, it can be higher. You can see that the discrete sum of sinc terms looks like a convolution with a FIR filter. So, there are other FIR filters of finite length that might be better candidates than a pure sinc function. - One characteristic of interpolators is whether they preserve the values of the original samples at the original sample points. A sinc will do this as will other types like a half-band filter - whose unit sample response closely resembles a sinc. - Another characteristic is the frequency response as all interpolators look like a lowpass filter / thus have a sinc-type of unit sample response. - A sinc interpolation will have strong Gibbs phenomenon ringing at temporal transitions. Maybe you don't want that. - A sinc interpolation of finite length is really an approximation because the sinc has been truncated. So, you may get better characteristics overall with a FIR filter that is of finite length and is *designed* to be what you want. A framework for interpolation: INTERPOLATION OF TIME SAMPLES | | | | | | x x x x x x x | x |x x|x x|x x|x x|x x| | | x | | | | | | | | | | | | | | | | | x | | | | | | | | | | <-> | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | T | T | T | | | | | | | +-----------------------+ +-ooo-+-ooo-+-ooo-+-ooo-+-ooo-+ time -> 0 fs 2fs 3fs 4fs 5fs 1/T frequency -> Original samples <-> Original spectrum multiplied by this: convolved withthis: X * o o o o o o o o o o o o o o o | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-----------------------+ +-----------------------|------> time -> 0 frequency -> fs=4/T yields: yields: V V x x x x x x x | x |x x|x x|x x|x x|x x| | | x | | | | | | | | | | | | | | | | | x | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-o-o-o---o-o-o---o-o-o-+ |-ooo-+-ooo-+-ooo-+-ooo-|-ooo-+ time -> 0 frequency -> fs=4/T Thus: adding zeros in time increases the sample rate without changing the frequency spectrum - only the perspective. Adding N zeros(e.g. 3) increases the sample rate by (N+1) (e.g. 4) Now, we will "zero out" the spectrum around the original fs, 2fs and 3fs to get a sequence that is sampled at 4fs. There are two ways to do this: - use a lowpass filter designed for this purpose. In this case an "eighth band" filter perhaps. - multiply the spectrum by a perfect frequency "gate" function. Samples Spectrum convolved by this: <-> multiplied by this: * X o ooooo ooooo | ||||| ||||| - | ||||| ||||| | ||||| ||||| | ||||| ||||| | <-> ||||| ||||| | ||||| ||||| | ||||| ||||| o | o ||||| ||||| | | | ||||| ||||| o | | | o ||||| ||||| | | | | | ||||| ||||| o---o---o---+---o---o---o- oooo|oooooooooooooooooooooo|ooooo+ | time -> | 0 frequency -> fs=4/T o o Yields: Yields V V X x x | x x x X x|x x|x | | | | | x x X | | | | | | | | x x | | | | | | | | | | | x X x | | | | | | | | | | | | | | | | | | <-> | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | T | | | | | | | | | | | | | | | +-----------------------+ - | --------------------- + - time -> 0 frequency -> fs=4/T The filtering process is more computationally intensive in that the frequency domain multiplication must actually be done. Of course, the frequency multiplication with zeros is so simple that it need not be done by multiplying at all! The issue with this process is that there may be time domain aliasing. How might this temporal aliasing be alleviated? Well, the problem with stuffing zeros in frequency is that the "gate" function we use conceptually for multiplying has a very long time sequence due to the sharp edges. A "real" filter doesn't have those sharp edges and some of the filters designed for this purpose actually have a double zero at fs/2, 3fs/2, 5fs/2, 7fs/2 - or even a higher order zero at this point. These zeros assure that there are no sharp edges of the filter. Sharp edges of a filter can truncate an otherwise "continuous" spectrum This creates temporal spreading the same way that a rectangular window in time will cause spectral spreading. Thus, temporal aliasing. How might we accomplish something very similar and still take advantage of the zero-multiplying process? First, note that if we filter a highly replicated spectrum then there are lots of points to compute. So, it may be more efficient to filter in stages so that the corresponding sample rate is doubled at each step. Also, we note that a sequence of time samples may or may not have come from a properly bandlimited signal. This has two effects: - the sampling will have caused spectral aliasing - the spectrum of the samples may be far from zero at fs/2. There is nothing to be done about the aliasing. However, if the spectrum of the samples is not zero at fs/2 then subsequent processing may introduce temporal aliasing. So, lowpass filtering of the data may be a good idea. Fred