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

Home » Public Forums » archive » Re: smooth function and rounding error
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: smooth function and rounding error [message #69200 is a reply to message #69199] Fri, 18 December 2009 03:19 Go to previous messageGo to previous message
simona bellavista is currently offline  simona bellavista
Messages: 56
Registered: December 2009
Member
thank you for your reply

> y will be of the same type as A, so int, float etc...

yes, anyway I am using double

>>   y[i]=total(A[i-width/2:i+width/2-1])/width
>
> I believe you want to divide by width+1, because you are considering

ok, I try also this, but according to the previous link it should be
just width, I am trying to follow closely the prescription they give
for smooth function. can you see any discrepancy between their recipe
and my implementation?

> A[i] in your total. A;so, be sure that width is a float!

actually it was a long(it is an even long),because I thought idl would
cast it automatically to double in division.

now I am casting it explicitly:

y[i]=total(A[i-width/2:i+width/2-1])/double(width)

or

y[i]=total(A[i-width/2:i+width/2-1])/double(width+1)

in both cases I cannot see any difference, relative errors always are
~10^-1

any suggestions/hints/comments?

I forgot to say I am on linux and using idl 7.0.3
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: array index summations
Next Topic: ROI points don't seem to get stored properly

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

Current Time: Wed Oct 08 18:18:53 PDT 2025

Total time taken to generate the page: 0.00595 seconds