tomwalters@0: .TH TONE 1 "1 September 1993" tomwalters@0: tomwalters@0: .SH NAME tomwalters@0: tone \- generate a pure tone. tomwalters@0: tomwalters@0: .SH SYNTAX tomwalters@0: tone [options] tomwalters@0: tomwalters@0: .SH DESCRIPTION tomwalters@0: Generate samples of a sine wave at a given sample rate. tomwalters@0: Specify wave amplitude, and frequency (in Hz or kHz), or alternatively tomwalters@0: period (in s, ms, or p (sample points) ). If both period and frequency tomwalters@0: are specified, then the given period takes precedence. tomwalters@0: If S is the given samplerate so that Ts=1/S is the sample interval, tomwalters@0: and phi is the given phase (in samples or time units), tomwalters@0: then each sample of a sine wave of frequency f [Hz] is given by: tomwalters@0: tomwalters@0: .nf tomwalters@0: sin( TWOPI.f ( n.Ts + phi ) ) , n = 0,1,2,... tomwalters@0: .fi tomwalters@0: tomwalters@0: Write samples to the stdout in the given datatype for the given waveform duration. tomwalters@0: tomwalters@0: tomwalters@0: .SH OPTIONS tomwalters@0: tomwalters@0: 1. period, frequency tomwalters@0: tomwalters@0: The frequency (in Hz or kHz) and the period (in s, ms, or p (sample points) ) tomwalters@0: of the output waveform. Either may be specified, but if both period and frequency tomwalters@0: are specified, then the given period takes precedence. tomwalters@0: tomwalters@0: 2. amplitude tomwalters@0: tomwalters@0: The amplitude of the output waveform. tomwalters@0: tomwalters@0: 3. phase tomwalters@0: tomwalters@0: The phase offset of the output sine wave with respect to the origin. tomwalters@0: This may be specified as a time (with units s or ms) or as a number of tomwalters@0: samples (with units p or no units), or in degrees (with units deg), tomwalters@0: or the following strings are recognised tomwalters@0: (and may be abbreviated provided this is unambiguous): tomwalters@0: sine (0 phase offset), cosine (1/4 cycle phase offset), tomwalters@0: antisine (1/2 cycle phase offset), anticosine (3/4 cycle phase offset). tomwalters@0: tomwalters@0: 4. type tomwalters@0: tomwalters@0: The datatype of the output waveform. The following strings are recognised tomwalters@0: types: char, short, int, float, double, ascii (meaning one ascii number per tomwalters@0: line). tomwalters@0: tomwalters@0: .SH EXAMPLES tomwalters@0: tomwalters@0: 1. Sine wave with period 10ms sampled at 10kHz, (100 sample points per period) tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=10ms samplerate=10kHz tomwalters@0: .fi tomwalters@0: tomwalters@0: 2. Sine wave with frequency 100Hz sampled at 20kHz tomwalters@0: tomwalters@0: .nf tomwalters@0: tone frequency=100Hz tomwalters@0: .fi tomwalters@0: tomwalters@0: 3. Sine wave with period 100 sample points, with dc-offset set equal to tomwalters@0: amplitude of 500 so that waveform is just non-negative. tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=100p amplitude=500 offset=500 tomwalters@0: .fi tomwalters@0: tomwalters@0: 4. Quarter cycle of a sine wave with 8ms period. tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=8ms duration=2ms tomwalters@0: .fi tomwalters@0: tomwalters@0: 5. Cosine wave with 8ms period. tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=8ms phase=cos tomwalters@0: .fi tomwalters@0: tomwalters@0: This is equivalent to: tomwalters@0: tomwalters@0: .nf tomwalters@0: tone period=8ms phase=2ms tomwalters@0: .fi tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: .SH "SEE ALSO" tomwalters@0: options ptrain 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: