Fix window length calculation for 2D SSA