Added a filter to calm jitteriness in the magnitude detection.