Use scipy.fftpack.rfft in place of np.fft.fft, raise exception if window
has th wrong shape, clean up