gate
Manual Reference Pages - GATE (1)
gate - gate specific numbers from the input stream.
CONTENTS
Syntax
Description
Options
Examples
Copyright
SYNTAX
gate [options] [file]
DESCRIPTION
Numbers in the input stream within given gate ranges are replaced by aparticular <value>. Both time and amplitude ranges may be specified.The <value> may be a real number or the result of a particular <operation>.Results are written on the stdout in numbers of the same type as thatselected for input.
OPTIONS
1. xrange, yrange
The xrange specifies the time range and the yrange specifies theamplitude range for the gating operation. Ranges are specified:
xrange=a[-b] yrange=a[-b]The upper limit b is optional, and when it is missing then the rangeis a single number, otherwise a and b are inclusive range limits.The xrange limits are in samples (no units) or may take time units (s or ms),in which case they are converted to samples using the given samplerateoption. The yrange limits are real numbers.The strings "min" and "max" are recognised as extreme limits: the start andend of the input stream for the xrange, and the most positive and negativeamplitudes for the yrange.
2. value
The <value> may be a real number or an <operation>,in which case all input numbers within the gate range are operated on asappropriate. Abbreviated forms of the operation names are allowed.
<operation>: exclude exclude numbers in gate range from output negate negate numbers in gate range count print count of numbers in gate range on the stderr3. type
The input and output datatype may be: char, short, int, float, double, ASCII.Ascii input is taken to be one number per line.
EXAMPLES
1. Replace all numbers <=0 by value 0 (ie. half-wave rectification).
gate yrange=min-0 val=0 file2. Replace all numbers <=0 by their inverse (ie. full-wave rectification).
gate yrange=min-0 val=neg file3. Gate the onset of a signal: replace the first 20ms with zeroes.
gate xrange=0-20ms yrange=min-max val=0 file4. Exclude all numbers <=0
gate yrange=min-0 val=exclude file5. Exclude all numbers >0
gate yrange=1-max val=exclude file6. Delete lines 4 to 8 inclusive from ascii input (lines numbered 0,1,2,...)
gate type=ASCII xrange=4-8 yrange=min-max val=exclude file7. Replace all numbers in the yrange -1 to +1 inclusive by 0
gate yrange=-1-1 val=0 file8. Replace all instances of number 10 by -10
gate yrange=10 val=-10 file9. Print a count of all numbers = 0
gate yrange=0 val=count file10. Print a count of all numbers < 0
gate yrange=min--1 val=count file
SEE ALSO
options edwave step merge
COPYRIGHT
Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
Permission to use, copy, modify, and distribute this software without feeis hereby granted for research purposes, provided that this copyrightnotice appears in all copies and in all supporting documentation, and thatthe software is not redistributed for any fee (except for a nominalshipping charge). Anyone wanting to incorporate all or part of thissoftware in a commercial product must obtain a license from the MedicalResearch Council.
The MRC makes no representations about the suitability of thissoftware for any purpose. It is provided "as is" without express orimplied warranty.
THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDINGALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALLTHE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGESOR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THISSOFTWARE.
| SunOS 5.6 | GATE (1) | 15 September 1993 |