sliding window for raw data