[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: very fast spline interp function for heavy oversampling?
Peter Suetterlin wrote:
> In article <7nS35.firstname.lastname@example.org>,
> "R.G. Stockwell" <email@example.com> writes:
> > Greetings,
> > I have a situation where I take a time series, and need to interpolate the
> > function to many more samples.
> > i.e. original time index = [1,2,3,4....10]
> > and I need samples at new time index =
> > [1.000,1.001,1.002.......9.999,10.000].
> You could try fourier interpolation by zero padding, i.e. calculating
> the FFT and insert zeroes (remember the ordering inthe fft!) for the
> high frequency terms, then transform it back.
I think this is a much better suggestion than using spline interpolation
- unless the data you're fitting is very smooth - particularly when
you're dealing with time series/sampling issues. Unfortunately,
depending on how many interpolates you want (i.e. the number of points
can't be factored into primes easily) it can be slow. You also have to
be careful how you perform the interpolation and be cognisant of the
artifacts that can be introduced by fourier interpolation (ringing, or
Gibb's phenomena, for example).
I may be overly cautious, but I *never* use spline interpolation for
interpreting data (but I don't know what you're doing with your
re-interpolated data). If you're at all interested, I have a routine
that performs fourier interpolation (fourier_interpolate.pro) on high
resolution IR spectra - you can find it (and the other routines it
Follow the "Spectral" link. Note that a cosine filter is applied to the
edges of the input to minimise ringing.
p.s. what's the go with all the "remove this text from email address for
reply" that people do nowadays? Are they getting that badly spammed?
Paul van Delst Ph: (301) 763-8000 x7274
CIMSS @ NOAA/NCEP Fax: (301) 763-8545
Rm.202, 5200 Auth Rd. Email: firstname.lastname@example.org
Camp Springs MD 20746