Re: Interpolation question [message #49584 is a reply to message #25895] |
Wed, 02 August 2006 09:31   |
JD Smith
Messages: 850 Registered: December 1999
|
Senior Member |
|
|
On Wed, 02 Aug 2006 11:21:55 -0500, Mike Wallace wrote:
> I have an array that I need to interpolate and would like to find a
> semi-efficient way to do it. Well, almost anything would be more
> efficient than what I'm currently doing.
>
> I have an array of data and a corresponding array of times when the data
> was taken. I have a third array that represents the times that I want
> to calculate the interpolation. How can I easily (and efficiently)
> calculate the data points corresponding to that array?
>
>
> For example...
>
> data = [12, 6, 1, 4, 8, 8, 10]
> time = [ 0, 1, 4, 7, 8, 11, 14]
>
> Now, I say that I wanted to interpolate the data array but only
> calculate the interpolation for the time values in some new array...
>
> new_time = [1, 4, 5, 8, 9, 12]
new_data=interpol(float(data),time,new_time)
The float is needed or all calcs are done in integer space (probably not
what you want).
JD
|
|
|