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 #69199 is a reply to message #69197] Fri, 18 December 2009 05:05 Go to previous messageGo to previous message
lbusett@yahoo.it is currently offline  lbusett@yahoo.it
Messages: 30
Registered: February 2006
Member
Hi Simona,

in the Help of the smooth function it is said that "If a Width
value is even, then Width+1 will be used instead."
so I think that if you are using an even number as width you should
modify both the line:

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

with

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

, and the line:

for i=(width)/2,n-(width)/2-1,1 do begin

with

for i=(width+1)/2,n-(width+1)/2-1,1 do begin

Otherwise, you can leave the program as in the original post and just
add the command "width = width + 1" before the for loop.

Hope this helps,

Lorenzo
[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:19:02 PDT 2025

Total time taken to generate the page: 0.00365 seconds