Re: Interpol asymmetric? [message #80344 is a reply to message #80271] |
Fri, 25 May 2012 10:52  |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <bd3a5af7-01f3-47e5-94fe-d6b1078f286f@x6g2000pbh.googlegroups.com>,
Christian <christian.veenstra@gmail.com> wrote:
> I've traced some problems to an unlikely source... For me, INTERPOL
> does not always work symmetrically when using the quadratic setting!
> (ie - the reverse of the output from reversed input is not the same as
> the regular output). From the definition of what it's (supposed to be)
> doing in the documentation it seems that it should.
>
> For example, if I enter:
> test = [0,1,2,3,4,5,5,4,3,2,1,0]
> plot, interpol(test,100,/quad), psym=5
> oplot, interpol(test,100)
>
> I find that the peak produced by /quad is lopsided, with an extra
> bulge on the right hand side. This is using IDL 7.0. Presumably
> other people experience the same phenomena? I couldn't find any
> reference to this on the web - is this a known problem or maybe I
> misread the documentation? Any workaround? I would prefer to get
> what the left-hand side of this simple example looks like, but on both
> sides...
Quadratic interpolation uses three points, so the interpolation is necessarily
asymmetric.
That is, when you are interpolating in the interval between two points [x(i),
x(i+1)], does the third value come from the point to the left of the left-hand
point x(i-1), or to the right of the right-hand point x(i+2)?
I don't know which one INTERPOL uses, but in general you will get different
results if you reverse the data.
If symmetry is required, try odd-order interpolation (linear or cubic).
Ken Bowman
|
|
|