F-I(1)
π F-I(1) β the BRL-CAD glow-up page β¨
okay so bestie, welcome to f-i, a lil' tool from the BRL-CAD family (that's the manual section 1 squad, iykyk) π
β¨ NAME β¨
f-i β the icon that converts floats to 16-bit short integers. literally her whole job π
πΈ SYNOPSIS πΈ
f-i [-n | scale] < floats > shorts
π¦ DESCRIPTION π¦
So here's the vibe: f-i reads a stream of native, machine-format, single-precision floating point numbers from standard input, multiplies each value by a scale factor, and writes the results to standard output as native 16-bit signed short integers. no cap, that's it, that's the whole main character arc π₯
The optional single argument is the whole scale situation:
- If you hand her a numeric scale, every input value gets multiplied by it.
- If you pass
-n, the scale gets set to 32767.0, so input data sitting in the range -1.0 to +1.0 maps onto the full short integer range. gorgeous, full-scale, ate. - With no argument at all, the scale defaults to 1.0.
Values that exceed the representable short range get clipped to 32767 or -32768 β and a count of clipped high and low samples is reported on standard error. so like, she'll tell you if she had to clip, bestie π
β οΈ lowkey important: this command is deprecated and scheduled for removal, and it prints a deprecation warning on startup. she's iconic but she's on her way out π
She's the inverse of i-f(1), and is typically used in pipelines with other BRL-CAD signal-processing tools that operate on single-precision float streams β think f-d(1), dmod(1), and d-f(1). pipeline besties fr fr π«Ά
π OPTIONS π
-nβ Normalize: use a scale of 32767.0 so that input in the range -1.0 to +1.0 fills the full 16-bit signed range. Mutually exclusive with a numeric scale argument (pick one, queen, you can't have both π ).scaleβ A floating point multiplier applied to every input sample before conversion. A scale of 0.0 is rejected as an error. zero is not the vibe π
π EXAMPLES π
Example 1. Normalize unit-range floats to full-scale audio samples
f-i -n < signal.f > signal.pcm
Treats the values in signal.f as samples in the range -1.0 to +1.0 and rescales them to fill the 16-bit signed integer range, producing raw PCM-style short data in signal.pcm. slay, certified bop π§β¨
Example 2. Apply an explicit gain in a processing pipeline
f-d < input.f | dmod -m 0.5 | d-f | f-i 100 > scaled.shorts
Converts the single-precision stream to doubles with f-d(1), multiplies by 0.5 using dmod(1), converts back to floats with d-f(1), then scales by 100 and converts to 16-bit shorts. Any samples that exceed the short range are clipped and a clip count is printed to standard error. the way this pipeline just works ππ₯
π SEE ALSO π
brlcad(1), i-f(1), d-i(1), f-d(1), d-f(1), dmod(1), dconv(1) β go read the whole friend group, they're all iconic β
π AUTHOR π
BRL-CAD Team π«Ά
π§ COPYRIGHT π§
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 β tell them the group chat sent you π§π
and that's the whole page, bestie!! this lil' beauty comes to you straight from the BRL-CAD fam and is dated BRL-CAD down at the footer, page F-I(1) β mwah, no notes, periodt π
ππΈ
π¦ 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