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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.