.TH PEAK 1carl CARL
.SH NAME
peak \- calculates peak amplitude of sound signal
.SH SYNOPSIS
.B peak [flags]
< floatsams > peak (ASCII display)
.br
or
.br
.B peak [flags]
\-e < floatsams > floatsams, and >& peak
.nf
\tflags:
\t-error	copy stdin to stdout, print peak on stderr
\t-dB		print peak amplitude as dB amplitude
\t-absolute	(default) detect absolute maximum
\t-negative	detect negative maximum
\t-positive	detect positive maximum
Input must be a file or pipe of floatsams.
.fi
.SH DESCRIPTION
.B peak 
reads samples from stdin and finds the maximum amplitude. 
The input data stream must be floatsams.
In the first usage given above,
it prints the index in the file of the peak, and the
peak value, on stdout.
In the second usage, when the -e flag is given, the peak is written
to stderr, and the input samples are copied to stdout.  This allows
peak to be inserted in a sample data stream as a "test probe."
.PP
The optional flag -dB (abbreviating this to -d will work too) causes
the amplitude value to be printed in dB.
.PP
The peak is ordinarily detected from the absolute value of the signal.
Use the -positive flag to detect only positive signals, and 
\-negative for negative signals.  These can be abbreviated -p and -n.
.PP
The following examples determine the peak amplitude for sound file boom:
.sp
.RS .5i
sndin boom | peak
.br
sndin boom | peak -e | sndout boom2 (peak placed on stderr)
.sp
.RE
.SH AUTHOR
F. R. Moore
.SH SEE ALSO
rms(1carl), hist(1carl)
