{"abstract":"Bin powers are wildly high for bins whose states have the same sign.","category":"Digital signal filters","checks":7,"contract":"Input [N, k, samples]; samples must have length N (\"length-mismatch\"). Goertzel recursion s = x + c s1 - s2 with c = 2 cos(2 pi k / N) from zero state; power = s1^2 + s2^2 - c s1 s2, rounded to 6 decimals (equals |X[k]|^2 of the DFT).","contract_signature":"x","evaluation_group":"w2-digital_signal_filters-goertzel-bin-power","failed_approach":"The attempted repair uses 2 cos(w/2) as the cross-term coefficient.","family":"w2-digital_signal_filters-goertzel-bin-power-power-cross-term-sign","id":"FA-91721","implementations":{"attempt":{"sha256":"4880b97766f6d7e2a848b39033c1dabd3ba522f87175c50bc3c6f9cbc0980094","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    N, k, xs = x\n    if len(xs) != N:\n        return 'length-mismatch'\n    w = 2 * math.pi * k / N\n    coeff = 2 * math.cos(w)\n    s1 = s2 = 0.0\n    for v in xs:\n        s = v + coeff * s1 - s2\n        s2 = s1\n        s1 = s\n    power = s1 * s1 + s2 * s2 - 2 * math.cos(w / 2) * s1 * s2\n    return round(power, 6) + 0.0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: dc bin', [4, 0, [1, 1, 1, 1]], 16.0], ['regression: nyquist bin', [4, 2, [1, -1, 1, -1]], 16.0], ['regression: random goertzel 0', [5, 3, [1.783, -0.103, 1.735, 0.172, 0.47]], 7.631659], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 1', [16, 7, [1.67, -0.361, -1.179, -1.404, -0.191, 0.823, -1.353, 1.734, 0.486, 0.989, 1.205, -0.229, 1.256, -0.62, 1.422, -1.514]], 81.860198], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049]], [['regression: random goertzel 1', [16, 7, [1.67, -0.361, -1.179, -1.404, -0.191, 0.823, -1.353, 1.734, 0.486, 0.989, 1.205, -0.229, 1.256, -0.62, 1.422, -1.514]], 81.860198], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 0', [5, 3, [1.783, -0.103, 1.735, 0.172, 0.47]], 7.631659], ['regression: random goertzel 4', [5, 1, [0.277, 1.508, 1.644, 1.371, 0.902]], 2.552062]], [['regression: random goertzel 4', [5, 1, [0.277, 1.508, 1.644, 1.371, 0.902]], 2.552062], ['regression: random goertzel 6', [16, 3, [-0.301, 1.167, -1.088, 1.455, 1.212, 0.703, -1.679, -0.745, -1.885, -0.092, 1.441, 0.517, 1.787, 1.007, 1.333, 0.125]], 11.236712], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 1', [16, 7, [1.67, -0.361, -1.179, -1.404, -0.191, 0.823, -1.353, 1.734, 0.486, 0.989, 1.205, -0.229, 1.256, -0.62, 1.422, -1.514]], 81.860198], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049]], [['regression: random goertzel 12', [8, 5, [1.095, -0.847, 1.178, 0.214, 0.875, -0.711, 1.404, 0.206]], 0.121928], ['regression: random goertzel 14', [8, 7, [-1.442, 0.598, 0.015, 1.269, 0.654, 1.166, 1.867, 1.215]], 11.338617], ['repair check: random goertzel 5', [16, 12, [0.484, 1.263, -0.839, 0.847, 1.38, 0.512, -1.644, -1.061, -1.041, 1.886, 1.201, 1.603, -1.82, -1.609, -1.768, -0.588]], 5.77981], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002]], [['regression: random goertzel 16', [4, 2, [0.184, -0.187, 1.09, -0.658]], 4.490161], ['regression: random goertzel 17', [16, 3, [0.915, -1.946, -1.09, 0.373, 0.39, -1.357, -0.289, -0.785, -0.369, 1.592, 1.602, -0.177, 0.892, -1.412, 0.72, -0.583]], 34.209051], ['repair check: random goertzel 7', [16, 12, [0.634, -0.987, 0.86, -1.732, -1.556, 1.652, 1.567, 1.68, 0.143, -1.093, 0.974, -0.392, 0.657, -0.89, -0.677, -0.216]], 8.53268], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002], ['regression: random goertzel 4', [5, 1, [0.277, 1.508, 1.644, 1.371, 0.902]], 2.552062]]]\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":"b332ae8a2ef09eff7d1a3c36c0e506df785c7e5f53ff953b89da129efd00aa9d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    N, k, xs = x\n    if len(xs) != N:\n        return 'length-mismatch'\n    w = 2 * math.pi * k / N\n    coeff = 2 * math.cos(w)\n    s1 = s2 = 0.0\n    for v in xs:\n        s = v + coeff * s1 - s2\n        s2 = s1\n        s1 = s\n    power = s1 * s1 + s2 * s2 + coeff * s1 * s2\n    return round(power, 6) + 0.0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: dc bin', [4, 0, [1, 1, 1, 1]], 16.0], ['regression: nyquist bin', [4, 2, [1, -1, 1, -1]], 16.0], ['regression: random goertzel 0', [5, 3, [1.783, -0.103, 1.735, 0.172, 0.47]], 7.631659], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 1', [16, 7, [1.67, -0.361, -1.179, -1.404, -0.191, 0.823, -1.353, 1.734, 0.486, 0.989, 1.205, -0.229, 1.256, -0.62, 1.422, -1.514]], 81.860198], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049]], [['regression: random goertzel 1', [16, 7, [1.67, -0.361, -1.179, -1.404, -0.191, 0.823, -1.353, 1.734, 0.486, 0.989, 1.205, -0.229, 1.256, -0.62, 1.422, -1.514]], 81.860198], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 0', [5, 3, [1.783, -0.103, 1.735, 0.172, 0.47]], 7.631659], ['regression: random goertzel 4', [5, 1, [0.277, 1.508, 1.644, 1.371, 0.902]], 2.552062]], [['regression: random goertzel 4', [5, 1, [0.277, 1.508, 1.644, 1.371, 0.902]], 2.552062], ['regression: random goertzel 6', [16, 3, [-0.301, 1.167, -1.088, 1.455, 1.212, 0.703, -1.679, -0.745, -1.885, -0.092, 1.441, 0.517, 1.787, 1.007, 1.333, 0.125]], 11.236712], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 1', [16, 7, [1.67, -0.361, -1.179, -1.404, -0.191, 0.823, -1.353, 1.734, 0.486, 0.989, 1.205, -0.229, 1.256, -0.62, 1.422, -1.514]], 81.860198], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049]], [['regression: random goertzel 12', [8, 5, [1.095, -0.847, 1.178, 0.214, 0.875, -0.711, 1.404, 0.206]], 0.121928], ['regression: random goertzel 14', [8, 7, [-1.442, 0.598, 0.015, 1.269, 0.654, 1.166, 1.867, 1.215]], 11.338617], ['repair check: random goertzel 5', [16, 12, [0.484, 1.263, -0.839, 0.847, 1.38, 0.512, -1.644, -1.061, -1.041, 1.886, 1.201, 1.603, -1.82, -1.609, -1.768, -0.588]], 5.77981], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 2', [4, 2, [1.006, -1.378, 0.575, -0.798]], 14.115049], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002]], [['regression: random goertzel 16', [4, 2, [0.184, -0.187, 1.09, -0.658]], 4.490161], ['regression: random goertzel 17', [16, 3, [0.915, -1.946, -1.09, 0.373, 0.39, -1.357, -0.289, -0.785, -0.369, 1.592, 1.602, -0.177, 0.892, -1.412, 0.72, -0.583]], 34.209051], ['repair check: random goertzel 7', [16, 12, [0.634, -0.987, 0.86, -1.732, -1.556, 1.652, 1.567, 1.68, 0.143, -1.093, 0.974, -0.392, 0.657, -0.89, -0.677, -0.216]], 8.53268], ['control: tone on bin 1', [8, 1, [1, 0.707107, 0, -0.707107, -1, -0.707107, 0, 0.707107]], 16.000005], ['control: length mismatch', [4, 1, [1, 2, 3]], 'length-mismatch'], ['regression: random goertzel 3', [5, 2, [0.006, 0.503, -1.021, -1.836, 1.378]], 7.416002], ['regression: random goertzel 4', [5, 1, [0.277, 1.508, 1.644, 1.371, 0.902]], 2.552062]]]\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-goertzel-bin-power-power-cross-term-sign","generated_at":"2026-09-29T14:51:38.762140+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Goertzel filters detect single tones cheaply (DTMF, pilot tones); recursion or coefficient slips misreport bin energy.","root_cause":"The final power uses + c s1 s2.","sha256":"f66b32c41679d8cb1468093e2283c4687ddcd27ed5991c16c45c03a053430c7b","title":"Goertzel power adds the cross term · 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.186,"exit_code":1,"observations":[{"actual":16.0,"check":"regression: dc bin","expected":16.0,"passed":true},{"actual":136.0,"check":"regression: nyquist bin","expected":16.0,"passed":false},{"actual":21.854104,"check":"regression: random goertzel 0","expected":7.631659,"passed":false},{"actual":16.000005,"check":"control: tone on bin 1","expected":16.000005,"passed":true},{"actual":"length-mismatch","check":"control: length mismatch","expected":"length-mismatch","passed":true},{"actual":363.703992,"check":"regression: random goertzel 1","expected":81.860198,"passed":false},{"actual":142.441037,"check":"regression: random goertzel 2","expected":14.115049,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: dc bin\", \"actual\": 16.0, \"expected\": 16.0, \"passed\": true}, {\"check\": \"regression: nyquist bin\", \"actual\": 136.0, \"expected\": 16.0, \"passed\": false}, {\"check\": \"regression: random goertzel 0\", \"actual\": 21.854104, \"expected\": 7.631659, \"passed\": false}, {\"check\": \"control: tone on bin 1\", \"actual\": 16.000005, \"expected\": 16.000005, \"passed\": true}, {\"check\": \"control: length mismatch\", \"actual\": \"length-mismatch\", \"expected\": \"length-mismatch\", \"passed\": true}, {\"check\": \"regression: random goertzel 1\", \"actual\": 363.703992, \"expected\": 81.860198, \"passed\": false}, {\"check\": \"regression: random goertzel 2\", \"actual\": 142.441037, \"expected\": 14.115049, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.55,"exit_code":1,"observations":[{"actual":256.0,"check":"regression: dc bin","expected":16.0,"passed":false},{"actual":256.0,"check":"regression: nyquist bin","expected":16.0,"passed":false},{"actual":53.656458,"check":"regression: random goertzel 0","expected":7.631659,"passed":false},{"actual":16.000005,"check":"control: tone on bin 1","expected":16.000005,"passed":true},{"actual":"length-mismatch","check":"control: length mismatch","expected":"length-mismatch","passed":true},{"actual":547.269899,"check":"regression: random goertzel 1","expected":81.860198,"passed":false},{"actual":270.767025,"check":"regression: random goertzel 2","expected":14.115049,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: dc bin\", \"actual\": 256.0, \"expected\": 16.0, \"passed\": false}, {\"check\": \"regression: nyquist bin\", \"actual\": 256.0, \"expected\": 16.0, \"passed\": false}, {\"check\": \"regression: random goertzel 0\", \"actual\": 53.656458, \"expected\": 7.631659, \"passed\": false}, {\"check\": \"control: tone on bin 1\", \"actual\": 16.000005, \"expected\": 16.000005, \"passed\": true}, {\"check\": \"control: length mismatch\", \"actual\": \"length-mismatch\", \"expected\": \"length-mismatch\", \"passed\": true}, {\"check\": \"regression: random goertzel 1\", \"actual\": 547.269899, \"expected\": 81.860198, \"passed\": false}, {\"check\": \"regression: random goertzel 2\", \"actual\": 270.767025, \"expected\": 14.115049, \"passed\": false}], \"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."}}