FA-91598 / Digital signal filters / Member archive
Coefficient quantizer rounds ties to even · case 03
0.125 at two fractional bits quantizes to code 0 instead of 1 (half away from zero).
Case contract
Input [coeffs, f, B, mode]: quantize each decimal coefficient to a B-bit two's-complement code with f fractional bits; "nearest" rounds half away from zero, "truncate" floors. Codes saturate to [-2^(B-1), 2^(B-1)-1]. Return {"codes", "saturated": count of clipped codes, "max_error": max |code/2^f - c| after saturation as a fraction string}.
Why this case matters
Coefficient quantization decides whether a fixed-point filter still meets spec; rounding and saturation slips shift poles.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: tie cases nearest | {"codes": [0, 2, 0], "max_error": "1/8", "saturated": 0} | {"codes": [1, 2, -1], "max_error": "1/8", "saturated": 0} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗