dpeak [window_size] < input.doubles > output.doubles
DPEAK(1)
NAME
dpeak - find the dominant peak in each window of a stream of doubles
On this page
SYNOPSIS
DESCRIPTION
dpeak is an experimental signal processing utility that reads a stream of double-precision floating-point numbers from standard input, divides it into fixed-size windows, and for each window writes the sample index of the single highest peak to standard output as a double-precision value.
A "peak" is a local maximum identified by a negative second difference: a sample whose value is greater than both its predecessor and its successor. Peaks occurring within the first 5 samples of a window are ignored. The input is processed in windows of window_size samples (default 512); a final short window is zero-padded. Exactly one value, the index of the largest peak relative to the start of the window, is emitted per window.
This is a companion to other double-stream tools such as dfft(1), dmod(1), and dstats(1) in the sig signal-processing suite.
OPTIONS
- window_size
-
The number of samples per processing window. Defaults to 512 if not given. The internal buffers limit the usable window size to 2048 samples.
EXAMPLES
dfft < signal.doubles | dpeak 1024 > peaks.doubles
Computes the power spectrum of signal.doubles with dfft(1) and pipes it to dpeak, which reports the bin index of the strongest peak in each 1024-sample window. The resulting indices can be converted to text with d-a(1) for inspection.
SEE ALSO
brlcad(1), dfft(1), dmod(1), dstats(1), d-a(1)
AUTHOR
BRL-CAD Team
COPYRIGHT
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
BUG REPORTS
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org