FAILURE MAP
← Case archive

FA-91516 / Digital signal filters / Open access

Frequency response treats Nyquist-relative input as sample-rate-relative · case 01

f = 1/2 (half Nyquist) is evaluated at Nyquist.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The angular frequency is 2 pi f instead of pi f.

THE FAILURE

The angular frequency is 2 pi f instead of pi f.

Unsuccessful approach: The attempted repair uses pi f / 2, halving the frequency instead.

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 = 2 * 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-9:
            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: first difference', [[1, -1], [1], ['0', '1/2', '1']], ['zero', [3.0103, 45.0], [6.0206, 0.0]]], ['regression: 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: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]]], [['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]], ['regression: 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: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: 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]]], ['regression: 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]]]], [['regression: 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]]], ['regression: 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]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]], ['control: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['regression: 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]]]], [['regression: random response 4', [[-1], [1, '1/2'], ['3/4', '1', '0']], [[2.6529, -151.325], [6.0206, -180.0], [-3.5218, 180.0]]], ['regression: 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]]], ['regression: 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: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]], ['regression: 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]]]], [['regression: 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: 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]]], ['regression: random response 3', [[0, 0, -1], [1], ['1/2', '1/8', '1']], [[0.0, 0.0], [0.0, 135.0], [0.0, -180.0]]], ['control: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: 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]]], ['regression: 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]]]]]
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 fixtureActualExpectedOutcome
regression: two-tap average at nyquist[[6.0206, 0.0]]['zero']Failed
regression: first difference['zero', [6.0206, 0.0], 'zero']['zero', [3.0103, 45.0], [6.0206, 0.0]]Failed
regression: one pole[[6.0206, 0.0], [-0.9691, -26.565], [-3.5218, 0.0]][[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]]Failed
control: pole on unit circle['pole']['pole']Passed
control: small magnitude[[-80.0, 0.0]][[-80.0, 0.0]]Passed
regression: deep notch[[6.0206, 0.0], [6.0034, 3.6]]['zero', [-24.0378, -88.2]]Failed
regression: pure delay phase[[0.0, -90.0], [0.0, -180.0]][[0.0, -45.0], [0.0, -90.0]]Failed

SHA-256 / 21faf7b159a152045c516f09ea470a62d29af74134c479469ec6d8c412cc73f1

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)) / 2
        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-9:
            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: first difference', [[1, -1], [1], ['0', '1/2', '1']], ['zero', [3.0103, 45.0], [6.0206, 0.0]]], ['regression: 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: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]]], [['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]], ['regression: 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: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: 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]]], ['regression: 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]]]], [['regression: 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]]], ['regression: 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]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]], ['control: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: deep notch', [[1, 0, 1], [1], ['1/2', '0.49']], ['zero', [-24.0378, -88.2]]], ['regression: 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]]]], [['regression: random response 4', [[-1], [1, '1/2'], ['3/4', '1', '0']], [[2.6529, -151.325], [6.0206, -180.0], [-3.5218, 180.0]]], ['regression: 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]]], ['regression: 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: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: pure delay phase', [[0, 1], [1], ['1/4', '1/2']], [[0.0, -45.0], [0.0, -90.0]]], ['regression: 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]]]], [['regression: 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: 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]]], ['regression: random response 3', [[0, 0, -1], [1], ['1/2', '1/8', '1']], [[0.0, 0.0], [0.0, 135.0], [0.0, -180.0]]], ['control: pole on unit circle', [[1], [1, -1], ['0']], ['pole']], ['control: small magnitude', [[1, '-0.9999'], [1], ['0']], [[-80.0, 0.0]]], ['regression: 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]]], ['regression: 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]]]]]
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 fixtureActualExpectedOutcome
regression: two-tap average at nyquist[[3.0103, -45.0]]['zero']Failed
regression: first difference['zero', [-2.3226, 67.5], [3.0103, 45.0]]['zero', [3.0103, 45.0], [6.0206, 0.0]]Failed
regression: one pole[[6.0206, 0.0], [4.8662, -19.576], [2.6529, -28.675]][[6.0206, 0.0], [2.6529, -28.675], [-0.9691, -26.565]]Failed
control: pole on unit circle['pole']['pole']Passed
control: small magnitude[[-80.0, 0.0]][[-80.0, 0.0]]Passed
regression: deep notch[[3.0103, -45.0], [3.1446, -44.1]]['zero', [-24.0378, -88.2]]Failed
regression: pure delay phase[[0.0, -22.5], [0.0, -45.0]][[0.0, -45.0], [0.0, -90.0]]Failed

SHA-256 / 8c961449f65949fc54f392cc0a2ab849d7576eb618ea06a755b8a276945326f8

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.799327+00:00.

Case digest / 75c4e51762f63a6867c2d4c7d8979b6017e19a5926546d555d5802714f1fd30b