comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Interpol asymmetric?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Interpol asymmetric? [message #80271] Thu, 24 May 2012 16:01 Go to next message
Christian is currently offline  Christian
Messages: 11
Registered: March 2012
Junior Member
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...
Re: Interpol asymmetric? [message #80344 is a reply to message #80271] Fri, 25 May 2012 10:52 Go to previous message
Kenneth P. Bowman is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: ps_start and color
Next Topic: question about plots/arrow command!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:43:05 PDT 2025

Total time taken to generate the page: 0.00626 seconds