sliding window on sensor data in threadLoop