FA-91541 / Digital signal filters / Open access
Polyphase decimator splits the filter into contiguous blocks · case 01
Long filters produce outputs that do not match filter-then-downsample.
ROOT CAUSE
Branch p takes h[pD:(p+1)D] instead of every D-th tap starting at p.
VERIFIED REPAIR
Use the interleaved split h[p::D].
Unsuccessful approach: The attempted repair interleaves from the end, h[D-1-p::D], which pairs taps with the wrong phases.
Case contract
Input [h, D, samples] (integers). Output y[m] = sum_k h[k] x[mD - k] for m = 0 .. ceil(len/D) - 1 with x = 0 outside the signal, computed through the polyphase split E_p[j] = h[jD + p].
Why this case matters
Polyphase decimators avoid computing discarded outputs; commutator and phase-split slips alias the output.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
h, D, xs = x
L = len(xs)
M = (L + D - 1) // D
phases = [h[p * D:(p + 1) * D] for p in range(D)]
out = []
for m in range(M):
acc = 0
for p in range(D):
for j, c in enumerate(phases[p]):
idx = (m - j) * D - p
if 0 <= idx < L:
acc += c * xs[idx]
out.append(acc)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['repair check: first sample matters', [[1], 3, [7, 1, 1, 1]], [7, 1]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]]], [['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['repair check: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]]], [['regression: random polyphase 10', [[3, -1, 1, 0, -2, 2], 4, [3, -3, 0, -3, 2, 1]], [9, 3]], ['regression: random polyphase 11', [[-2, 1, 4, -2, -3], 4, [-1, -4, -2, 5, 4, 5, 3, 1, 0]], [2, 0, -9]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: impulse through D=2 | [1, 2, 0] | [1, 3, 0] | Failed |
| regression: length divisible | [1, 4] | [1, 5] | Failed |
| repair check: first sample matters | [7, 1] | [7, 1] | Passed |
| regression: long filter D=3 | [1, 4, 10] | [1, 6, 11] | Failed |
| regression: random polyphase 0 | [6, 5, -10, 5] | [6, 11, -4, -3] | Failed |
| regression: random polyphase 1 | [-6, 14] | [-6, 4] | Failed |
| regression: random polyphase 2 | [-8, -8] | [-8, 5] | Failed |
SHA-256 / c686e775874a4b0584348e0f37804d4b7e689a8706c53aa1be6b92d97fbcb84e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
h, D, xs = x
L = len(xs)
M = (L + D - 1) // D
phases = [h[D - 1 - p::D] for p in range(D)]
out = []
for m in range(M):
acc = 0
for p in range(D):
for j, c in enumerate(phases[p]):
idx = (m - j) * D - p
if 0 <= idx < L:
acc += c * xs[idx]
out.append(acc)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['repair check: first sample matters', [[1], 3, [7, 1, 1, 1]], [7, 1]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]]], [['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['repair check: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]]], [['regression: random polyphase 10', [[3, -1, 1, 0, -2, 2], 4, [3, -3, 0, -3, 2, 1]], [9, 3]], ['regression: random polyphase 11', [[-2, 1, 4, -2, -3], 4, [-1, -4, -2, 5, 4, 5, 3, 1, 0]], [2, 0, -9]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: impulse through D=2 | [2, 0, 0] | [1, 3, 0] | Failed |
| regression: length divisible | [1, 5] | [1, 5] | Passed |
| repair check: first sample matters | [0, 1] | [7, 1] | Failed |
| regression: long filter D=3 | [3, 6, 9] | [1, 6, 11] | Failed |
| regression: random polyphase 0 | [-3, -10, -1, 9] | [6, 11, -4, -3] | Failed |
| regression: random polyphase 1 | [-3, 5] | [-6, 4] | Failed |
| regression: random polyphase 2 | [4, -8] | [-8, 5] | Failed |
SHA-256 / 6aec40d2d5227978dc03451cbc0d11656ae648d41bb042099fa6536a7d3bcfa5
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
h, D, xs = x
L = len(xs)
M = (L + D - 1) // D
phases = [h[p::D] for p in range(D)]
out = []
for m in range(M):
acc = 0
for p in range(D):
for j, c in enumerate(phases[p]):
idx = (m - j) * D - p
if 0 <= idx < L:
acc += c * xs[idx]
out.append(acc)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: impulse through D=2', [[1, 2, 3], 2, [1, 0, 0, 0, 0]], [1, 3, 0]], ['regression: length divisible', [[1, 1], 2, [1, 2, 3, 4]], [1, 5]], ['repair check: first sample matters', [[1], 3, [7, 1, 1, 1]], [7, 1]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]]], [['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: long filter D=3', [[1, 2, 3, 4, 5], 3, [1, 0, 0, 2, 0, 0, 3]], [1, 6, 11]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]]], [['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 0', [[2, -1], 2, [3, -3, 4, -2, -3, 5, 1]], [6, 11, -4, -3]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]], [['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]], ['regression: random polyphase 8', [[-3, 0, 2, 1, 2], 4, [-2, 0, -1, -1, -4, -2, 1]], [6, 6]], ['repair check: random polyphase 3', [[-3], 4, [5, -1, 2, 1, -2]], [-15, 6]], ['regression: random polyphase 1', [[-2, 4, -1, -1, 1, -3], 4, [3, 0, 1, 0, -1, -2]], [-6, 4]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]]], [['regression: random polyphase 10', [[3, -1, 1, 0, -2, 2], 4, [3, -3, 0, -3, 2, 1]], [9, 3]], ['regression: random polyphase 11', [[-2, 1, 4, -2, -3], 4, [-1, -4, -2, 5, 4, 5, 3, 1, 0]], [2, 0, -9]], ['regression: random polyphase 5', [[3, 1, -1, 0, -1], 2, [-3, 5, 4, 1]], [-9, 20]], ['regression: random polyphase 2', [[4, 2, 3, -2, 4], 4, [-2, -4, 3, 0, -1, -2, 3, -1]], [-8, 5]], ['regression: random polyphase 4', [[0, -1, 1, -1, 4], 3, [3, 2, 5, 3, -1, 0, -3, 2, -1, -2]], [0, -6, 16, 6]], ['regression: random polyphase 6', [[1, -2, 3, 2, -1], 4, [4, 3, 5, -3, -4, -2]], [4, 19]], ['regression: random polyphase 7', [[1, -1, 0], 4, [4, 5, -2, -1, 0]], [4, 1]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: impulse through D=2 | [1, 3, 0] | [1, 3, 0] | Passed |
| regression: length divisible | [1, 5] | [1, 5] | Passed |
| repair check: first sample matters | [7, 1] | [7, 1] | Passed |
| regression: long filter D=3 | [1, 6, 11] | [1, 6, 11] | Passed |
| regression: random polyphase 0 | [6, 11, -4, -3] | [6, 11, -4, -3] | Passed |
| regression: random polyphase 1 | [-6, 4] | [-6, 4] | Passed |
| regression: random polyphase 2 | [-8, 5] | [-8, 5] | Passed |
SHA-256 / cb4c842736f512d8e42ac1d08b70ab1a6ef4558a0e39ad5ffe4b4de7e7273c31
Verification & scope
A deterministic bounded teaching model with a stipulated toy contract; exact rational arithmetic or fixed-decimal rounding keeps outputs strict JSON. It is not a production DSP library and claims no standards conformance. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:51:36.919714+00:00.
Case digest / fc460f22f6fc6fc41ecf14895a2fbb17143156a39dc034753192bb785d0115d2