tomwalters@0: .TH RAMP 1 "1 September 1993" tomwalters@0: tomwalters@0: .SH NAME tomwalters@0: ramp \- generate an exponential sawtooth waveform tomwalters@0: tomwalters@0: .SH SYNTAX tomwalters@0: ramp [options] tomwalters@0: tomwalters@0: .SH DESCRIPTION tomwalters@0: Generate samples of an exponential sawtooth waveform at a given sample rate. tomwalters@0: Samples are written on the stdout in binary shorts or floats according to tomwalters@0: the `type' option. tomwalters@0: tomwalters@0: .SH OPTIONS tomwalters@0: tomwalters@0: 1. period, amplitude, duration. tomwalters@0: tomwalters@0: The `period' option sets the period of repetition of the waveform in samples. tomwalters@0: The `duration' option sets the total duration of the output waveform in tomwalters@0: samples. tomwalters@0: Both may be given with time units (s or ms) in which case the time is converted to tomwalters@0: samples using the given `samplerate' option. tomwalters@0: The `amplitude' option sets the height of the waveform. tomwalters@0: tomwalters@0: 2. polarity tomwalters@0: tomwalters@0: The `polarity' option is used to set the direction of the ramp: tomwalters@0: tomwalters@0: .nf tomwalters@0: polarity=ramp growing exponential: A.exp(t-T) 0<=t<=T tomwalters@0: polarity=damp decaying exponential: A.exp(-t) 0<=t<=T tomwalters@0: .fi tomwalters@0: tomwalters@0: 3. decay tomwalters@0: tomwalters@0: The argument of the exponential is calibrated so that the decay factor is tomwalters@0: a half-life period. tomwalters@0: The wave grows/decays to half its given amplitude in the given decay time. tomwalters@0: tomwalters@0: .SH EXAMPLES tomwalters@0: tomwalters@0: 1. Growing exponentials tomwalters@0: tomwalters@0: .nf tomwalters@0: ramp polarity=ramp dec=1ms tomwalters@0: .fi tomwalters@0: tomwalters@0: 2. Decaying exponentials tomwalters@0: tomwalters@0: .nf tomwalters@0: ramp polarity=damp dec=1ms tomwalters@0: .fi tomwalters@0: tomwalters@0: 3. Half a cycle of an 8ms decaying exponential. tomwalters@0: tomwalters@0: .nf tomwalters@0: ramp polarity=damp dec=1ms dur=4ms tomwalters@0: .fi tomwalters@0: tomwalters@0: 4. Modulating a tone with a damped exponential. tomwalters@0: Note: modulating can be done in floating point using a ramp with unit tomwalters@0: amplitude, or it can be done in integer arithmetic as below. tomwalters@0: The scale factor in the `merge' program is used to avoid 16-bit overflow. tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=.5ms > foo1 tomwalters@0: ramp pol=damp dec=1ms > foo2 tomwalters@0: merge op=mult factor=0.01 foo1 foo2 > foo3 tomwalters@0: .fi tomwalters@0: tomwalters@0: 5. Modulating a tone with a ramped exponential. tomwalters@0: The 800Hz tone is modulated with a unit ramped exponential with a 25ms tomwalters@0: repetition rate and a 4ms half life. tomwalters@0: tomwalters@0: .nf tomwalters@0: tone freq=800Hz amp=10000 type=float > foo1 tomwalters@0: ramp pol=ramp period=25ms dec=4ms amp=1 type=float > foo2 tomwalters@0: merge op=mult type=float foo1 foo2 | ftos > foo3 tomwalters@0: .fi tomwalters@0: tomwalters@0: 6. Modulating a tone with a damped exponential, and half-wave rectifying to tomwalters@0: generate damped pulses. tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=.5ms amp=500 type=float > foo1 tomwalters@0: ramp pol=damp dec=1ms amp=1 type=float > foo2 tomwalters@0: merge op=mult type=float foo1 foo2 | ftos | gate range=min-0 op=0 > foo3 tomwalters@0: .fi tomwalters@0: tomwalters@0: 7. Modulating white noise with a ramped exponential. tomwalters@0: tomwalters@0: .nf tomwalters@0: noise type=float > foo1 tomwalters@0: ramp pol=ramp dec=1ms amp=1 type=float > foo2 tomwalters@0: merge op=mult type=float foo1 foo2 | ftos > foo3 tomwalters@0: .fi tomwalters@0: tomwalters@0: .SH "SEE ALSO" tomwalters@0: options tone ptrain noise tomwalters@0: 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: