Re: Minimum and location of minimum through interpolation [message #79066] |
Mon, 30 January 2012 07:26  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Jan 30, 3:33 am, Els <elias.rous...@gmail.com> wrote:
> Here is where the problem are:
>
> Due to undersampling, the actual minimum standard deviation may occur between two x-values, so I want to determine this through interpolation. That is not so difficult, but one additional problem is that "x" is an angle, so I can have jumps from 360 deg to 0 deg. If the mimimum is around eg. 358 deg and I have undersampling, interpolation may give me a result of ~180 deg, which is obviously wrong.
You could try unwrapping your series first, for example by using
PHUNWRAP, and then doing your minimum-finding procedure with the
modified series.
Craig
http://www.physics.wisc.edu/~craigm/idl/math.html#PHUNWRAP
|
|
|
Re: Minimum and location of minimum through interpolation [message #79150 is a reply to message #79066] |
Mon, 30 January 2012 13:18  |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
On Jan 30, 10:26 am, Craig Markwardt <craig.markwa...@gmail.com>
wrote:
> On Jan 30, 3:33 am, Els <elias.rous...@gmail.com> wrote:
>
>> Here is where the problem are:
>
>> Due to undersampling, the actual minimum standard deviation may occur between two x-values, so I want to determine this through interpolation. That is not so difficult, but one additional problem is that "x" is an angle, so I can have jumps from 360 deg to 0 deg. If the mimimum is around eg. 358 deg and I have undersampling, interpolation may give me a result of ~180 deg, which is obviously wrong.
>
> You could try unwrapping your series first, for example by using
> PHUNWRAP, and then doing your minimum-finding procedure with the
> modified series.
>
> Craig
>
> http://www.physics.wisc.edu/~craigm/idl/math.html#PHUNWRAP
You could take the derivative of the std.dev. with respect to x and
find the points where ds/dx = 0. Obviously, that'll never happen (for
the undersampling issue you said), so instead interpolate that:
dsdx = deriv(x,std)
minx = interpol(x,dsdx,0.0)
Now, the catch is since there might be multiple extrema, you'll need
to be careful with this, but shouldn't be too hard. You just need to
find the points where the sign goes from negative to positive. If
your sample is smallish (say <10000), then you can probably do this by
a brute force search, and compare the sign of successive elements.
Every time you find a sign flip (in the right sense to avoid local
maxima), then log it. Next loop over the minima and do the above 2
lines.
Russell
|
|
|