RunningAverage Class on playground (updated)

Hi there,

just to complete the statements above, I made another series of measurements (see "Diff_Pressure_RunningAverage.pdf") using the same buffer sizes. But now I used RunningAverage again. As can be clearly seen, the output is as expected. I did not clear the variable as this is not necessary with these measurements.
so one may draw the conclusion that there is something wrong with the code of the RunningMedian Library.

Here is the code sniplet where I calculate my RunningAverage for the differential pressure:

/* 
 ************************************* 
 * Thread: THREAD_DifferentialPressure
 * Get`s the differential pressure.
 ************************************* 
 */

/* Global variables for this function */
float diff_Pressure_median = 0;
float diff_Pressure = 0;
float offset_diff_pressure;     // offset which can be set by the user -> FUNC_OffsetDiffPressure (X_E_LCDML_MenuFunctions)
int n_averaging;                // variable can be set by the user to define ow many measurements shall be averaged 
RunningAverage diff_p_RA(200);   // use a uer defined size for the running averaging of the differential pressure
  /* --------- INIT ---------
     * Initialization of this function
     * is only being done once at the start of the function
     */
 void simpleThread_setup(THREAD_DifferentialPressure)
  {   
  /* Init Function */
  diff_p_RA.clear();              // Running Average for diff. pressure; explicitly start clean
  }
     
  /* --------- LOOP ----------
     * This is the place for code which is going to be repeated constantly 
     * e.g. a time-diplay or the like.
     */
 boolean simpleThread_loop(THREAD_DifferentialPressure)
  {
  /* Loop Function */
  diff_p_RA.addValue(getDifferentialPressure()); // read out the sensor value and add to averaging variable
  // set averaged differential pressure  - pressure offset set by the user
  diff_Pressure = diff_p_RA.getAverage() - offset_diff_pressure;
  Serial.println(diff_Pressure);
  if (isnan(diff_Pressure) || diff_Pressure < 0.00)
  {
    diff_Pressure = 0.00;    // set diff_Pressure to zero if the reading is NaN - Not a Number, or lower than zero
  }
  return true;
  }

Best regards,
Jan

P.S.: I now added the raw data of these measurements.

Diff_Pressure_RunningAverage.pdf (858 KB)

Diff_Pressure_RunningAverage.zip (2.94 MB)