comparison man/man1/merge.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 MERGE 1 "15 September 1993"
2
3 .SH NAME
4 merge \- Merge N streams onto stdout using a given operator.
5
6 .SH SYNTAX
7 merge [options] file1 file2 ... fileN
8
9 .SH DESCRIPTION
10
11 Extract items of given data type from file1 to fileN, merge them
12 N-wise using the given operation, and write the result on the stdout as
13 items of the same type as that selected for input.
14
15 .SH OPTIONS
16
17 1. type
18
19 The input/output data type. Allowable types are: char, short, int, float,
20 double, ASCII (one number per line).
21
22 2. operator
23
24 For each vector of items (p1,p2,...,pN) read from file1, file2,...,fileN
25 respectively write the result of a merging operation on the stdout.
26 The operation is selected using the
27 option "operator=<op>". The <op> may be one of the following strings
28 (which may be abbreviated provided this is unambiguous):
29
30 .nf
31 <op> comment
32
33 cat concatenate p1,p2,p3,...,pN
34 add p1+p2+p3+...+pN
35 subtract p1-p2-p3-...-pN
36 abs |...||p1-p2|-p3|-...-pN|
37 multiply p1*p2*p3*...*pN
38 divide p1/p2/p3/.../pN
39 max max(p1,p2,p3,...,pN)
40 min min(p1,p2,p3,...,pN)
41 mean ( p1+p2+p3+...+pN ) / N
42 norm sqrt( p1*p1 + p2*p2 + p3*p3 + ... + pN*pN )
43 .fi
44
45
46 3. range
47
48 The `range' option sets the start and duration of the merge process.
49 Samples in a file are numbered 0,1,2,...,max, and the range option delimits
50 input from all input files inclusively. Its arguments are of the form:
51
52 .nf
53 range=a-b setting start=a and duration=b-a+1
54 range=a setting start=a and duration=1
55 .fi
56
57 The arguments can be in time units (ms, s) or samples (no units), and both
58 "min" (start of file) and "max" (end of file) are recognised.
59 Arguments with time units are converted to samples using the given
60 `samplerate' option.
61
62 4. phase
63
64 The `phase' option shifts the origin to introduce a phase difference between
65 files. The `phase' option takes a comma-separated list of
66 arguments which must be the same length as the number of file arguments.
67 Each argument can be in time units (ms, s) or samples (no units).
68 Arguments with time units are converted to samples using the given
69 `samplerate' option.
70
71 All files are interpreted as functions sampled with origin at the point in
72 the file given by the first argument of the `range' option.
73 The functions are assumed to be zero for all samples beyond those specified
74 in the files.
75 A positive phase advances the origin into the file,
76 and this initial lead is skipped before the merging process begins.
77 A negative phase retards the origin, and this lag is included at the
78 beginning of the merging process.
79 If a negative phase in combination with
80 the start of the file as set by the `range' option shifts the origin
81 outside the specified file, then the difference is padded with zeroes.
82
83 5. weights
84
85 The weights option takes as argument a comma-separated list of real numbers
86 which must be the same length as the number of file arguments.
87 These number are applied as weighting factors to each item prior to the
88 merging operation.
89
90 6. scale
91
92 Internal processing is in floating point. A scale factor is included to
93 avoid overflow when casting output data.
94 If 16-bit over or under-flow occurs a warning is printed on the stderr.
95
96
97 .SH EXAMPLES
98
99 1. Pairwise concatenation to form coordinate (x,y) pairs from two files.
100
101 .nf
102 merge op=cat file.x file.y > file.xy
103 .fi
104
105 2. Pooling data to form an average.
106
107 .nf
108 merge op=mean file1 file2 ... fileN > Pool
109 .fi
110
111 3. Weighted linear combination of three files using weight vector (1.0,-2.4,0.05).
112
113 .nf
114 merge op=add weights=1.0,-2.4,0.05 file1 file2 file3
115 .fi
116
117 4. Modulation of one signal file by another. In this example the second file
118 is given a 20ms lag with respect to the first, and this lag will be padded
119 with zeroes.
120
121 .nf
122 merge op=mult phase=0,-20ms file1 file2
123 .fi
124
125
126
127 .SH "SEE ALSO"
128
129 options op
130
131 .SH COPYRIGHT
132 .LP
133 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
134 .LP
135 Permission to use, copy, modify, and distribute this software without fee
136 is hereby granted for research purposes, provided that this copyright
137 notice appears in all copies and in all supporting documentation, and that
138 the software is not redistributed for any fee (except for a nominal
139 shipping charge). Anyone wanting to incorporate all or part of this
140 software in a commercial product must obtain a license from the Medical
141 Research Council.
142 .LP
143 The MRC makes no representations about the suitability of this
144 software for any purpose. It is provided "as is" without express or
145 implied warranty.
146 .LP
147 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
148 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
149 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
150 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
151 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
152 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
153 SOFTWARE.
154