annotate man/man1/stats.1 @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
rev   line source
tomwalters@0 1 .TH STATS 1 "1 September 1993"
tomwalters@0 2
tomwalters@0 3 .SH NAME
tomwalters@0 4 stats \- calculate some statistics.
tomwalters@0 5
tomwalters@0 6 .SH SYNTAX
tomwalters@0 7 stats [options] [file]
tomwalters@0 8
tomwalters@0 9 .SH DESCRIPTION
tomwalters@0 10 Calculate statistics for given frames of each input file and write the
tomwalters@0 11 results on the stdout.
tomwalters@0 12 If no filenames are given, one input file is expected on the stdin.
tomwalters@0 13 Otherwise each given filename is processed in turn.
tomwalters@0 14
tomwalters@0 15 .SH OPTIONS
tomwalters@0 16
tomwalters@0 17 1. frame, width, samplerate
tomwalters@0 18
tomwalters@0 19 The `frame' option selects a sequence of contiguous frames for processing by:
tomwalters@0 20
tomwalters@0 21 .nf
tomwalters@0 22 frame=a[-b]
tomwalters@0 23 .fi
tomwalters@0 24
tomwalters@0 25 where `a' and `b' are frame numbers: 1,2,3,...,max The upper limit `b' is
tomwalters@0 26 optional, and when it is missing then the frame sequence is a single
tomwalters@0 27 frame, otherwise `a' and `b' are inclusive limits. The strings "min"
tomwalters@0 28 and "max" are recognised as extreme limits.
tomwalters@0 29 Each frame has size `width' samples which
tomwalters@0 30 may be given with time units (s or ms), in which case the they
tomwalters@0 31 are converted to a number of samples using the given `samplerate' option.
tomwalters@0 32 The special option value "width=max" is interpreted as a single frame covering
tomwalters@0 33 the whole file.
tomwalters@0 34
tomwalters@0 35 2. type
tomwalters@0 36
tomwalters@0 37 Datatype for both input and output. Binary types are char, short, int, float, double.
tomwalters@0 38 Ascii input (one number per line) is recognised with "type=ascii".
tomwalters@0 39
tomwalters@0 40 3. stat
tomwalters@0 41
tomwalters@0 42 The statistics available to the `stat' option are:
tomwalters@0 43
tomwalters@0 44 .nf
tomwalters@0 45 n sample (ie. data set) size
tomwalters@0 46 sum area
tomwalters@0 47 ss sum of squares
tomwalters@0 48 mean sum/n
tomwalters@0 49 rms root mean square: square root of ss/n
tomwalters@0 50 variance computed with n-1 degrees of freedom
tomwalters@0 51 stddev standard deviation: square root of variance
tomwalters@0 52 min minimum value
tomwalters@0 53 max maximum value
tomwalters@0 54 absmax maximum absolute value, ie. max( |max|, |min| )
tomwalters@0 55 range max-min
tomwalters@0 56 .fi
tomwalters@0 57
tomwalters@0 58
tomwalters@0 59 The variance is the average squared deviation from the mean value, where the
tomwalters@0 60 average is computed by dividing by n-1 for a data set of n samples.
tomwalters@0 61 The stddev is the square root of this variance.
tomwalters@0 62 The stddev would be equal to the rms value for a data set with zero mean,
tomwalters@0 63 except that the average squared value is computed using ss/n, while the
tomwalters@0 64 average squared deviation from a zero mean value is computed using ss/(n-1).
tomwalters@0 65
tomwalters@0 66 Statistics may be given in a comma separated list, for example:
tomwalters@0 67
tomwalters@0 68 .nf
tomwalters@0 69 stats stat=mean,variance,min,max
tomwalters@0 70 .fi
tomwalters@0 71
tomwalters@0 72 For each frame of each input file this will output the four statistics in the
tomwalters@0 73 data type selected by the `type' option.
tomwalters@0 74
tomwalters@0 75 4. line
tomwalters@0 76
tomwalters@0 77 When line=on (or -l) output is forced to be ascii irrespective of the `type' option,
tomwalters@0 78 and for each file argument in turn stats prints the statistics requested,
tomwalters@0 79 in the order they were requested, on one line.
tomwalters@0 80 This makes a table (one line per file), and also helps subsequent operations
tomwalters@0 81 between statistics. For example, the standard error of the mean (the stddev
tomwalters@0 82 divided by the square root of the sample size) can be computed:
tomwalters@0 83
tomwalters@0 84 .nf
tomwalters@0 85 stats -l stat=stddev,n | awk '{ print $1 / sqrt($2) }'
tomwalters@0 86 .fi
tomwalters@0 87
tomwalters@0 88 Tables can be formatted using field-width and precision arguments which are
tomwalters@0 89 included as silent options. For example, to format columns with a precision
tomwalters@0 90 of 4 decimal places with each number right-justified in a field-width of
tomwalters@0 91 12 characters:
tomwalters@0 92
tomwalters@0 93 .nf
tomwalters@0 94 stats -l fieldwidth=12 precision=4
tomwalters@0 95 .fi
tomwalters@0 96
tomwalters@0 97 The columns may be left-justified by making the fieldwidth parameter negative.
tomwalters@0 98 Output is truncated to integers by setting the precision parameter 0.
tomwalters@0 99 For example, to print the sample size of each file as an integer without
tomwalters@0 100 setting in a field:
tomwalters@0 101
tomwalters@0 102 .nf
tomwalters@0 103 stats -l fieldwidth=0 precision=0 stat=n [files]
tomwalters@0 104 .fi
tomwalters@0 105
tomwalters@0 106 .SH "SEE ALSO"
tomwalters@0 107 .LP
tomwalters@0 108 options
tomwalters@0 109 .SH COPYRIGHT
tomwalters@0 110 .LP
tomwalters@0 111 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
tomwalters@0 112 .LP
tomwalters@0 113 Permission to use, copy, modify, and distribute this software without fee
tomwalters@0 114 is hereby granted for research purposes, provided that this copyright
tomwalters@0 115 notice appears in all copies and in all supporting documentation, and that
tomwalters@0 116 the software is not redistributed for any fee (except for a nominal
tomwalters@0 117 shipping charge). Anyone wanting to incorporate all or part of this
tomwalters@0 118 software in a commercial product must obtain a license from the Medical
tomwalters@0 119 Research Council.
tomwalters@0 120 .LP
tomwalters@0 121 The MRC makes no representations about the suitability of this
tomwalters@0 122 software for any purpose. It is provided "as is" without express or
tomwalters@0 123 implied warranty.
tomwalters@0 124 .LP
tomwalters@0 125 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
tomwalters@0 126 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
tomwalters@0 127 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
tomwalters@0 128 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
tomwalters@0 129 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
tomwalters@0 130 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
tomwalters@0 131 SOFTWARE.
tomwalters@0 132