FAILURE MAP
← Case archive

FA-91603 / Digital signal filters / Member archive

Coefficient quantizer truncates toward zero · case 03

Negative coefficients in truncate mode quantize one LSB too high.

Member previewVariant 3 · 3 implementations · 7 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: random quantize 11{"codes": [-10, 83, 72, -56], "max_error": "3/200", "saturated": 0}{"codes": [-11, 83, 72, -57], "max_error": "113/8000", "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 ↗