tomwalters@0
|
1 .TH RAMP 1 "1 September 1993"
|
tomwalters@0
|
2
|
tomwalters@0
|
3 .SH NAME
|
tomwalters@0
|
4 ramp \- generate an exponential sawtooth waveform
|
tomwalters@0
|
5
|
tomwalters@0
|
6 .SH SYNTAX
|
tomwalters@0
|
7 ramp [options]
|
tomwalters@0
|
8
|
tomwalters@0
|
9 .SH DESCRIPTION
|
tomwalters@0
|
10 Generate samples of an exponential sawtooth waveform at a given sample rate.
|
tomwalters@0
|
11 Samples are written on the stdout in binary shorts or floats according to
|
tomwalters@0
|
12 the `type' option.
|
tomwalters@0
|
13
|
tomwalters@0
|
14 .SH OPTIONS
|
tomwalters@0
|
15
|
tomwalters@0
|
16 1. period, amplitude, duration.
|
tomwalters@0
|
17
|
tomwalters@0
|
18 The `period' option sets the period of repetition of the waveform in samples.
|
tomwalters@0
|
19 The `duration' option sets the total duration of the output waveform in
|
tomwalters@0
|
20 samples.
|
tomwalters@0
|
21 Both may be given with time units (s or ms) in which case the time is converted to
|
tomwalters@0
|
22 samples using the given `samplerate' option.
|
tomwalters@0
|
23 The `amplitude' option sets the height of the waveform.
|
tomwalters@0
|
24
|
tomwalters@0
|
25 2. polarity
|
tomwalters@0
|
26
|
tomwalters@0
|
27 The `polarity' option is used to set the direction of the ramp:
|
tomwalters@0
|
28
|
tomwalters@0
|
29 .nf
|
tomwalters@0
|
30 polarity=ramp growing exponential: A.exp(t-T) 0<=t<=T
|
tomwalters@0
|
31 polarity=damp decaying exponential: A.exp(-t) 0<=t<=T
|
tomwalters@0
|
32 .fi
|
tomwalters@0
|
33
|
tomwalters@0
|
34 3. decay
|
tomwalters@0
|
35
|
tomwalters@0
|
36 The argument of the exponential is calibrated so that the decay factor is
|
tomwalters@0
|
37 a half-life period.
|
tomwalters@0
|
38 The wave grows/decays to half its given amplitude in the given decay time.
|
tomwalters@0
|
39
|
tomwalters@0
|
40 .SH EXAMPLES
|
tomwalters@0
|
41
|
tomwalters@0
|
42 1. Growing exponentials
|
tomwalters@0
|
43
|
tomwalters@0
|
44 .nf
|
tomwalters@0
|
45 ramp polarity=ramp dec=1ms
|
tomwalters@0
|
46 .fi
|
tomwalters@0
|
47
|
tomwalters@0
|
48 2. Decaying exponentials
|
tomwalters@0
|
49
|
tomwalters@0
|
50 .nf
|
tomwalters@0
|
51 ramp polarity=damp dec=1ms
|
tomwalters@0
|
52 .fi
|
tomwalters@0
|
53
|
tomwalters@0
|
54 3. Half a cycle of an 8ms decaying exponential.
|
tomwalters@0
|
55
|
tomwalters@0
|
56 .nf
|
tomwalters@0
|
57 ramp polarity=damp dec=1ms dur=4ms
|
tomwalters@0
|
58 .fi
|
tomwalters@0
|
59
|
tomwalters@0
|
60 4. Modulating a tone with a damped exponential.
|
tomwalters@0
|
61 Note: modulating can be done in floating point using a ramp with unit
|
tomwalters@0
|
62 amplitude, or it can be done in integer arithmetic as below.
|
tomwalters@0
|
63 The scale factor in the `merge' program is used to avoid 16-bit overflow.
|
tomwalters@0
|
64
|
tomwalters@0
|
65 .nf
|
tomwalters@0
|
66 tone period=.5ms > foo1
|
tomwalters@0
|
67 ramp pol=damp dec=1ms > foo2
|
tomwalters@0
|
68 merge op=mult factor=0.01 foo1 foo2 > foo3
|
tomwalters@0
|
69 .fi
|
tomwalters@0
|
70
|
tomwalters@0
|
71 5. Modulating a tone with a ramped exponential.
|
tomwalters@0
|
72 The 800Hz tone is modulated with a unit ramped exponential with a 25ms
|
tomwalters@0
|
73 repetition rate and a 4ms half life.
|
tomwalters@0
|
74
|
tomwalters@0
|
75 .nf
|
tomwalters@0
|
76 tone freq=800Hz amp=10000 type=float > foo1
|
tomwalters@0
|
77 ramp pol=ramp period=25ms dec=4ms amp=1 type=float > foo2
|
tomwalters@0
|
78 merge op=mult type=float foo1 foo2 | ftos > foo3
|
tomwalters@0
|
79 .fi
|
tomwalters@0
|
80
|
tomwalters@0
|
81 6. Modulating a tone with a damped exponential, and half-wave rectifying to
|
tomwalters@0
|
82 generate damped pulses.
|
tomwalters@0
|
83
|
tomwalters@0
|
84 .nf
|
tomwalters@0
|
85 tone period=.5ms amp=500 type=float > foo1
|
tomwalters@0
|
86 ramp pol=damp dec=1ms amp=1 type=float > foo2
|
tomwalters@0
|
87 merge op=mult type=float foo1 foo2 | ftos | gate range=min-0 op=0 > foo3
|
tomwalters@0
|
88 .fi
|
tomwalters@0
|
89
|
tomwalters@0
|
90 7. Modulating white noise with a ramped exponential.
|
tomwalters@0
|
91
|
tomwalters@0
|
92 .nf
|
tomwalters@0
|
93 noise type=float > foo1
|
tomwalters@0
|
94 ramp pol=ramp dec=1ms amp=1 type=float > foo2
|
tomwalters@0
|
95 merge op=mult type=float foo1 foo2 | ftos > foo3
|
tomwalters@0
|
96 .fi
|
tomwalters@0
|
97
|
tomwalters@0
|
98 .SH "SEE ALSO"
|
tomwalters@0
|
99 options tone ptrain noise
|
tomwalters@0
|
100
|
tomwalters@0
|
101 .SH COPYRIGHT
|
tomwalters@0
|
102 .LP
|
tomwalters@0
|
103 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
|
tomwalters@0
|
104 .LP
|
tomwalters@0
|
105 Permission to use, copy, modify, and distribute this software without fee
|
tomwalters@0
|
106 is hereby granted for research purposes, provided that this copyright
|
tomwalters@0
|
107 notice appears in all copies and in all supporting documentation, and that
|
tomwalters@0
|
108 the software is not redistributed for any fee (except for a nominal
|
tomwalters@0
|
109 shipping charge). Anyone wanting to incorporate all or part of this
|
tomwalters@0
|
110 software in a commercial product must obtain a license from the Medical
|
tomwalters@0
|
111 Research Council.
|
tomwalters@0
|
112 .LP
|
tomwalters@0
|
113 The MRC makes no representations about the suitability of this
|
tomwalters@0
|
114 software for any purpose. It is provided "as is" without express or
|
tomwalters@0
|
115 implied warranty.
|
tomwalters@0
|
116 .LP
|
tomwalters@0
|
117 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
tomwalters@0
|
118 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
tomwalters@0
|
119 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
|
tomwalters@0
|
120 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
tomwalters@0
|
121 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
tomwalters@0
|
122 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
|
tomwalters@0
|
123 SOFTWARE.
|
tomwalters@0
|
124
|