Our quaternion-domain Savitzky-Golay filter (window 7, polyorder 2, 30 fps) cut mean joint acceleration on GVHMR mocap output from 10.0 to 3.9 m/s² and p99 from 47.8 to 18.3 m/s², a 61–62% drop. It kept 93–97% of peak angular velocity and added no measurable export error. Smoothing the Euler channels instead made jitter 69% worse on a clip with angle wraps.
These numbers come from our own runs on a fighter-tracking pipeline: monocular video in, GVHMR body motion out, smoothed, exported as an animated GLB. Below: the metrics, the code, the window trade-off, and the two failure modes we measured.
What did we measure, and on what data?
We ran two metrics. The first is positional: joint acceleration in m/s² (second finite difference times fps², in the gravity-aligned world frame) on a 121-frame, 30 fps two-person sparring clip. The second is angular: mean second difference of per-joint rotation steps, in degrees per frame², measured on four BVH clips between 59 and 313 frames long.
Both metrics compare smoothing=off against smoothing=medium on identical GVHMR predictions, so the only variable is the filter. The positional metric is the one that matches what a viewer sees. The angular metric shows how much the filter changes the rotation curves themselves, and how much of the real motion it removes.
def accel(J, fps=30): # J: [T, joints, 3] world-frame joint positions, metres
a = (J[2:] - 2*J[1:-1] + J[:-2]) * fps * fps # all joints
rel = J - J[:, :1] # pelvis-relative
ar = (rel[2:] - 2*rel[1:-1] + rel[:-2]) * fps * fps # articulation only
ra = (J[2:, 0] - 2*J[1:-1, 0] + J[:-2, 0]) * fps * fps # root only
n = lambda x, ax: np.linalg.norm(x, axis=ax)
return dict(joint_accel_mean=n(a, 2).mean(), joint_accel_p99=np.percentile(n(a, 2), 99),
articulation_accel_mean=n(ar, 2).mean(),
root_accel_mean=n(ra, 1).mean(), root_accel_p99=np.percentile(n(ra, 1), 99))
Before/after: positional jitter numbers from our 2026 runs
On the more active fighter, medium smoothing cut mean joint acceleration from 10.01 to 3.93 m/s² (-61%) and p99 from 47.75 to 18.31 m/s² (-62%). Root acceleration fell further, from 42.87 to 15.15 m/s² at p99 (-65%). Pelvis-relative articulation fell only 35%. On the calmer fighter, every metric dropped by a similar ratio.
| Metric (m/s²) | Fighter A raw | Fighter A medium | Change | Fighter B raw | Fighter B medium | Change |
|---|---|---|---|---|---|---|
| joint_accel_mean | 10.01 | 3.93 | -61% | 3.50 | 1.38 | -61% |
| joint_accel_p99 | 47.75 | 18.31 | -62% | 11.43 | 5.61 | -51% |
| articulation_accel_mean | 2.79 | 1.82 | -35% | 0.99 | 0.51 | -48% |
| root_accel_mean | 9.22 | 3.28 | -64% | 3.31 | 1.27 | -62% |
| root_accel_p99 | 42.87 | 15.15 | -65% | 10.47 | 5.08 | -51% |
The pattern we didn't expect: most of the visible jitter in GVHMR output is the global trajectory, not the limbs. Root acceleration alone (9.22 m/s² mean) is almost the whole joint-acceleration budget (10.01). If your avatar looks like it's vibrating, check the root translation before you start tuning per-joint rotation filters.
One caveat. The source clip was 24 fps and the worker re-encodes to 30 fps by duplicating frames. GVHMR predicts near-identical poses on duplicated frames and then jumps, which produces a periodic acceleration spike. We believe part of the 61% is the filter cleaning up that stutter rather than model noise, so expect smaller gains on native 30 fps footage.
How does the quaternion Savitzky-Golay filter work?
Convert each joint's Euler channels to unit quaternions. Flip any quaternion whose dot product with the previous frame is negative, so the whole track stays in one hemisphere. Run scipy.signal.savgol_filter over the four components, renormalise to unit length, and convert back. Root translation gets a plain Savitzky-Golay filter.
This is the code we run (SciPy 1.18.1, NumPy 2.5.4). The BVH header is preserved byte-for-byte and only the MOTION rows are rewritten:
import numpy as np
from scipy.signal import savgol_filter
from scipy.spatial.transform import Rotation
ROT_WINDOWS = {"light": 5, "medium": 7, "strong": 11}
POS_WINDOWS = {"light": 5, "medium": 7, "strong": 9}
POLYORDER = 2
def _win(w, n):
"""Largest valid odd window <= w and <= n; must exceed polyorder."""
w = min(w, n if n % 2 == 1 else n - 1)
return w if w > POLYORDER else 0
def smooth_data(layout, data, strength):
"""layout: [(joint, [channel names])] in BVH order; data: [frames, channels]."""
out = data.copy()
n = data.shape[0]
rw, pw = _win(ROT_WINDOWS[strength], n), _win(POS_WINDOWS[strength], n)
col = 0
for _, chans in layout:
idx = list(range(col, col + len(chans)))
col += len(chans)
pos = [i for i, c in zip(idx, chans) if c.endswith("position")]
rot = [(i, c[0]) for i, c in zip(idx, chans) if c.endswith("rotation")]
if pos and pw:
out[:, pos] = savgol_filter(data[:, pos], pw, POLYORDER, axis=0, mode="interp")
if len(rot) == 3 and rw:
order = "".join(c for _, c in rot) # as written, e.g. "ZYX"
cols = [i for i, _ in rot]
q = Rotation.from_euler(order, data[:, cols], degrees=True).as_quat()
for t in range(1, n): # hemisphere / sign continuity
if np.dot(q[t], q[t - 1]) < 0:
q[t] = -q[t]
q = savgol_filter(q, rw, POLYORDER, axis=0, mode="interp")
q /= np.linalg.norm(q, axis=1, keepdims=True)
out[:, cols] = Rotation.from_quat(q).as_euler(order, degrees=True)
return out
Filtering quaternion components linearly and then renormalising is not a true geodesic filter on SO(3). At window 7 and 30 fps, with typical per-frame steps under 1°, the error is far below what anyone can see. We chose this over a log-map (tangent-space) filter because it is 25 lines, has no reference-frame choice to get wrong, and ran in 25 ms on CPU for 121 frames × 22 joints.
Why not just smooth the Euler channels?
Euler channels wrap at ±180°. A 1° real rotation that crosses the boundary shows up as a 359° jump, and a polynomial fit through that jump creates a fake spin. On our 313-frame clip with 12 wrap events, Euler-domain Savitzky-Golay increased angular jitter by 69%. It produced a 152° single-frame step and moved one joint 154° away from the raw pose.
Same window (7), same polyorder (2), same clips:
| Clip (frames, wrap events) | Method | Angular jitter change | Max single-frame step | Max deviation from raw |
|---|---|---|---|---|
| Sparring, 121 f, 0 wraps | Quaternion SG | -8.0% | 23.9° | 2.1° |
| Euler SG | -7.1% | 23.6° | 5.7° | |
| Kick, 59 f, 2 wraps | Quaternion SG | -8.6% | 23.6° | 2.9° |
| Euler SG | +38.6% | 87.7° | 120.0° | |
| Combo, 313 f, 12 wraps | Quaternion SG | -7.7% | 26.0° | 2.7° |
| Euler SG | +69.0% | 152.2° | 154.3° |
The no-wrap row is the trap. On a clean clip, Euler smoothing scores almost the same as quaternion smoothing, so a quick test on one short clip will pass. Even there it drifts 5.7° from the raw pose against 2.1° for the quaternion path, because the three Euler axes are not independent. Longer clips with more rotation will eventually hit a wrap.
What happens if you skip the quaternion sign fix?
q and -q are the same rotation (the quaternion double cover), and Euler-to-quaternion conversion can return either one from frame to frame. Without the hemisphere flip, the filter averages across a sign change. On our 313-frame clip, jitter rose 2.3% instead of falling 7.7%, and the maximum deviation grew from 2.7° to 12.1°.
Removing the sign fix does less damage than smoothing in Euler space, and that makes it harder to catch. On the two shorter clips it changed nothing, because no sign flip happened in them. The output only gets worse once a clip is long enough, or has enough rotation, to cross the hemisphere boundary. That is why the six-line loop above stays in, even though it looks unnecessary in a unit test.
Which window size should you use for fast motion?
For combat sports at 30 fps we ship window 7 (medium). It cut angular jitter by 7.7–8.6% and kept a mean of 95–97% of each joint's peak angular velocity. Window 11 (strong) cut angular jitter by 18–22% but lost 20–28% of peak velocity. On a fighter tracker, peak velocity is the punch, so that loss counts as data loss.
| Window | Angular jitter change (4 clips) | Peak angular velocity change | Worst single-joint peak retained |
|---|---|---|---|
| light (5) | -3.2% to -4.1% | -0.8% to -2.1% | 92% |
| medium (7) | -7.7% to -8.6% | -4.7% to -7.3% | 85% |
| strong (11) | -18.2% to -22.4% | -19.7% to -27.5% | 58% |
As a reference point for "real" peaks, we also compared the smoothed peak against a 3-frame moving average of the raw angular velocity, which strips single-frame noise but keeps real motion. At medium, the smoothed peak averaged 102–103% of that reference, so it kept the real peak and removed only the one-frame overshoot. At strong it fell to 88–94%, with one joint at 69%. That cuts into the actual kick.
The angular figures are small next to the 61% positional drop because the two metrics look at different things. Rotation curves out of GVHMR are already fairly smooth, so most of the positional jitter came from root translation, as the table above shows. A light rotation filter combined with a real translation filter is the trade-off that holds up.
Does the GLB export add error, and what does smoothing cost?
We decoded the exported GLB with our own reader, which parses the accessors and runs forward kinematics plus linear blend skinning, and compared it with the in-memory smoothed mesh at frame 60. Maximum vertex error was 2.4×10⁻⁷ m and 3.5×10⁻⁷ m for the two fighters, which is float32 rounding. Smoothing took 25 ms on CPU per clip and moved the wrist-to-head distance we tracked in a contact test by at most 4.7 mm.
We also timed the full GPU job on RunPod at each level: medium 97.1 s, light 102.2 s, off 137.8 s. Smoothing did not make the job faster. With a 25 ms filter, a 40-second spread is queue and worker variance. Benchmark serverless GPU jobs several times per setting before you attribute a difference to your code. We hit the same issue in RunPod InfiniteTalk ignoring the size param, and five other avatar-pipeline gotchas.
One more gotcha from the same run. All three GLBs were exactly 1,134,868 bytes. A GLB's size depends on frame count, joint count and mesh, not on the animation values, so file size cannot tell you whether smoothing ran. Using file size as a "did the setting apply?" check will pass for the wrong reason. Compare decoded rotation tracks instead.
The complete pattern at a glance
Smooth rotations as sign-continuous quaternions, never as Euler channels. Smooth root translation separately, because that is where most GVHMR jitter is. Pick the window by checking peak angular velocity, not by how smooth the curve looks. Measure positional acceleration in the world frame, verify the export by decoding it, and don't trust file sizes or single serverless timings.
With that setup, quaternion Savitzky-Golay at window 7 cut GVHMR mocap jitter by about 60% and kept the motion that matters in a fight.