mas function

Moving average smoothing