FA-91412 / Digital signal filters / Member archive
Centered average mirrors with the edge sample repeated · case 02
At the edges the first sample is counted twice, over-weighting endpoints.
Case contract
Input [K, mode, samples]; K must be odd ("bad-window"). Centered moving average over indices i-K//2..i+K//2 with edge mode "shrink" (average available samples), "zero" (missing samples count as 0, divide by K), "replicate" (clamp index) or "reflect" (mirror without repeating the edge: -1 -> 1, n -> n-2). Return exact fraction strings.
Why this case matters
Offline smoothing needs explicit edge handling; mirror and padding conventions differ between tools and are easy to mix up.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: random centered 10 | ["-4/5", "9/5", "1"] | ["1", "-8/5", "-4/5"] | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗