Optimum synchronization of frames with unknown, variable lengths on Gaussian channels