pma function

Function to do an n-point moving average