F-I(1)

πŸ“¦ version 7.44.0, in nixpkgs unstable

πŸ’… 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 🫢

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