Changeset 398 for SH_SHM/trunk/source/shmenux.c
- Timestamp:
- 06/01/2011 04:35:00 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.