DPEAK(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’– 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.

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