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