Ticket #36 (closed defect: invalid)

Opened 10 years ago

Last modified 10 years ago

RMS command: difference to older versions

Reported by: Franz Owned by: MarcusWalther
Priority: high Milestone:
Component: SH Severity: major
Keywords: Cc:

Description

From user's mailing list, see message http://list.seismic-handler.org/pipermail/users/2011-May/000092.html

There's a huge difference between recent new and old version using ShRms. The old result seems to be correct.

SeismicHandler version 5.0a 13-Jul-2006, Copyright (C) 2006
|sh> rms 1 0 3600
     rms: 9.336159e+00

SeismicHandler version 5.5 February-2011, Copyright (C) 2011
|sh> rms 1 0 3600
     rms: 2.505154e+03

Attachments

cf22c76e0c33c4fb96262638a28bd52b.png (1.0 KB) - added by MarcusWalther 10 years ago.
Wikipedia RMS formula

Change History

comment:1 Changed 10 years ago by MarcusWalther

  • Status changed from new to accepted

The difference also exists between version 2008 and 2011:

SeismicHandler version 5.0e 03-May-2008, Copyright (C) 2006
|sh> cresharp
|sh> rms 1 ;;;
   rms: 8.657193e+01

SeismicHandler version 5.5 February-2011, Copyright (C) 2011

|sh> cresharp
|sh> rms 1 ;;;
   rms: 2.942311e-01

So it should be related to a chance in or after 2008...

comment:2 Changed 10 years ago by MarcusWalther

This chance seems to be related to the fix in r373. Since the symbol "mean" was uninitialized, the result of RMS was unpredictable.

comment:3 Changed 10 years ago by MarcusWalther

For the records another result of CRESHARP test:

The value for the 2006 version is rms: 9.304403e-03

comment:4 follow-up: ↓ 5 Changed 10 years ago by MarcusWalther

Explaining the difference between 2008 and 2011:

If "main" was initialized with 0 at runtime, the summed values where not divided by sample number and square root was also not taken. If we catch up on these operations, we get in case of the CRESHARP test (1000 samples):

>>> import math
>>> "%e" % math.sqrt(8.657193e+01/1000)
'2.942311e-01'

This is the result of 2011 version. The result from 2006 cannot be explained that way.

comment:5 in reply to: ↑ 4 Changed 10 years ago by MarcusWalther

Replying to MarcusWalther:

If "main" was initialized with 0 at runtime, ...

Of course I meant "mean".

Changed 10 years ago by MarcusWalther

Wikipedia RMS formula

comment:6 Changed 10 years ago by MarcusWalther

  • Status changed from accepted to closed
  • Resolution set to invalid

Franz sent an explanation for the 2006 result. In this version the following code is executed:

>>> import math
>>> "%e" % (math.sqrt(8.657193e+01) / 1000)
'9.304404e-03'

The RMS value for a set of n values is defined as follows:

Wikipedia RMS formula

So the RMS in 2011 version is the only correct one.

comment:7 Changed 10 years ago by MarcusWalther

I introduced two qualifiers to the RMS command. "SRS" computes the square root sum of the trace (the false alternative in 2008 version) and "SAM" simulates the behaviour of the 2006 version.

Note: See TracTickets for help on using tickets.