Add average for x value in RMS calculation