Frame synchronization for M-ary modulation with phase offsets