next up previous [pdf]

Next: Implementation: system/main/attr.c Up: Main programs Previous: Implementation: system/main/add.c

sfattr: Display dataset attributes.

sfattr < in.rsf lval=2 want=
Sample output from "sfspike n1=100 | sfbandpass fhi=60 | sfattr"
*******************************************
     rms =      0.992354
    mean =      0.987576
  2-norm =       9.92354
variance =    0.00955481
 std dev =     0.0977487
     max =       1.12735 at 97
     min =      0.151392 at 100
nonzero samples = 100
  total samples = 100
*******************************************

rms                = sqrt[ sum(data^2) / n ]
mean               = sum(data) / n
norm               = sum(abs(data)^lval)^(1/lval)
variance           = [ sum(data^2) - n*mean^2 ] / [ n-1 ]
standard deviation = sqrt [ variance ]

int lval=2 norm option, lval is a non-negative integer, computes the vector lval-norm
string want= 'all'(default), 'rms', 'mean', 'norm', 'var', 'std', 'max', 'min', 'nonzero', 'samples', 'short' want= 'rms' displays the root mean square want= 'norm' displays the square norm, otherwise specified by lval. want= 'var' displays the variance want= 'std' displays the standard deviation want= 'nonzero' displays number of nonzero samples want= 'samples' displays total number of samples want= 'short' displays a short one-line version

sfattr is a useful diagnostic program. It reports certain statistical values for an RSF dataset: RMS (root-mean-square) amplitude, mean value, norm value, variance, standard deviation, maximum and minimum values, number of nonzero samples, and the total number of samples.

If we denote data values as $ d_i$ for $ i=0,1,2,\ldots,n$ , then the RMS value is $ \sqrt{\frac{1}{n} \sum\limits_{i=0}^n d_i^2}$ , the mean value is $ \frac{1}{n} \sum\limits_{i=0}^n d_i$ , the $ L_2$ -norm value is $ \sqrt{\sum\limits_{i=0}^n d_i^2}$ , the variance is $ \frac{1}{n-1} \left[\sum\limits_{i=0}^n d_i^2 - \frac{1}{n}\left(\sum\limits_{i=0}^n d_i\right)^2\right]$ , and the standard deviation is the square root of the variance. Using sfattr is a quick way to see the distribution of data values and check it for anomalies.



Subsections
next up previous [pdf]

Next: Implementation: system/main/attr.c Up: Main programs Previous: Implementation: system/main/add.c

2012-07-19