D2-C(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… d2-c β€” the BRL-CAD girlie's guide πŸ’…

okay so bestie, welcome to d2-c, straight out of the BRL-CAD family ✨ this one's a tiny little icon and it has exactly one job. let's get into it 🫢


🌸 NAME 🌸

d2-c β€” merges two double files into one single complex file. that's it. that's the whole personality πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

d2-c _real_file_ _imag_file_ > _complex_

✨ DESCRIPTION ✨

okay so here's the vibe: d2-c interleaves two separate streams of double-precision floating point values into one single stream of complex numbers, and writes the whole thing out to standard output. it reads values in parallel from real_file and imag_file and emits them as alternating real/imaginary pairs. so the output is literally built to be fed into tools that expect complex data β€” like dfft(1) πŸ‘‘

and if one input is shorter than the other? no stress πŸ’– the missing values get padded with zeros until both inputs are exhausted. everything comes out even, nobody gets left behind.

⚠️ heads up: the output is binary, so you must redirect standard output to a file or a pipe. the program literally refuses to run when standard output is a terminal 😀 no cap.

fun fact: d2-c is the inverse of c-d(1). they're giving matching-friends energy πŸ¦‹

either input name can be special, and both tricks are lowkey iconic:

  • a single dash (-) β€” reads that input from standard input
  • a single period (.) β€” supplies an all-zero (null) stream, which is super useful for building a purely real or purely imaginary complex signal 🌈
πŸ’€ one sad thing: this command is deprecated and scheduled for removal. so if you depend on it, please contact the developers. don't say i didn't warn you πŸ™ˆ

🌟 EXAMPLES 🌟

πŸ’– Example 1. Build a complex signal from separate real and imaginary files

d2-c real.d imag.d > signal.c

reads matching real and imaginary sample streams and writes the interleaved complex result to signal.c β€” all ready for spectral analysis with dfft(1) ⭐

πŸ¦‹ Example 2. Promote a purely real signal to complex form

d2-c real.d . > signal.c

pairs each real sample with a zero imaginary part by using the . null stream, producing a complex file with no imaginary component. genuinely so clean ✨


πŸ‘‘ SEE ALSO πŸ‘‘

brlcad(1), c-d(1), dconv(1), dfft(1)


πŸ“ AUTHOR πŸ“

BRL-CAD Team β€” kings, 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 β€” they genuinely wanna hear from you, bestie πŸ’Œ


okay that's the whole page!! ✨ this little darling comes to you from BRL-CAD (that's the source/version, mwah πŸ’‹) and yeah, that's the entire manual. go interleave some doubles, you main character πŸŽ€πŸ’…

πŸ“¦ where this page comes from