{"abstract":"Even-length designs are not symmetric and lose linear phase.","category":"Digital signal filters","checks":7,"contract":"Input [N, fc, window]; fc is the cutoff as a fraction of Nyquist in (0, 1], window hamming (0.54 - 0.46 cos(2 pi n/(N-1))), hann (0.5 - 0.5 cos(...)) or rect (N = 1 uses 1). Taps h[n] = fc sinc(fc (n - (N-1)/2)) w[n], normalized to unit DC gain and rounded to 8 decimals; \"bad-spec\" for invalid input (Hann needs N != 2).","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-windowed-sinc-lowpass","failed_approach":"The attempted repair uses (N - 1) // 2, still an integer centre for even N.","family":"w2-digital_signal_filters-windowed-sinc-lowpass-symmetry-centre","id":"FA-91496","implementations":{"attempt":{"sha256":"ef40bc078c8342b26c2d0da4bd49ae9d95b4116cd942c7ba75507fbfcfda5727","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    N, fc_s, win = x\n    fc = float(Fraction(fc_s))\n    if N < 1 or not 0 < fc <= 1:\n        return 'bad-spec'\n    c = (N - 1) // 2\n    taps = []\n    for n in range(N):\n        t = n - c\n        s = 1.0 if t == 0 else math.sin(math.pi * fc * t) / (math.pi * fc * t)\n        if N == 1 or win == 'rect':\n            w = 1.0\n        elif win == 'hann':\n            w = 0.5 - 0.5 * math.cos(2 * math.pi * n / (N - 1))\n        else:\n            w = 0.54 - 0.46 * math.cos(2 * math.pi * n / (N - 1))\n        taps.append(fc * s * w)\n    tot = sum(taps)\n    return [round(v / tot, 8) + 0.0 for v in taps]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: N=2 fc=1/2 hamming', [2, '1/2', 'hamming'], [0.5, 0.5]], ['regression: N=2 fc=1/2 rect', [2, '1/2', 'rect'], [0.5, 0.5]], ['regression: N=2 fc=1/4 hamming', [2, '1/4', 'hamming'], [0.5, 0.5]], ['control: N=1 fc=1/2 hamming', [1, '1/2', 'hamming'], [1.0]], ['control: N=1 fc=1/2 hann', [1, '1/2', 'hann'], [1.0]], ['control: N=1 fc=1/2 rect', [1, '1/2', 'rect'], [1.0]], ['control: N=1 fc=1/4 hamming', [1, '1/4', 'hamming'], [1.0]]], [['regression: N=2 fc=1/4 rect', [2, '1/4', 'rect'], [0.5, 0.5]], ['regression: N=2 fc=3/5 hamming', [2, '3/5', 'hamming'], [0.5, 0.5]], ['regression: N=2 fc=1/4 hamming', [2, '1/4', 'hamming'], [0.5, 0.5]], ['control: N=1 fc=1/4 hann', [1, '1/4', 'hann'], [1.0]], ['control: N=1 fc=1/4 rect', [1, '1/4', 'rect'], [1.0]], ['control: N=1 fc=3/5 hamming', [1, '3/5', 'hamming'], [1.0]], ['control: N=1 fc=3/5 hann', [1, '3/5', 'hann'], [1.0]]], [['regression: N=2 fc=1 hamming', [2, '1', 'hamming'], [0.5, 0.5]], ['regression: N=2 fc=1 rect', [2, '1', 'rect'], [0.5, 0.5]], ['regression: N=2 fc=3/5 hamming', [2, '3/5', 'hamming'], [0.5, 0.5]], ['control: N=1 fc=3/5 rect', [1, '3/5', 'rect'], [1.0]], ['control: N=1 fc=1 hamming', [1, '1', 'hamming'], [1.0]], ['control: N=1 fc=1 hann', [1, '1', 'hann'], [1.0]], ['control: N=1 fc=1 rect', [1, '1', 'rect'], [1.0]]], [['regression: N=4 fc=1/2 hann', [4, '1/2', 'hann'], [0.0, 0.5, 0.5, 0.0]], ['regression: N=4 fc=1/2 rect', [4, '1/2', 'rect'], [0.125, 0.375, 0.375, 0.125]], ['regression: N=2 fc=1 hamming', [2, '1', 'hamming'], [0.5, 0.5]], ['control: N=5 fc=1/2 hamming', [5, '1/2', 'hamming'], [0.0, 0.20371237, 0.59257526, 0.20371237, 0.0]], ['control: N=5 fc=1/2 hann', [5, '1/2', 'hann'], [0.0, 0.19449226, 0.61101547, 0.19449226, 0.0]], ['control: N=5 fc=1/2 rect', [5, '1/2', 'rect'], [0.0, 0.28004958, 0.43990085, 0.28004958, 0.0]], ['control: N=5 fc=1/4 hamming', [5, '1/4', 'hamming'], [0.02455383, 0.23438946, 0.4821134, 0.23438946, 0.02455383]]], [['regression: N=4 fc=1/4 hann', [4, '1/4', 'hann'], [0.0, 0.5, 0.5, 0.0]], ['regression: N=4 fc=1/4 rect', [4, '1/4', 'rect'], [0.22295145, 0.27704855, 0.27704855, 0.22295145]], ['regression: N=4 fc=1/2 hamming', [4, '1/2', 'hamming'], [0.0167364, 0.4832636, 0.4832636, 0.0167364]], ['control: N=5 fc=1/4 hann', [5, '1/4', 'hann'], [0.0, 0.23688591, 0.52622818, 0.23688591, 0.0]], ['control: N=5 fc=1/4 rect', [5, '1/4', 'rect'], [0.15626896, 0.22099768, 0.24546671, 0.22099768, 0.15626896]], ['control: N=5 fc=3/5 hamming', [5, '3/5', 'hamming'], [-0.00820621, 0.17925211, 0.65790821, 0.17925211, -0.00820621]], ['control: N=5 fc=3/5 hann', [5, '3/5', 'hann'], [0.0, 0.16767497, 0.66465005, 0.16767497, 0.0]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"58c987dbc579dea5bd8dabf9ee83019035a3d5d93882d04381a7a7827a1643ee","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    N, fc_s, win = x\n    fc = float(Fraction(fc_s))\n    if N < 1 or not 0 < fc <= 1:\n        return 'bad-spec'\n    c = N // 2\n    taps = []\n    for n in range(N):\n        t = n - c\n        s = 1.0 if t == 0 else math.sin(math.pi * fc * t) / (math.pi * fc * t)\n        if N == 1 or win == 'rect':\n            w = 1.0\n        elif win == 'hann':\n            w = 0.5 - 0.5 * math.cos(2 * math.pi * n / (N - 1))\n        else:\n            w = 0.54 - 0.46 * math.cos(2 * math.pi * n / (N - 1))\n        taps.append(fc * s * w)\n    tot = sum(taps)\n    return [round(v / tot, 8) + 0.0 for v in taps]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: N=2 fc=1/2 hamming', [2, '1/2', 'hamming'], [0.5, 0.5]], ['regression: N=2 fc=1/2 rect', [2, '1/2', 'rect'], [0.5, 0.5]], ['regression: N=2 fc=1/4 hamming', [2, '1/4', 'hamming'], [0.5, 0.5]], ['control: N=1 fc=1/2 hamming', [1, '1/2', 'hamming'], [1.0]], ['control: N=1 fc=1/2 hann', [1, '1/2', 'hann'], [1.0]], ['control: N=1 fc=1/2 rect', [1, '1/2', 'rect'], [1.0]], ['control: N=1 fc=1/4 hamming', [1, '1/4', 'hamming'], [1.0]]], [['regression: N=2 fc=1/4 rect', [2, '1/4', 'rect'], [0.5, 0.5]], ['regression: N=2 fc=3/5 hamming', [2, '3/5', 'hamming'], [0.5, 0.5]], ['regression: N=2 fc=1/4 hamming', [2, '1/4', 'hamming'], [0.5, 0.5]], ['control: N=1 fc=1/4 hann', [1, '1/4', 'hann'], [1.0]], ['control: N=1 fc=1/4 rect', [1, '1/4', 'rect'], [1.0]], ['control: N=1 fc=3/5 hamming', [1, '3/5', 'hamming'], [1.0]], ['control: N=1 fc=3/5 hann', [1, '3/5', 'hann'], [1.0]]], [['regression: N=2 fc=1 hamming', [2, '1', 'hamming'], [0.5, 0.5]], ['regression: N=2 fc=1 rect', [2, '1', 'rect'], [0.5, 0.5]], ['regression: N=2 fc=3/5 hamming', [2, '3/5', 'hamming'], [0.5, 0.5]], ['control: N=1 fc=3/5 rect', [1, '3/5', 'rect'], [1.0]], ['control: N=1 fc=1 hamming', [1, '1', 'hamming'], [1.0]], ['control: N=1 fc=1 hann', [1, '1', 'hann'], [1.0]], ['control: N=1 fc=1 rect', [1, '1', 'rect'], [1.0]]], [['regression: N=4 fc=1/2 hann', [4, '1/2', 'hann'], [0.0, 0.5, 0.5, 0.0]], ['regression: N=4 fc=1/2 rect', [4, '1/2', 'rect'], [0.125, 0.375, 0.375, 0.125]], ['regression: N=2 fc=1 hamming', [2, '1', 'hamming'], [0.5, 0.5]], ['control: N=5 fc=1/2 hamming', [5, '1/2', 'hamming'], [0.0, 0.20371237, 0.59257526, 0.20371237, 0.0]], ['control: N=5 fc=1/2 hann', [5, '1/2', 'hann'], [0.0, 0.19449226, 0.61101547, 0.19449226, 0.0]], ['control: N=5 fc=1/2 rect', [5, '1/2', 'rect'], [0.0, 0.28004958, 0.43990085, 0.28004958, 0.0]], ['control: N=5 fc=1/4 hamming', [5, '1/4', 'hamming'], [0.02455383, 0.23438946, 0.4821134, 0.23438946, 0.02455383]]], [['regression: N=4 fc=1/4 hann', [4, '1/4', 'hann'], [0.0, 0.5, 0.5, 0.0]], ['regression: N=4 fc=1/4 rect', [4, '1/4', 'rect'], [0.22295145, 0.27704855, 0.27704855, 0.22295145]], ['regression: N=4 fc=1/2 hamming', [4, '1/2', 'hamming'], [0.0167364, 0.4832636, 0.4832636, 0.0167364]], ['control: N=5 fc=1/4 hann', [5, '1/4', 'hann'], [0.0, 0.23688591, 0.52622818, 0.23688591, 0.0]], ['control: N=5 fc=1/4 rect', [5, '1/4', 'rect'], [0.15626896, 0.22099768, 0.24546671, 0.22099768, 0.15626896]], ['control: N=5 fc=3/5 hamming', [5, '3/5', 'hamming'], [-0.00820621, 0.17925211, 0.65790821, 0.17925211, -0.00820621]], ['control: N=5 fc=3/5 hann', [5, '3/5', 'hann'], [0.0, 0.16767497, 0.66465005, 0.16767497, 0.0]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-digital_signal_filters-windowed-sinc-lowpass-symmetry-centre","generated_at":"2026-09-29T14:51:36.487487+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Windowed-sinc design is the default FIR recipe; centre or normalization slips yield non-linear-phase or wrong-gain filters.","root_cause":"The centre is N // 2 instead of (N - 1) / 2, which is a half-integer for even N.","sha256":"a4956a71b857421acd874a643a3b4f672d0b7746c18f3d0bd44f9e3a98590b2b","title":"Windowed sinc centres even-length filters on a sample · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.234,"exit_code":1,"observations":[{"actual":[0.61101547,0.38898453],"check":"regression: N=2 fc=1/2 hamming","expected":[0.5,0.5],"passed":false},{"actual":[0.61101547,0.38898453],"check":"regression: N=2 fc=1/2 rect","expected":[0.5,0.5],"passed":false},{"actual":[0.52622818,0.47377182],"check":"regression: N=2 fc=1/4 hamming","expected":[0.5,0.5],"passed":false},{"actual":[1.0],"check":"control: N=1 fc=1/2 hamming","expected":[1.0],"passed":true},{"actual":[1.0],"check":"control: N=1 fc=1/2 hann","expected":[1.0],"passed":true},{"actual":[1.0],"check":"control: N=1 fc=1/2 rect","expected":[1.0],"passed":true},{"actual":[1.0],"check":"control: N=1 fc=1/4 hamming","expected":[1.0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: N=2 fc=1/2 hamming\", \"actual\": [0.61101547, 0.38898453], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"regression: N=2 fc=1/2 rect\", \"actual\": [0.61101547, 0.38898453], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"regression: N=2 fc=1/4 hamming\", \"actual\": [0.52622818, 0.47377182], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"control: N=1 fc=1/2 hamming\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"control: N=1 fc=1/2 hann\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"control: N=1 fc=1/2 rect\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"control: N=1 fc=1/4 hamming\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.509,"exit_code":1,"observations":[{"actual":[0.38898453,0.61101547],"check":"regression: N=2 fc=1/2 hamming","expected":[0.5,0.5],"passed":false},{"actual":[0.38898453,0.61101547],"check":"regression: N=2 fc=1/2 rect","expected":[0.5,0.5],"passed":false},{"actual":[0.47377182,0.52622818],"check":"regression: N=2 fc=1/4 hamming","expected":[0.5,0.5],"passed":false},{"actual":[1.0],"check":"control: N=1 fc=1/2 hamming","expected":[1.0],"passed":true},{"actual":[1.0],"check":"control: N=1 fc=1/2 hann","expected":[1.0],"passed":true},{"actual":[1.0],"check":"control: N=1 fc=1/2 rect","expected":[1.0],"passed":true},{"actual":[1.0],"check":"control: N=1 fc=1/4 hamming","expected":[1.0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: N=2 fc=1/2 hamming\", \"actual\": [0.38898453, 0.61101547], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"regression: N=2 fc=1/2 rect\", \"actual\": [0.38898453, 0.61101547], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"regression: N=2 fc=1/4 hamming\", \"actual\": [0.47377182, 0.52622818], \"expected\": [0.5, 0.5], \"passed\": false}, {\"check\": \"control: N=1 fc=1/2 hamming\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"control: N=1 fc=1/2 hann\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"control: N=1 fc=1/2 rect\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}, {\"check\": \"control: N=1 fc=1/4 hamming\", \"actual\": [1.0], \"expected\": [1.0], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}