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

Home » Public Forums » archive » Re: Roundoff error in SMOOTH
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
Re: Roundoff error in SMOOTH [message #15480] Wed, 26 May 1999 00:00
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
landsman@stars.gsfc.nasa.gov (Wayne Landsman) writes:

> I was recently surprised to discover that applying the SMOOTH function to a
> non-negative array could yield an array with negative numbers. I give an
> example below. This problem is evidently due to some sort of roundoff error,
> since it does not occur when using double precision. But it is not obvious to
> me how averaging 9 non-negative numbers (for a 3x3 box smooth) could yield a
> negative number, even allowing for roundoff error.

> Although not obvious from my simple example, this has nothing to do with edge
> effects -- I originally found the problem when 3x3 smoothing a 1024 x 1024
> array.

(rest deleted)

My theory is that the SMOOTH function probably uses Fourier transforms to speed
up the convolution, and this is where the round-off error is sneaking in.

Bill Thompson
Re: Roundoff error in SMOOTH [message #15484 is a reply to message #15480] Wed, 26 May 1999 00:00 Go to previous message
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
In article <26MAY199915495025@stars.gsfc.nasa.gov>, landsman@stars.gsfc.nasa.gov (Wayne Landsman) writes...
> I was recently surprised to discover that applying the SMOOTH function to a
> non-negative array could yield an array with negative numbers. I give an
> example below.

I forgot to include the IDL !VERSION used in my example:
{ sparc sunos unix 5.2 Oct 30 1998}

Testing the same example on VMS IDL V4.0.1, I still get negative numbers
although not as many!

--Wayne Landsman landsman@mpb.gsfc.nasa.gov
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL 5.2 GUI Builder Tutorial ?
Next Topic: Truetype font ordering

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

Current Time: Wed Oct 08 13:42:19 PDT 2025

Total time taken to generate the page: 0.00591 seconds