Fig. 2 Correlation algorithm