Tutorial for computing second-order statistics