moved filtering inside correlation.calcWindow