optimize apply_welch_window()