I-F(1)
π NAME
i-f β bestie, this is the little tool that takes your 16-bit short integers and turns them into floats β¨ it's giving "glow-up for numbers" honestly π«Ά
β¨ SYNOPSIS β¨
i-f [-n | scale] < shorts > floats
Like, shorts go in, floats come out, and you can't explain that π¦
πΈ DESCRIPTION πΈ
Okay so here's the whole vibe π: i-f reads a stream of native, machine-format 16-bit signed short integers from standard input, multiplies each and every value by a scale factor, and writes the results out to standard output as native single-precision floating point numbers. That's the whole main character plot, no cap.
The optional single argument is what picks your scaling, and it's lowkey the only decision you have to make π
If a numeric scale is given, each input value gets multiplied by it. Periodt. If -n is given instead, the scale gets set to 1/32768, so that the full short integer range maps onto data in the range -1.0 to +1.0 β the way that math just works out is so satisfying ngl π
With no argument at all, the scale defaults to 1.0 and each short is simply widened to a float. Chill, minimal effort, still slays π
π¨ Heads up bestie: a scale of 0.0 is rejected as an error, and so is reading from an interactive terminal. Neither of those is the move, fr fr π
π Also, real talk: this command is deprecated and scheduled for removal β it prints a deprecation warning on startup, so don't get too attached π It is the inverse off-i(1), and it's typically used in pipelines with other BRL-CAD signal-processing tools such asdmod(1)anddconv(1). iykyk π§
π OPTIONS π
-nβ Normalize, bestie! Uses a scale of1/32768so that full-range 16-bit signed input gets mapped onto the range-1.0to+1.0. Mutually exclusive with a numeric scale argument β you literally cannot have both, pick a lane πscaleβ A floating point multiplier applied to every input sample during conversion. And just to say it again because it matters: a scale of0.0is rejected as an error. Do not pass zero, I am begging π
β EXAMPLES β
Example 1. Normalize full-scale audio samples to unit-range floats πΈ
i-f -n < signal.pcm > signal.f
Treats the values in signal.pcm as full-range 16-bit signed samples and rescales them to the range -1.0 to +1.0, producing a stream of floats in signal.f suitable for further floating point processing. Chef's kiss, honestly π This one ate π₯
Example 2. Apply an explicit gain in a processing pipeline π¦
i-f 0.01 < input.shorts | dconv > output.f
Scales each short sample by 0.01 while converting to float, then feeds the resulting float stream into dconv(1) for further signal processing. Pipeline queen behavior, we love to see it π
π SEE ALSO π
brlcad(1), f-i(1), i-d(1), i-a(1), dconv(1), dmod(1)
Go read the whole friend group, they're all iconic in their own way π«Ά
π AUTHOR π
The BRL-CAD Team β absolute legends, we stan π
π COPYRIGHT π
This software is Copyright (c) 1989-2026 by the United States Government as represented by U.S. Army Research Laboratory. Fancy fancy, legally speaking π
π BUG REPORTS π
Reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org. Found a problem? Tell them!! They want to know!! Not me sitting in silence with a broken pipeline, that's not the vibe π
β¨ and that's the page, bestie β¨ β this was I-F(1) from the BRL-CAD manual, brought to you by the one and only source/version BRL-CAD, dated I-F(1) π¦ mwah π
π¦ where this page comes from
- nixpkgs unstable: brlcad 7.44.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms