U-F(1)
β¨ U-F(1) β the glow-up page β¨
okay so real talk: this is the u-f page from the BRL-CAD manual set, and bestie, we have so much to get into. it converts binary unsigned shorts into floats. that's the whole vibe. let's go π
πΈ NAME πΈ
u-f β convert binary unsigned shorts to floats. literally that's her job. main character energy from the jump π
π¦ SYNOPSIS π¦
u-f [-n | scale] < shorts > floats
read it like a little recipe: shorts go in, floats come out, and you pick one of -n or scale to flavor it. no cap β¨
π DESCRIPTION π
okay so here's the tea π β u-f reads a stream of machine-native 16-bit unsigned short integers from standard input, converts each value into a single-precision floating point number, and writes the resulting binary floats to standard output. in through stdin, out through stdout, no drama, no files touched, iconic behavior fr fr.
by default every sample is converted as-is, which is a scale factor of 1.0 β she's not doing anything extra to your data, she's just translating π«Ά.
but you do have options, and they're a whole mood:
- you can hand her an optional scale factor as the only argument, and she'll multiply every single sample by it
- or you can hit her with the
-nflag to normalize the data
and now the strict part, because she will read you π β reading from a terminal, supplying more than one argument, or a scale factor of zero is all treated as an error, and she prints a usage message. zero is not a personality, bestie. she's not doing it.
β οΈ big warning time: this command is deprecated and is scheduled for removal. it prints a deprecation warning on startup. so likeβ¦ enjoy her while she's here π
if you want related converters that read the same binary unsigned-short stream, the friend group includes u-a(1), u-bw(1), and u-d(1). squad goals π
π OPTIONS π
-nβ normalize the data, scaling every sample by1/65536so the output values fall roughly between0.0and1.0. chef's kiss for when you want your numbers to behave π₯scaleβ a floating point scale factor that gets multiplied into every sample before it's written. mutually exclusive with-n(pick one, she said). defaults to1.0(no scaling at all) when you omit it.
β EXAMPLES β
π§ Example 1. Normalize raw 16-bit samples to floating point
u-f -n < samples.u > samples.f
reads the binary unsigned-short stream in samples.u and writes normalized single-precision floats (scaled by 1/65536) to samples.f, producing values in the 0.0 to 1.0 range β which is exactly what you want for further floating-point signal processing. ate and left no crumbs π
π Example 2. Scale and analyze a sample stream
u-f 0.5 < signal.u | dstats
halves every unsigned-short sample, converts it to floating point, and pipes the result into dstats(1) so it can report the minimum, maximum, mean, and other descriptive statistics of your scaled data. the pipeline is piping, the stats are statting π
π SEE ALSO π
brlcad(1), u-a(1), u-bw(1), u-d(1), f-d(1), dstats(1) β go read the whole friend group, iykyk π
π 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. periodt. π«Ά
π BUG REPORTS π
reports of bugs or problems should be submitted via electronic mail to devs@brlcad.org β don't be shy, they wanna hear it π
π cute little sign-off: this page is from BRL-CAD, the U-F(1) manual page β and ngl the footer is giving minimalism, because there's no date on it at all, just the source and the page name. slay anyway πΈβ¨
π¦ 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