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