FA-91531 / Digital signal filters / Open access
Frequency response only reports exact zeros · case 01
A notch that evaluates to 1e-16 due to rounding is reported as about -320 dB with a random phase.
ROOT CAUSE
The zero test compares the magnitude with == 0.
THE FAILURE
The zero test compares the magnitude with == 0.
Unsuccessful approach: The attempted repair uses 1e-3, which also hides legitimate -70 dB attenuation.
Case contract
Input [b, a, freqs]; coefficients and frequencies are numbers or rational strings, frequencies are fractions of Nyquist. For w = pi f evaluate H = B(e^{jw})/A(e^{jw}) with z^-k = e^{-jwk}; return per frequency [20 log10 |H| rounded to 4, phase in degrees rounded to 3], "pole" if |A| < 1e-12, "zero" if |H| < 1e-9.
Why this case matters
Magnitude and phase plots are how filters are verified; unit or sign slips misreport cutoff and delay.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import cmath
from fractions import Fraction
N = 1
observations = []
def solve(x):
b, a, fs = x
b = [float(Fraction(v)) for v in b]
a = [float(Fraction(v)) for v in a]
out = []
for f in fs:
w = math.pi * float(Fraction(f))
B = sum(c * cmath.exp(-1j * w * k) for k, c in enumerate(b))
A = sum(c * cmath.exp(-1j * w * k) for k, c in enumerate(a))
if abs(A) < 1e-12:
out.append('pole')
continue
H = B / A
mag = abs(H)
if mag == 0:
out.append('zero')
continue
out.append([round(20 * math.log10(mag), 4) + 0.0, round(math.degrees(cmath.phase(H)), 3) + 0.0])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: first difference', [[1, -1], [1], ['0', '1/2', '1']], ['zero', [3.0103, 45.0], [6.0206, 0.0]]], ['control: one pole', [[1], [1, '-1/2'], ['0', '1/4', '1/2']], [[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]]], ['control: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 0', [['-1/4', 1], [1, 0], ['1/3', '1/8', '1/8']], [[-0.9018, -73.898], [-2.2144, -29.591], [-2.2144, -29.591]]], ['control: random response 1', [[0, -1, 1, 0], [1, '1/3', '1/3'], ['1/2', '3/4', '1/8']], [[5.563, 161.565], [7.5974, 60.22], [-12.1798, -110.508]]], ['control: random response 2', [['1/2', '-1/4', 0, 2], [1, '1/2', '1/2'], ['1/2', '1/2', '1/2']], [[10.2633, 122.471], [10.2633, 122.471], [10.2633, 122.471]]], ['control: random response 3', [[0, 0, -1], [1], ['1/2', '1/8', '1']], [[0.0, 0.0], [0.0, 135.0], [0.0, -180.0]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 4', [[-1], [1, '1/2'], ['3/4', '1', '0']], [[2.6529, -151.325], [6.0206, -180.0], [-3.5218, 180.0]]], ['control: random response 5', [[1], [1, '1/2', '1/2'], ['1/4', '1', '1/8']], [[-4.0835, 32.236], [0.0, 0.0], [-5.5545, 16.706]]], ['control: random response 6', [[1, -1], [1, '1/3', '1/3'], ['1/8', '1', '1/2']], [[-12.1798, 91.992], [6.0206, 0.0], [5.563, 71.565]]], ['control: random response 7', [[2, -1], [1, '1/2'], ['3/4', '1/3', '1/3']], [[11.5896, 43.314], [2.3408, 49.107], [2.3408, 49.107]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 8', [[1, 2, -1, 1], [1, '-1/4', 0], ['1', '1/4', '0']], [[7.6042, -180.0], [7.6969, -45.419], [12.0412, 0.0]]], ['control: random response 9', [[1], [1, '1/2'], ['1', '1/4', '1']], [[6.0206, 0.0], [-2.9161, 14.639], [6.0206, 0.0]]], ['control: random response 10', [[-1, 1], [1], ['1/3', '1', '1/3']], [[0.0, -120.0], [6.0206, -180.0], [0.0, -120.0]]], ['control: random response 11', [[1, 2, 0], [1], ['1/2', '0', '1/8']], [[6.9897, -63.435], [9.5424, 0.0], [9.393, -15.043]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 12', [['-1/4'], [1, '1/2', 0], ['1/8', '0', '0']], [[-15.4136, -172.543], [-15.563, 180.0], [-15.563, 180.0]]], ['control: random response 13', [[-1, 2], [1, 0, '1/3'], ['1/2', '1/2', '1/8']], [[10.5115, -116.565], [10.5115, -116.565], [-0.8391, -31.277]]], ['control: random response 14', [[2, '1/2', -1], [1], ['1/8', '1/3', '0']], [[5.2445, 16.379], [8.893, 8.948], [3.5218, 0.0]]], ['control: random response 15', [[0, -1, '1/2', 0], [1], ['0', '1/8', '3/4']], [[-6.0206, 180.0], [-4.8662, 177.076], [2.9161, 59.639]]]]]
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: two-tap average at nyquist | [[-318.2398, -90.0]] | ['zero'] | Failed |
| regression: deep notch | [[-318.2398, -90.0], [-24.0378, -88.2]] | ['zero', [-24.0378, -88.2]] | Failed |
| repair check: small magnitude | [[-80.0, 0.0]] | [[-80.0, 0.0]] | Passed |
| control: first difference | ['zero', [3.0103, 45.0], [6.0206, 0.0]] | ['zero', [3.0103, 45.0], [6.0206, 0.0]] | Passed |
| control: one pole | [[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]] | [[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]] | Passed |
| control: pole on unit circle | ['pole'] | ['pole'] | Passed |
| control: pure delay phase | [[0.0, -45.0], [0.0, -90.0]] | [[0.0, -45.0], [0.0, -90.0]] | Passed |
SHA-256 / 111d5585a425921831f6c6f056b206bcf80515b4fbea5251f1bd8283dda9389c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import cmath
from fractions import Fraction
N = 1
observations = []
def solve(x):
b, a, fs = x
b = [float(Fraction(v)) for v in b]
a = [float(Fraction(v)) for v in a]
out = []
for f in fs:
w = math.pi * float(Fraction(f))
B = sum(c * cmath.exp(-1j * w * k) for k, c in enumerate(b))
A = sum(c * cmath.exp(-1j * w * k) for k, c in enumerate(a))
if abs(A) < 1e-12:
out.append('pole')
continue
H = B / A
mag = abs(H)
if mag < 1e-3:
out.append('zero')
continue
out.append([round(20 * math.log10(mag), 4) + 0.0, round(math.degrees(cmath.phase(H)), 3) + 0.0])
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: first difference', [[1, -1], [1], ['0', '1/2', '1']], ['zero', [3.0103, 45.0], [6.0206, 0.0]]], ['control: one pole', [[1], [1, '-1/2'], ['0', '1/4', '1/2']], [[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]]], ['control: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 0', [['-1/4', 1], [1, 0], ['1/3', '1/8', '1/8']], [[-0.9018, -73.898], [-2.2144, -29.591], [-2.2144, -29.591]]], ['control: random response 1', [[0, -1, 1, 0], [1, '1/3', '1/3'], ['1/2', '3/4', '1/8']], [[5.563, 161.565], [7.5974, 60.22], [-12.1798, -110.508]]], ['control: random response 2', [['1/2', '-1/4', 0, 2], [1, '1/2', '1/2'], ['1/2', '1/2', '1/2']], [[10.2633, 122.471], [10.2633, 122.471], [10.2633, 122.471]]], ['control: random response 3', [[0, 0, -1], [1], ['1/2', '1/8', '1']], [[0.0, 0.0], [0.0, 135.0], [0.0, -180.0]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 4', [[-1], [1, '1/2'], ['3/4', '1', '0']], [[2.6529, -151.325], [6.0206, -180.0], [-3.5218, 180.0]]], ['control: random response 5', [[1], [1, '1/2', '1/2'], ['1/4', '1', '1/8']], [[-4.0835, 32.236], [0.0, 0.0], [-5.5545, 16.706]]], ['control: random response 6', [[1, -1], [1, '1/3', '1/3'], ['1/8', '1', '1/2']], [[-12.1798, 91.992], [6.0206, 0.0], [5.563, 71.565]]], ['control: random response 7', [[2, -1], [1, '1/2'], ['3/4', '1/3', '1/3']], [[11.5896, 43.314], [2.3408, 49.107], [2.3408, 49.107]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 8', [[1, 2, -1, 1], [1, '-1/4', 0], ['1', '1/4', '0']], [[7.6042, -180.0], [7.6969, -45.419], [12.0412, 0.0]]], ['control: random response 9', [[1], [1, '1/2'], ['1', '1/4', '1']], [[6.0206, 0.0], [-2.9161, 14.639], [6.0206, 0.0]]], ['control: random response 10', [[-1, 1], [1], ['1/3', '1', '1/3']], [[0.0, -120.0], [6.0206, -180.0], [0.0, -120.0]]], ['control: random response 11', [[1, 2, 0], [1], ['1/2', '0', '1/8']], [[6.9897, -63.435], [9.5424, 0.0], [9.393, -15.043]]]], [['regression: two-tap average at nyquist', [[1, 1], [1], ['1']], ['zero']], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['repair check: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['control: random response 12', [['-1/4'], [1, '1/2', 0], ['1/8', '0', '0']], [[-15.4136, -172.543], [-15.563, 180.0], [-15.563, 180.0]]], ['control: random response 13', [[-1, 2], [1, 0, '1/3'], ['1/2', '1/2', '1/8']], [[10.5115, -116.565], [10.5115, -116.565], [-0.8391, -31.277]]], ['control: random response 14', [[2, '1/2', -1], [1], ['1/8', '1/3', '0']], [[5.2445, 16.379], [8.893, 8.948], [3.5218, 0.0]]], ['control: random response 15', [[0, -1, '1/2', 0], [1], ['0', '1/8', '3/4']], [[-6.0206, 180.0], [-4.8662, 177.076], [2.9161, 59.639]]]]]
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: two-tap average at nyquist | ['zero'] | ['zero'] | Passed |
| regression: deep notch | ['zero', [-24.0378, -88.2]] | ['zero', [-24.0378, -88.2]] | Passed |
| repair check: small magnitude | ['zero'] | [[-80.0, 0.0]] | Failed |
| control: first difference | ['zero', [3.0103, 45.0], [6.0206, 0.0]] | ['zero', [3.0103, 45.0], [6.0206, 0.0]] | Passed |
| control: one pole | [[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]] | [[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]] | Passed |
| control: pole on unit circle | ['pole'] | ['pole'] | Passed |
| control: pure delay phase | [[0.0, -45.0], [0.0, -90.0]] | [[0.0, -45.0], [0.0, -90.0]] | Passed |
SHA-256 / 381616e0be187ba536b07352d18cea3c21cadb6c9263eda7e367159eaf98538c
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.930701+00:00.
Case digest / 47537a0271164dd0c8733db3273c42a64a8d8e62811fccfe742b7eccb0d77a51