tomwalters@0: .TH GATE 1 "15 September 1993" tomwalters@0: tomwalters@0: .SH NAME tomwalters@0: gate \- gate specific numbers from the input stream. tomwalters@0: tomwalters@0: .SH SYNTAX tomwalters@0: gate [options] [file] tomwalters@0: tomwalters@0: .SH DESCRIPTION tomwalters@0: tomwalters@0: Numbers in the input stream within given gate ranges are replaced by a tomwalters@0: particular . Both time and amplitude ranges may be specified. tomwalters@0: The may be a real number or the result of a particular . tomwalters@0: Results are written on the stdout in numbers of the same type as that tomwalters@0: selected for input. tomwalters@0: tomwalters@0: .SH OPTIONS tomwalters@0: tomwalters@0: 1. xrange, yrange tomwalters@0: tomwalters@0: The `xrange' specifies the time range and the `yrange' specifies the tomwalters@0: amplitude range for the gating operation. Ranges are specified: tomwalters@0: tomwalters@0: .nf tomwalters@0: xrange=a[-b] tomwalters@0: yrange=a[-b] tomwalters@0: .fi tomwalters@0: tomwalters@0: The upper limit `b' is optional, and when it is missing then the range tomwalters@0: is a single number, otherwise `a' and `b' are inclusive range limits. tomwalters@0: The xrange limits are in samples (no units) or may take time units (s or ms), tomwalters@0: in which case they are converted to samples using the given `samplerate' tomwalters@0: option. The yrange limits are real numbers. tomwalters@0: The strings "min" and "max" are recognised as extreme limits: the start and tomwalters@0: end of the input stream for the xrange, and the most positive and negative tomwalters@0: amplitudes for the yrange. tomwalters@0: tomwalters@0: 2. value tomwalters@0: tomwalters@0: The may be a real number or an , tomwalters@0: in which case all input numbers within the gate range are operated on as tomwalters@0: appropriate. Abbreviated forms of the operation names are allowed. tomwalters@0: tomwalters@0: .nf tomwalters@0: : tomwalters@0: exclude exclude numbers in gate range from output tomwalters@0: negate negate numbers in gate range tomwalters@0: count print count of numbers in gate range on the stderr tomwalters@0: .fi tomwalters@0: tomwalters@0: 3. type tomwalters@0: tomwalters@0: The input and output datatype may be: char, short, int, float, double, ASCII. tomwalters@0: Ascii input is taken to be one number per line. tomwalters@0: tomwalters@0: .SH EXAMPLES tomwalters@0: tomwalters@0: 1. Replace all numbers <=0 by value 0 (ie. half-wave rectification). tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=min-0 val=0 file tomwalters@0: .fi tomwalters@0: tomwalters@0: 2. Replace all numbers <=0 by their inverse (ie. full-wave rectification). tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=min-0 val=neg file tomwalters@0: .fi tomwalters@0: tomwalters@0: 3. Gate the onset of a signal: replace the first 20ms with zeroes. tomwalters@0: tomwalters@0: .nf tomwalters@0: gate xrange=0-20ms yrange=min-max val=0 file tomwalters@0: .fi tomwalters@0: tomwalters@0: 4. Exclude all numbers <=0 tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=min-0 val=exclude file tomwalters@0: .fi tomwalters@0: tomwalters@0: 5. Exclude all numbers >0 tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=1-max val=exclude file tomwalters@0: .fi tomwalters@0: tomwalters@0: 6. Delete lines 4 to 8 inclusive from ascii input (lines numbered 0,1,2,...) tomwalters@0: tomwalters@0: .nf tomwalters@0: gate type=ASCII xrange=4-8 yrange=min-max val=exclude file tomwalters@0: .fi tomwalters@0: tomwalters@0: 7. Replace all numbers in the yrange -1 to +1 inclusive by 0 tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=-1-1 val=0 file tomwalters@0: .fi tomwalters@0: tomwalters@0: 8. Replace all instances of number 10 by -10 tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=10 val=-10 file tomwalters@0: .fi tomwalters@0: tomwalters@0: 9. Print a count of all numbers = 0 tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=0 val=count file tomwalters@0: .fi tomwalters@0: tomwalters@0: 10. Print a count of all numbers < 0 tomwalters@0: tomwalters@0: .nf tomwalters@0: gate yrange=min--1 val=count file tomwalters@0: .fi tomwalters@0: tomwalters@0: tomwalters@0: .SH "SEE ALSO" tomwalters@0: .LP tomwalters@0: options edwave step merge tomwalters@0: .SH COPYRIGHT tomwalters@0: .LP tomwalters@0: Copyright (c) Applied Psychology Unit, Medical Research Council, 1995 tomwalters@0: .LP tomwalters@0: Permission to use, copy, modify, and distribute this software without fee tomwalters@0: is hereby granted for research purposes, provided that this copyright tomwalters@0: notice appears in all copies and in all supporting documentation, and that tomwalters@0: the software is not redistributed for any fee (except for a nominal tomwalters@0: shipping charge). Anyone wanting to incorporate all or part of this tomwalters@0: software in a commercial product must obtain a license from the Medical tomwalters@0: Research Council. tomwalters@0: .LP tomwalters@0: The MRC makes no representations about the suitability of this tomwalters@0: software for any purpose. It is provided "as is" without express or tomwalters@0: implied warranty. tomwalters@0: .LP tomwalters@0: THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING tomwalters@0: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL tomwalters@0: THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES tomwalters@0: OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, tomwalters@0: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, tomwalters@0: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS tomwalters@0: SOFTWARE. tomwalters@0: