DPEAK(1)
π DPEAK(1) β find the dominant peak in each window of a stream of doubles π
okay so bestie, this one's a whole mood: it's dpeak, from the BRL-CAD manual. let's get into it π«Ά
β¨ SYNOPSIS β¨
dpeak [window_size] < input.doubles > output.doubles
that's literally it. pipe doubles in, get doubles out, live your truth π
πΈ DESCRIPTION πΈ
dpeak is an experimental signal processing utility, and when I say experimental I mean it's out here doing its little science and you should know that going in π§
Here's the vibe: it reads a stream of double-precision floating-point numbers from standard input, chops that stream up into fixed-size windows, and for each window it writes to standard output the sample index of the single highest peak β as a double-precision value. one number per window, no cap π
now what even is a peak around here? a "peak" is a local maximum identified by a negative second difference β meaning a sample whose value is greater than both its predecessor and its successor. it's giving main character sample, honestly.
β οΈ important caveat bestie: peaks that show up within the first 5 samples of a window are ignored. like, sorry, too early, the algorithm's not awake yet π
The input gets processed in windows of window_size samples β default is 512 β and if the last window comes up short it gets zero-padded. and then exactly one value comes out per window: the index of the largest peak, relative to the start of that window. periodt π₯
This tool is a companion to the other double-stream tools β like dfft(1), dmod(1), and dstats(1) β over in the sig signal-processing suite. it's part of the friend group π
π¦ OPTIONS π¦
window_sizeβ the number of samples per processing window. defaults to 512 if you don't give it one. heads up though: the internal buffers cap the usable window size at 2048 samples, so don't come at it with anything bigger π
π EXAMPLES π
Example 1. Locating spectral peaks after an FFT β
dfft < signal.doubles | dpeak 1024 > peaks.doubles
So what's happening here: this computes the power spectrum of signal.doubles using dfft(1) and pipes it straight into dpeak, which then reports the bin index of the strongest peak in each 1024-sample window. ate and left no crumbs π
and if you want to actually look at those resulting indices? convert them to text with d-a(1) for inspection. yw bestie π«Ά
π SEE ALSO π
brlcad(1), dfft(1), dmod(1), dstats(1), d-a(1)
π AUTHOR π
BRL-CAD Team β legends, honestly.
π COPYRIGHT π
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory.
π BUG REPORTS π
Found a bug or a problem? send it over via electronic mail to devs@brlcad.org β they want to hear about it fr fr π¬
π ok that's the whole page!! it's DPEAK(1), the BRL-CAD manual, and that's a wrap β mwah, go process some signals bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms