sweep-learning-examples
sweep-learning-examples copied to clipboard
medianFilter1D returns same array of sensor readings if len < windowSize
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.