FA-91414 / Digital signal filters / Member archive
Centered average mirrors with the edge sample repeated · case 04
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 44 | ["1/3", "-2/3", "1/3", "7/3", "10/3", "7/3"] | ["-7/3", "-2/3", "1/3", "7/3", "10/3", "5/3"] | 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 ↗