streamlined and sped up sync_and_demodulate function