Effect of the reference beam in speckle interferometry