comparison man/man1/scale.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
comparison
equal deleted inserted replaced
-1:000000000000 0:5242703e91d3
1 .TH SCALE 1 "1 September 1993"
2
3 .SH NAME
4 scale \- Shift and scale a binary stream by given constants or to
5 fit a given range (top - bottom).
6
7 .SH SYNTAX
8 scale [options] [file]
9
10 scale -h -for help with options and their defaults.
11
12 .SH DESCRIPTION
13 Shifting and scaling is done for all input x using the formula:
14 .nf
15 y = ( x - shift ) * scale
16 .fi
17
18 .SH OPTIONS
19
20 1. top, bottom.
21
22 If neither shift nor scale factor are given (ie. both options are "off"),
23 then values are
24 chosen so that the output fits the range specified by `top' and `bottom'.
25 For an input file which ranges between extreme values of `max' and `min', the
26 shift and scale factors to give a required range between `top' and `bottom'
27 are found by simultaneously solving:
28 .nf
29 top = ( max - shift ) * scale
30 bottom = ( min - shift ) * scale
31 .fi
32
33 If top < bottom then the input is inverted in the resulting range.
34
35 2. normalize.
36
37 Values of shift and scale are chosen so that the data is normalized for
38 zero mean and unit standard deviation.
39
40 .nf
41 shift = mean
42 scale = 1 / sqrt( variance )
43 .fi
44
45 3. shift, scale.
46
47 In either or both shift and scale are given (ie. are not "off") then
48 the formula is applied directly irrespective of any given top or bottom
49 parameters.
50 If only a shift term is given, then the default scale becomes 1.0.
51 If only a scale factor is given, then the default shift becomes 0.
52
53 4. type.
54
55 The input and output data type are selected using "type=<type>", where
56 <type> = { char, short, int, float, double, ASCII }.
57 The ASCII type is interpreted as one number per line.
58
59 5. output.
60
61 If no filename arguments are given to the program then one input file is
62 expected on the stdin, otherwise each given filename is input and scaled in
63 turn.
64 If "output=off" then program output overwrites each
65 respective input file. (The respective output for the stdin is the stdout).
66 If the `output' option is given a value (eg. output=filename) then this is
67 used as a filename and all scaled input files are written to this output file.
68 (The default output filename is the stdout).
69 Special value "output=print" suppresses output and prints the shift and
70 scale parameters on the stdout.
71
72 6. range.
73
74 The range option specifies the stretch of the wave for scaling and output by:
75
76 range=a[-b]
77
78 The upper limit `b' is optional, and when it is missing then the range
79 is a single sample, otherwise `a' and `b' are inclusive range limits.
80 The strings "min" and "max" are recognised as extreme limits ("min" =
81 start of file, "max" = end of file), otherwise the values of `a' and `b'
82 are sample numbers: 0,1,2,... Values given with time units (ms or s)
83 are converted to samples using the given samplerate option.
84
85 .nf
86 range=min-10ms -the first 10ms of each input file.
87 range=128-max -from the 128'th sample to the end of each file.
88 range=8ms-16ms -between 8ms and 16ms inclusive for each file.
89 .fi
90
91 .SH "SEE ALSO"
92 options op merge
93
94 .SH COPYRIGHT
95 .LP
96 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
97 .LP
98 Permission to use, copy, modify, and distribute this software without fee
99 is hereby granted for research purposes, provided that this copyright
100 notice appears in all copies and in all supporting documentation, and that
101 the software is not redistributed for any fee (except for a nominal
102 shipping charge). Anyone wanting to incorporate all or part of this
103 software in a commercial product must obtain a license from the Medical
104 Research Council.
105 .LP
106 The MRC makes no representations about the suitability of this
107 software for any purpose. It is provided "as is" without express or
108 implied warranty.
109 .LP
110 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
111 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
112 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
113 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
114 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
115 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
116 SOFTWARE.
117