Changeset 398


Ignore:
Timestamp:
06/01/2011 04:35:00 PM (12 years ago)
Author:
marcus
Message:

r219 | walther | 2011-06-01 16:33:50 +0200 (Mi, 01 Jun 2011) | 7 lines

  • Introduced tweo qualifiers for the changed behaviour of RMS. Details see http://www.seismic-handler.org/portal/ticket/36. "SRS" simulates one alternative of the unpredictable result of the 2008 version. The other alternative is covered using no qualifier at all. "SAM" simulates the processing of versions before 2007.
  • Updated RMS help file.
Location:
SH_SHM/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/help/RMS.HLP

    r392 r398  
    44key: compute RMS 
    55 
    6 Computes RMS value for a trace or a part of a trace (sums all squared samples, 
    7 divides through number of samples and takes square root).  The resulting value 
    8 is copied to the symbol specified or written to screen. 
     6Computes root mean square value for a trace or a part of a trace (sums all 
     7squared samples, divides through number of samples and takes square root). 
     8The resulting value is copied to the symbol specified or written to screen. 
    99 
    1010parameters 
     11---------- 
    1112 
    1213<trc>  ---  parameter type: trace 
     
    2021   Variable to take the resulting rms value. 
    2122 
     23qualifiers 
     24---------- 
    2225 
     26/srs 
     27   Compute just the square root sum of the trace. 
    2328 
    24 Examples: 
     29/sam 
     30   Compute a "squared arithmetic mean" by summing all squared samples, taking 
     31   square root and dividing through number of samples. This was the standard 
     32   behaviour in versions before 2007 (but it violates the definition of RMS). 
     33 
     34For more information on these qualifiers please read the support ticket #36: 
     35 http://www.seismic-handler.org/portal/ticket/36 
     36 
     37examples 
     38-------- 
    2539 
    2640   RMS 1 ;;; &g1    ! computed RMS value of whole trace 1 and puts result 
  • SH_SHM/trunk/source/shmenux.c

    r373 r398  
    13491349        char     symbol[BC_LINELTH+1];   /* symbol name */ 
    13501350        char     str[BC_LINELTH+1];      /* scratch string */ 
     1351        int      mode;                   /* mode of operation */ 
    13511352 
    13521353        /* executable code */ 
     1354 
     1355        /* Compute rms. For more information about rms trouble please see 
     1356         * http://list.seismic-handler.org/pipermail/users/2011-May/000092.html 
     1357         * http://www.seismic-handler.org/portal/ticket/36 
     1358         * http://www.seismic-handler.org/portal/changeset/373 
     1359         */ 
     1360        mode = 0; 
     1361 
     1362        /* Compute square root sum of the trace. This computation is one of the 
     1363         * unpredictable possibilities in versions prior to revision 373. 
     1364         */ 
     1365        if  (cp_qexist(par,"SRS"))  
     1366            mode = 1; 
     1367 
     1368        /* Compute "squared arithmetic mean" of the trace. This was done in 
     1369         * older versions before version control was introduced. 
     1370         */ 
     1371        if  (cp_qexist(par,"SAM")) 
     1372            mode = 2; 
    13531373 
    13541374        if  (cp_pnexc(par,4,status))  return; 
     
    13781398                rms += dat[i]*dat[i]; 
    13791399 
    1380         rms = sqrt(rms / (SAMPLE)(hiidx-loidx+1) ); 
     1400        if (mode == 0) 
     1401            rms = sqrt(rms / (SAMPLE)(hiidx-loidx+1) ); 
     1402        else if (mode == 2) 
     1403            rms = sqrt(rms) / (SAMPLE)(hiidx-loidx+1); 
    13811404 
    13821405        if  (cp_pentered(par,4,status))  { 
Note: See TracChangeset for help on using the changeset viewer.