I am currently working on a product(cant disclose too much details of the actual project) in which some data is being sent via audible(but on the higher freq) sound that is encoded with dqpsk.

However, it gets very inaccurate at times since the receiver and the broadcaster does not have the same sampling windows. I am not trained academically for DSP and therefore having a lot of problem finding out what are the correct terms to search for.

Basically after a lot of debugging and simulation, i found that the most major issue is that the phase information gets more and more inaccurate as the output and the input gets more out of sync... Are there some techniques to find the beginning of the actual signal in the samples? The data isnt contained in just one sample window(they can span through quite a lot of windows)

Thanks! (I would appreciate any sort of help, even if it is just some term i should use to search on google... )

And on a seperate note, when the timing is relatively accurate, I am already able to get the data properly decoded, so I am not really having much problem with the psk side

  • 3
    $\begingroup$ Look for qpsk synchronization or symbol synchronization or Costas loop. If you have dqpsk, then you don't need carrier phase synchronization, just carrier frequency synchronization (arbitrary phase error is OK) and knowledge of the symbol boundaries, i.e. symbol synchronization. $\endgroup$ Nov 1, 2012 at 12:01
  • $\begingroup$ You can use the I/Q zero crossings to help you figure out where the symbol boundaries are. $\endgroup$
    – Jim Clay
    Nov 1, 2012 at 13:56
  • $\begingroup$ When you say the "phase information gets more and more inaccurate", do you mean that the constellation at the receiver gradually rotates? What is the exact symptom that you see? $\endgroup$
    – Jim Clay
    Nov 1, 2012 at 13:57
  • $\begingroup$ It's very unclear from the OP what is being asked, but it sounds to me like he does not have accurate symbol synchronization. He is right, as you increase the amount of symbol synchronization error, then the phase values you see will not lie on the constellation points that you expect; in practice, you don't see the instantaneous switching between phase values that you might see in textbook examples. $\endgroup$
    – Jason R
    Nov 2, 2012 at 2:35
  • $\begingroup$ Thanks for all the answers! let me maybe make it a little clear with erm... some... diagrams? the input sampling (. is silence, * is signal, i sample at 1024, and lets say every two * is one window in the output, therefore every 2 (. or * ) is one sampling window) .****. so basically cause the input sampling and the output does not start at the same time, the input sampling has to detect when it starts and also, try and synchronize. @DilipSarwate do you guys happen to have some place where there are diagrams or code that shows some of that? $\endgroup$ Nov 2, 2012 at 3:15

2 Answers 2


So not only do you need to do timing synchronization to recover the baud clock, you need to do some form of turn on detection. You could start your PSK synchronization at the first sample, but the metrics you get out of any synchronization algorithm would be worse than meaningless with no signal present.

You should read a little about detection theory https://en.wikipedia.org/wiki/Detection_theory. If there is a known pattern at the beginning of the signal such as an equalizer training sequence, you can use a matched filter https://en.wikipedia.org/wiki/Matched_filter to detect the signal. This has the added benefit of providing metrics for timing and phase synchronization. If you don't know anything a priori about the data at the start of the signal and you are guaranteed to have positive SNR, you can simply look for an increase in signal energy. You can use a rising edge detector to detect an increase in power or simply look for energy to cross a threshold (if the noise and signal powers will be effectively constant). You can do this in the time domain if you aren't worried about any co-channel interference and you have enough SNR. If the bandwidth of the last filter in the receiver chain lets in a lot of noise or if there may be other signals nearby in frequency, you could do the energy detection in the frequency domain.

Regarding your statement that the "phase information gets more and more inaccurate as the output and the input gets more out of sync", do you mean that, as you move through the signal in time the phase error progressively increases or you have seen from run to run that if you don't lock well you get worse results. If it is the former, then I second the suggestion to look up qpsk synchronization. When you are demodulating a psk signal, you need to be tracking the symbol timing, the carrier frequency, and the carrier phase. A second order PLL can track the phase and frequency. You can also use an early-late gate for tracking the symbol timing.

  • $\begingroup$ wow i just realized this has been answered! Although I am no longer working on that, the information you have presented is very very useful. Back then the problem i faced was actually detecting the start of the signal, and then getting a properly synchronized window. I found ways by creating a signal that looks something like "------" and that helped me detect the start of the signal and synchronized with the peak of the signals, i dont know if that was a good solution but it kind worked for me :P $\endgroup$ Aug 1, 2018 at 6:40

To add to the excellent information given by Cassman in his response, here is a block diagram of a carrier recover loop for QPSK and QAM modems using a decision directed approach. I have detailed the decision directed phase detector in this post Phase synchronization in BPSK and this one How to correct the phase offset for QPSK I-Q data, while the block diagram below shows how it fits in a complete recovery loop (and demodulator).

The NCO puts out the complex frequency (Sine and Cosine for moving the carrier frequency offset in one direction) necessary to steer the input signal to 0 frequency (removes the carrier offset). I have more details on NCO implementations specifically here: Numerically Controlled Oscillator (NCO) for phasor implementation? and If the idea of complex frequency and "one direction" frequency shift is at all confusing, see this post: Frequency shifting of a quadrature mixed signal

The frequency setting is provided by the Loop Filter which accumulates the phase error up or down as needed to maintain the error at 0. As shown, this implementation is a Type 2 2nd Order Phase Lock Loop.

Where this block diagram below shows its use in a QAM demodulator. IF the Phase Detector just has one decision threshold instead of the 4 shown (for 16 QAM) then this will track and demodulate QPSK coherently. As Dilip has said in the comment, you do not need coherent demodulation with DQPSK but this will work in either case.

enter image description here

Further this works really well with Gardner Loop for timing recovery (which requires 2 samples per symbol), as The Gardner Loop is not very sensitive to carrier offsets. (While the M&M synchronizer, another common timing recovery approach is quite sensitive). The timing recovery would be ahead of the carrier recovery in the block diagram at 2 samples per symbol (or more), which is then downsampled to one sample per symbol at the sampling position in the center of the symbol for the carrier recovery implementation shown. Further details of the Gardner Loop are in this post: Gardner Timing Recovery for Repeated Sybmols. It's position in a receiver can be as done in the block diagram below, where depending on implementation it may be best to use the samples after a matched filter or before the matched filter.

enter image description here

This is a control loop and has a loop bandwidth that you set by the gain constants in the Loop Filter. For guidance on what Loop BW to use see this post: Loop bandwidth for symbol timing recovery. I have experimented with this specific to the Gardner and M&M recovery approaches and found that the Gardner performs best before the matched filter while the M&M performs best after, but that was specific to waveforms with raised cosine pulse shaping and different pulse shaping will impact timing recovery. Details on that comparison are given in this post: Location of Matched Filter

  • $\begingroup$ Thank you for your answer, I have totally lost track of the question, it was asked in 2012 after all :P And looking at cassman's answer, that looked very much like what I finally did, so I gave him the answer vote :P Unfortunately I am no longer working on the project and since then have not really worked on anything similar. Hopefully this can help others if anybody else faces a similar problem :D $\endgroup$ Aug 1, 2018 at 6:43
  • $\begingroup$ @Dan Sir if you have time...could you please answer my question here: dsp.stackexchange.com/questions/66037/… $\endgroup$
    – sarthak
    Apr 2, 2020 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.