Manual Reference Pages - RAMP (1)
ramp - generate an exponential sawtooth waveform
Generate samples of an exponential sawtooth waveform at a given sample rate. Samples are written on the stdout in binary shorts or floats according to the type option.
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 in samples. Both may be given with time units (s or ms) in which case the time is converted to samples using the given samplerate option. The amplitude option sets the height of the waveform.
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<=T
The argument of the exponential is calibrated so that the decay factor is a half-life period. The wave grows/decays to half its given amplitude in the given decay time.
1. Growing exponentials
ramp polarity=ramp dec=1ms
2. Decaying exponentials
ramp polarity=damp dec=1ms
3. Half a cycle of an 8ms decaying exponential.
ramp polarity=damp dec=1ms dur=4ms
4. Modulating a tone with a damped exponential. Note: modulating can be done in floating point using a ramp with unit amplitude, 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 > foo3
5. Modulating a tone with a ramped exponential. The 800Hz tone is modulated with a unit ramped exponential with a 25ms repetition 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 > foo3
6. Modulating a tone with a damped exponential, and half-wave rectifying to generate 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 > foo3
7. 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
options tone ptrain noise
Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
Permission to use, copy, modify, and distribute this software without fee is hereby granted for research purposes, provided that this copyright notice appears in all copies and in all supporting documentation, and that the software is not redistributed for any fee (except for a nominal shipping charge). Anyone wanting to incorporate all or part of this software in a commercial product must obtain a license from the Medical Research Council.
The MRC makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 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 THIS SOFTWARE.
|SunOS 5.6||RAMP (1)||1 September 1993|