Changeset 398
- Timestamp:
- 06/01/2011 04:35:00 PM (12 years ago)
- Location:
- SH_SHM/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SH_SHM/trunk/help/RMS.HLP
r392 r398 4 4 key: compute RMS 5 5 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.6 Computes root mean square value for a trace or a part of a trace (sums all 7 squared samples, divides through number of samples and takes square root). 8 The resulting value is copied to the symbol specified or written to screen. 9 9 10 10 parameters 11 ---------- 11 12 12 13 <trc> --- parameter type: trace … … 20 21 Variable to take the resulting rms value. 21 22 23 qualifiers 24 ---------- 22 25 26 /srs 27 Compute just the square root sum of the trace. 23 28 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 34 For more information on these qualifiers please read the support ticket #36: 35 http://www.seismic-handler.org/portal/ticket/36 36 37 examples 38 -------- 25 39 26 40 RMS 1 ;;; &g1 ! computed RMS value of whole trace 1 and puts result -
SH_SHM/trunk/source/shmenux.c
r373 r398 1349 1349 char symbol[BC_LINELTH+1]; /* symbol name */ 1350 1350 char str[BC_LINELTH+1]; /* scratch string */ 1351 int mode; /* mode of operation */ 1351 1352 1352 1353 /* 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; 1353 1373 1354 1374 if (cp_pnexc(par,4,status)) return; … … 1378 1398 rms += dat[i]*dat[i]; 1379 1399 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); 1381 1404 1382 1405 if (cp_pentered(par,4,status)) {
Note: See TracChangeset
for help on using the changeset viewer.