Variational Correlation Approach to Flow Measurement with Window Adaption