annotate man/man1/tone.1 @ 0:5242703e91d3 tip

Initial checkin for AIM92 aimR8.2 (last updated May 1997).
author tomwalters
date Fri, 20 May 2011 15:19:45 +0100
parents
children
rev   line source
tomwalters@0 1 .TH TONE 1 "1 September 1993"
tomwalters@0 2
tomwalters@0 3 .SH NAME
tomwalters@0 4 tone \- generate a pure tone.
tomwalters@0 5
tomwalters@0 6 .SH SYNTAX
tomwalters@0 7 tone [options]
tomwalters@0 8
tomwalters@0 9 .SH DESCRIPTION
tomwalters@0 10 Generate samples of a sine wave at a given sample rate.
tomwalters@0 11 Specify wave amplitude, and frequency (in Hz or kHz), or alternatively
tomwalters@0 12 period (in s, ms, or p (sample points) ). If both period and frequency
tomwalters@0 13 are specified, then the given period takes precedence.
tomwalters@0 14 If S is the given samplerate so that Ts=1/S is the sample interval,
tomwalters@0 15 and phi is the given phase (in samples or time units),
tomwalters@0 16 then each sample of a sine wave of frequency f [Hz] is given by:
tomwalters@0 17
tomwalters@0 18 .nf
tomwalters@0 19 sin( TWOPI.f ( n.Ts + phi ) ) , n = 0,1,2,...
tomwalters@0 20 .fi
tomwalters@0 21
tomwalters@0 22 Write samples to the stdout in the given datatype for the given waveform duration.
tomwalters@0 23
tomwalters@0 24
tomwalters@0 25 .SH OPTIONS
tomwalters@0 26
tomwalters@0 27 1. period, frequency
tomwalters@0 28
tomwalters@0 29 The frequency (in Hz or kHz) and the period (in s, ms, or p (sample points) )
tomwalters@0 30 of the output waveform. Either may be specified, but if both period and frequency
tomwalters@0 31 are specified, then the given period takes precedence.
tomwalters@0 32
tomwalters@0 33 2. amplitude
tomwalters@0 34
tomwalters@0 35 The amplitude of the output waveform.
tomwalters@0 36
tomwalters@0 37 3. phase
tomwalters@0 38
tomwalters@0 39 The phase offset of the output sine wave with respect to the origin.
tomwalters@0 40 This may be specified as a time (with units s or ms) or as a number of
tomwalters@0 41 samples (with units p or no units), or in degrees (with units deg),
tomwalters@0 42 or the following strings are recognised
tomwalters@0 43 (and may be abbreviated provided this is unambiguous):
tomwalters@0 44 sine (0 phase offset), cosine (1/4 cycle phase offset),
tomwalters@0 45 antisine (1/2 cycle phase offset), anticosine (3/4 cycle phase offset).
tomwalters@0 46
tomwalters@0 47 4. type
tomwalters@0 48
tomwalters@0 49 The datatype of the output waveform. The following strings are recognised
tomwalters@0 50 types: char, short, int, float, double, ascii (meaning one ascii number per
tomwalters@0 51 line).
tomwalters@0 52
tomwalters@0 53 .SH EXAMPLES
tomwalters@0 54
tomwalters@0 55 1. Sine wave with period 10ms sampled at 10kHz, (100 sample points per period)
tomwalters@0 56
tomwalters@0 57 .nf
tomwalters@0 58 tone period=10ms samplerate=10kHz
tomwalters@0 59 .fi
tomwalters@0 60
tomwalters@0 61 2. Sine wave with frequency 100Hz sampled at 20kHz
tomwalters@0 62
tomwalters@0 63 .nf
tomwalters@0 64 tone frequency=100Hz
tomwalters@0 65 .fi
tomwalters@0 66
tomwalters@0 67 3. Sine wave with period 100 sample points, with dc-offset set equal to
tomwalters@0 68 amplitude of 500 so that waveform is just non-negative.
tomwalters@0 69
tomwalters@0 70 .nf
tomwalters@0 71 tone period=100p amplitude=500 offset=500
tomwalters@0 72 .fi
tomwalters@0 73
tomwalters@0 74 4. Quarter cycle of a sine wave with 8ms period.
tomwalters@0 75
tomwalters@0 76 .nf
tomwalters@0 77 tone period=8ms duration=2ms
tomwalters@0 78 .fi
tomwalters@0 79
tomwalters@0 80 5. Cosine wave with 8ms period.
tomwalters@0 81
tomwalters@0 82 .nf
tomwalters@0 83 tone period=8ms phase=cos
tomwalters@0 84 .fi
tomwalters@0 85
tomwalters@0 86 This is equivalent to:
tomwalters@0 87
tomwalters@0 88 .nf
tomwalters@0 89 tone period=8ms phase=2ms
tomwalters@0 90 .fi
tomwalters@0 91
tomwalters@0 92
tomwalters@0 93
tomwalters@0 94
tomwalters@0 95 .SH "SEE ALSO"
tomwalters@0 96 options ptrain
tomwalters@0 97
tomwalters@0 98 .SH COPYRIGHT
tomwalters@0 99 .LP
tomwalters@0 100 Copyright (c) Applied Psychology Unit, Medical Research Council, 1995
tomwalters@0 101 .LP
tomwalters@0 102 Permission to use, copy, modify, and distribute this software without fee
tomwalters@0 103 is hereby granted for research purposes, provided that this copyright
tomwalters@0 104 notice appears in all copies and in all supporting documentation, and that
tomwalters@0 105 the software is not redistributed for any fee (except for a nominal
tomwalters@0 106 shipping charge). Anyone wanting to incorporate all or part of this
tomwalters@0 107 software in a commercial product must obtain a license from the Medical
tomwalters@0 108 Research Council.
tomwalters@0 109 .LP
tomwalters@0 110 The MRC makes no representations about the suitability of this
tomwalters@0 111 software for any purpose. It is provided "as is" without express or
tomwalters@0 112 implied warranty.
tomwalters@0 113 .LP
tomwalters@0 114 THE MRC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
tomwalters@0 115 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
tomwalters@0 116 THE A.P.U. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
tomwalters@0 117 OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
tomwalters@0 118 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
tomwalters@0 119 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
tomwalters@0 120 SOFTWARE.
tomwalters@0 121