DWIN(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’– DWIN(1) β€” the BRL-CAD sliding window situation πŸ’–

okay so bestie, you're looking at dwin, straight out of the BRL-CAD universe (yes, that's the manual name, we're being fancy today πŸ‘‘). Sit down, hydrate, and let me tell you about this little icon.


✨ NAME ✨

dwin β€” extract sliding windows of doubles and optionally apply a window function πŸͺŸπŸ’«


πŸŽ€ SYNOPSIS πŸŽ€

dwin [options] [width] [step] < input.doubles > output.doubles

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: dwin reads a stream of double-precision floating-point values from standard input, extracts overlapping or non-overlapping windows of data, and writes the resulting windows to standard output. literally that's the whole job and it does it slayfully. ✨

each option may apply a tapering window function to the extracted samples, to attenuate edge effects prior to spectral analysis β€” think the discrete Fourier transform performed by dfft(1). it's giving "prep work so the FFT looks cute" energy. πŸ’…

the width argument sets the number of samples per window (default 1024). the step argument controls how far the window advances each iteration, and ngl this part is the main character:

  • if step is less than 1.0, it's treated as a fraction of width (so like 0.5 overlaps each window by half 🫢)
  • if step is 1.0 or greater, it's the absolute number of samples to advance

when step is omitted it defaults to width, which produces contiguous non-overlapping windows. clean, tidy, no overlap, we love a default. 🌸

🚨 important bestie alert: because input may be a pipe, dwin only seeks forward. and both standard input and standard output must be redirected β€” no talking to your terminal directly, it's not that kind of program. 😭

πŸ’… OPTIONS πŸ’…

  • -w β€” apply an 80% split cosine (Tukey) window. tapering but make it cosine. πŸ”₯
  • -H β€” apply a Hamming window. the classic, the beloved, the icon. πŸ‘‘
  • -b β€” apply a Bartlett (triangle) window. triangle shaped, obviously. πŸ”Ί
  • -B β€” apply a bias window (half triangle). it's the triangle's half sibling. πŸ’œ
  • -e β€” position the first window so its trailing sample aligns with the start of the input (meaning the window begins ahead of the first data point). yes it starts before the data, that's the whole point, don't @ me. πŸ™ˆ
  • -m β€” position the first window so its midpoint aligns with the start of the input. centered, balanced, main character energy. ⭐

🌈 EXAMPLES 🌈

example 1 β€” overlapping Hamming windows feeding an FFT

dwin -H 1024 0.5 < signal.doubles | dfft > spectrum.doubles

so what's happening here: it extracts 1024-sample windows from signal.doubles, advancing 512 samples (50% overlap) per step, applies a Hamming taper to each window, and pipes the windowed segments directly into dfft(1) to produce a sequence of power spectra in spectrum.doubles. it's a whole pipeline and it ate. πŸ“


🧚 SEE ALSO 🧚

brlcad(1), dfft(1), dconv(1), dmod(1), dstats(1)

go read those too, iykyk πŸ’–


πŸ’€ 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 πŸ™ˆ

reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β€” please be nice to them, they're doing their best 🫢


πŸ’Œ sign-off time: this was BRL-CAD's DWIN(1) page, and yes, that footer info is your little goodbye kiss. now go window some doubles, bestie. periodt. πŸ¦‹βœ¨πŸ’œ
πŸ“¦ where this page comes from