  This paper introduces a new algorithm to improve the accuracy of numerical
phase-averaging in oscillatory, multiscale, differential equations.
Phase-averaging is a technique that applies averaging to a mapped variable to
remove highly oscillatory linear terms from the differential equation. This
retains the main contribution of fast oscillations on the low frequencies
without needing to resolve the rapid oscillations themselves. However, this
comes at the cost of an averaging error, which we aim to offset with a modified
mapping. The new mapping includes a mean correction which encodes an average
measure of the nonlinear interactions. This mapping was introduced in Tao
(2019) for weak nonlinearity and relied on classical time averaging. Our
algorithm extends this work to the case where 1) the nonlinearity is not weak
but the linear oscillations are fast and 2) finite averaging windows are
applied via a smooth kernel, which has the advantage of retaining low
frequencies whilst still eliminating the fastest oscillations. We show that the
new algorithm reduces phase errors in the mapped variable for the swinging
spring ODE. We also demonstrate accuracy improvements compared to standard
phase-averaging in numerical experiments with the one-dimensional Rotating
Shallow Water Equations, a useful test case for weather and climate
applications. As the mean correction term can be computed in parallel, this new
mapping has potential as a more accurate, yet still computationally cheap,
coarse propagator for the oscillatory parareal method.
