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