Skip to documentation
DocumentationAll documentsEnglish

DWIN(1)

NAME

dwin - extract sliding windows of doubles and optionally apply a window function

On this page

SYNOPSIS

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

DESCRIPTION

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. Each option may apply a tapering window function to the extracted samples to attenuate edge effects prior to spectral analysis, such as the discrete Fourier transform performed by dfft(1).

The width argument sets the number of samples per window (default 1024). The step argument controls how far the window advances each iteration: if it is less than 1.0 it is treated as a fraction of width (e.g. 0.5 overlaps each window by half), and if it is 1.0 or greater it is the absolute number of samples to advance. When step is omitted it defaults to width, producing contiguous non-overlapping windows. Because input may be a pipe, dwin only seeks forward. Both standard input and standard output must be redirected.

OPTIONS

-w

Apply an 80% split cosine (Tukey) window.

-H

Apply a Hamming window.

-b

Apply a Bartlett (triangle) window.

-B

Apply a bias window (half triangle).

-e

Position the first window so its trailing sample aligns with the start of the input (the window begins ahead of the first data point).

-m

Position the first window so its midpoint aligns with the start of the input.

EXAMPLES

Example 1. Overlapping Hamming windows feeding an FFT
dwin -H 1024 0.5 < signal.doubles | dfft > spectrum.doubles

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.

SEE ALSO

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

AUTHOR

BRL-CAD Team

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