DFFT(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’– DFFT(1) β€” the dfft page, but make it cute πŸ’–

okay so bestie, welcome to the BRL-CAD manual, section 1, and today's main character is dfft πŸŽ€


✨ NAME ✨

dfft β€” computes fast Fourier transforms of a stream of doubles πŸ¦‹


🌸 SYNOPSIS 🌸

dfft [-clpLAN] [-d dB] [width] < doubles > spectrum

πŸ’… DESCRIPTION πŸ’…

okay so here's the vibe: dfft reads a stream of double-precision floating-point samples from standard input, computes the real fast Fourier transform of each 1024-sample record, and writes the resulting spectrum to standard output. literally that's it and it ate πŸ”₯

⚠️ and like, both standard input and standard output must be redirected, no cap. If either one is a terminal, dfft prints a usage message and exits. it's giving "not today" πŸ’€

by default the output is the periodogram-scaled log-magnitude in decibels, written as 512 double-precision values per 1024-sample record. iconic ✨

the options let you pick, like, a whole different era:

  • phase output instead of magnitude πŸŒ™
  • a linear (non-dB) magnitude scale πŸ“
  • a logarithmic frequency scale πŸ“ˆ
  • a third-octave critical band filter 🎚️
  • normalization to the peak magnitude πŸ‘‘
  • or human-readable ASCII text 🫢

the optional width argument? she's accepted for historical compatibility but ignored, periodt. the transform length is fixed at 1024 samples, yielding 512 output values. that's the law πŸ’…

input is normally produced by a tool such as dconv(1) or dmod(1) β€” iykyk 🧚


✨ OPTIONS ✨

  • -d dB β€” set the minimum magnitude in decibels. you give it a positive value and it gets applied as its negative, ok? magnitudes below this floor are clamped when the output is normalized. default is 120, i.e. -120 dB πŸ™ˆ
  • -l β€” interpolate the magnitudes onto a logarithmic frequency scale πŸ“ˆ
  • -c β€” apply a third-octave critical band filter to the magnitudes 🎚️
  • -p β€” output the phase, in units of pi, instead of the magnitude πŸŒ™
  • -N β€” normalize the power spectral density so the peak is 0 dB (or 1.0 in linear mode) πŸ‘‘
  • -L β€” output linear magnitude rather than log-magnitude in decibels πŸ“
  • -A β€” write human-readable ASCII text instead of binary doubles. each line holds a frequency fraction and its magnitude separated by a space πŸ“
  • -h, -? β€” print a usage message and exit 🫢

πŸ¦‹ EXAMPLES πŸ¦‹

Example 1. Plot a power spectrum

dfft -A -N < signal.doubles > spectrum.txt

computes the FFT of the samples in signal.doubles, normalizes the power spectral density to a 0 dB peak, and writes (frequency, magnitude) pairs as ASCII text suitable for feeding to a plotting program. plot girl summer 🌸✨

Example 2. Critical band magnitude on a log frequency scale

dmod -m 32768 < raw.doubles | dfft -c -l > bands.doubles

scales the raw samples with dmod(1), then computes a third-octave critical-band-filtered spectrum interpolated onto a logarithmic frequency scale, producing binary doubles for further processing. pipeline? slayed πŸ’…πŸ”₯


🌈 SEE ALSO 🌈

brlcad(1), dconv(1), dmod(1), dauto(1), dwin(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 πŸ“§ β€” like, please actually tell them, don't just suffer in silence bestie 😭


okay that's the whole page!! from the BRL-CAD girlies, DFFT(1), dated 2026, mwah πŸ’‹ send your bug mail, stay hydrated, and remember: redirect your stdin AND your stdout πŸ«ΆπŸ’–

πŸ“¦ where this page comes from