Harvey Mudd College
The Costas loop can lock with the constellation rotated by any multiple of 90° (for QPSK). There is no way to tell from the signal alone which of the four rotations is “right”. Two fixes:
constellation.arity().lesson20_PhaseAmbiguity_and_DifferentialEncoding.grc decodes the received symbols four times, each after an extra rotation by \(1, i, -1, -i\), so you can watch which branch comes out right and that the differentially-decoded bits agree in all four. lesson20_QPSK_modem.grc is the compact version: AGC, FLL, Symbol Sync, Constellation Receiver (symbol sync’s companion that combines the Costas loop with the decision), Differential Decoder, and unpacking to bits.
lesson20_PhaseAmbiguity_and_DifferentialEncoding.grc
Running:
Other flowgraphs for this lesson:
lesson20_QPSK_modem.grc — Running
All GNURadio flowgraphs are at https://github.com/gallicchio/learnSDR