sweep-learning-examples icon indicating copy to clipboard operation
sweep-learning-examples copied to clipboard

medianFilter1D returns same array of sensor readings if len < windowSize

Open dcyoung opened this issue 8 years ago • 0 comments

The method Processing.Filtering.medianFilter1D() method returns the same array of sensor readings if the array is smaller than the filter window:

if (len < k)
    return sensorReadings;

This is an edge case, but the method is supposed to return a new array of filtered values regardless. If the user's code expects to be able to augment the returned values without disrupting the original array, this could prove problematic. Method should return a newly created or deep copied array instead.

dcyoung avatar Jun 12 '17 18:06 dcyoung