BPSK/QPSK Phase Ambiguity and Bit-Shift

i56578-swl.blogspot.com 9 godzin temu

Dealing with phase ambiguity and bit shifting in a demodulated BPSK/QPSK bistream are 2 of the most common obstacles that prevent you from actually knowing what the transmitter sent.

1. BPSK Phase Ambiguity ("Is it Inverted?")
In BPSK, data are represnted by shifting the phase of a carrier wave: 0° might represent a binary '0' 180° might represent a binary '1'.
The problem arises during carrier recovery. The receiver modem has to make a local mention carrier to demodulate the signal. However, an "universal" PSK demodulator - as the 1 of SA Signals Analyzer - cannot separate between a carrier at θ and a carrier at θ+180°. The Result: if the demodulator locks onto the phase 180° out of sync, your data gets inverted. all '1' becomes a '0' and all '0' becomes a '1' (Figure 1). Without a reference, the demodulator has no way of knowing it's reading the full stream upside down.

Figure 1: Outputs of the "universal" SA PSK demodulator processing the same BPSK signal.

2. The Bit-Shift Problem ("Where does it start?")
Bit-shifting (or timing offset) occurs erstwhile the modem's clock isn't perfectly aligned with the incoming symbols. The Cause: even if your frequency is correct, if your "sampling instant" is off, you might example the signal during a transition between 2 bits. The Result: this leads to Intersymbol Interference (ISI). I If the shift is bad adequate (e.g., a half-symbol shift), the receiver might slip a bit entirely, causing the remainder of the data stream to be misaligned with the intended word boundaries (frame synchronization). For istance, if you see 0x33 or 0x66 alternatively then an expected Sync 0xCC sequence, you might be inverted, or you might just be 2 bits off in your alignment (Table I).

Table I : bit-shift effects
3. How it's fixed by the sender
3.1. Known Sequences (Preamble, Framing Sequences, Pilot/Training Sequences)
Sending a known pattern (e.g., 111101011) at the start of a packet, i.e., a general packet framing (e.g., File headers). For Phase: If the receiver sees the inverse of the preamble, it knows to flip all subsequent bits. For Bit-Shift: The preamble allows the receiver to find the exact "start" of the message, aligning the clock and preventing bit-shifts.
3.2. Unique Word (UW) / Synchronization Marker
By periodically inserting a known "Unique Word" (UW), frequently called Synch Marker or Synch Word, the receiver can constantly check if it's inactive aligned. If it finds the UW shifted by 1 position, it shifts its interior buffer to compensate.

3.2.1. Solving Phase Ambiguity with UW
If the receiver is locked 180∘ out of phase, the full incoming stream is inverted. The receiver looks for the UW (e.g., 011010): if it finds 011010, it knows the phase is correct. If it finds 100101 (the exact inverse), it knows it is 180∘ out of phase. The receiver simply flips all bit in the payload following that inverted UW.

3.2.2. Solving Bit-Shifts with UW
Because the receiver is constantly sampling, it doesn't initially know where "Bit 1" of a frame begins. It just sees a continuous stream of bits. The receiver runs a Cross-Correlation. It slides its "known" UW over the incoming bitstream 1 bit at a time. erstwhile the correlation highest hits its maximum, the receiver has found the exact alignment. It "snaps" its frame buffer to that position. Any bits received before that highest are discarded as sound or erstwhile frame leakage; everything after is the valid payload.
Why not just usage the Preamble?
The Preamble (usually alternating 101010) is large for helping the hardware clock "lock on" to the velocity of the data, but it’s terrible for alignment due to the fact that all shift looks the same. The Unique Word is designed to be mathematically "un-ambiguous", it has a sharp autocorrelation highest so the receiver knows precisely which bit is the first bit.

3.2.3 A note about Barker Codes
Barker Codes are the most popular choice for a Unique Word (UW) due to the fact that they are mathematically optimized to be "self-distinguishable." While any random series could technically be a UW, Barker codes are utilized due to the fact that they minimize False Positives. If you utilized a series like 1111, the receiver might think it found the start of the frame 4 different times as the bits slide by. With a Barker code, there is only 1 clear answer.
In Table II shows the list of the known Binary Barker Codes in a plain text ASCII format.In this representation, a '1' corresponds to +1 (no phase shift) and a '0' corresponds to −1 (180∘ phase shift) in a BPSK system.
Table II: known Binary Barker Codes

3.3. Differential Encoding (DBPSK)
Instead of mapping bits to absolute phases, the origin modem map them to changes in phase:
0: Stay the same phase as the last bit.
1: Flip the phase 180° from the last bit.
Even if the receiver is 180° out of phase, the difference between bits remains the same, effectively killing the phase ambiguity problem.

3.3.1. Solving Phase Ambiguity with Differential decoding
Instead of searching for a Unique Word to see if the bits are inverted, we change how data are encoded so that an inversion doesn't actually matter: in Differential BPSK (DBPSK), we a bit is mapped to a change in phase.

3.3.2. Solving Bit-Shifts with Differential decoding
Differential decoding does not solve bit-shifts on its own. While it is simply a "magic bullet" for Phase Ambiguity, it is actually rather susceptible to Bit-Shifts. Differential decoding works by comparing the current symbol (Sk​) to the erstwhile symbol (Sk−1​). If the receiver has a bit-shift (timing offset), it means the "window" where it samples the sine wave is shifted. alternatively of capturing a clean 0° or 180° symbol, it might example right on the edge where 1 bit ends and the next begins.
If the receiver is "off by 1 bit," the differential decoder will compare:
- Bit 2 to Bit 1 (instead of Bit 1 to Bit 0)
- Bit 3 to Bit 2 (instead of Bit 2 to Bit 1)
The math inactive "works" (no phase inversion), but your full data stream is now offset. If you were expecting a 16-bit sensor reading, you now have the last 15 bits of that reading plus the first bit of the next one. The data is mathematically "correct" but contextually "garbage."
4. QPSK modulation
When we decision from BPSK (2 phases) to QPSK (4 phases) the complexity of phase ambiguity and bit-shifting increases significantly. If your Bit-Shift is off by just 1 bit in a QPSK system, you aren't just starting the message late; you are splitting the symbols in half:
Correct Alignment: [BitA BitB] [BitC BitD] → Symbols read correctly.
1-Bit Shift: BitA [BitB BitC] [BitD BitE] → all single symbol is now a hybrid of 2 different intended symbols. The data becomes full "noise."
In QPSK, phase ambiguity can consequence in 4 possible rotations (0∘,90∘,180∘,270∘) that swap or invert the I and Q bitstreams, while a single bit-shift misaligns the 2-bit symbol boundaries, completely corrupting the data mapping.
The fundamental difference lies in symbol mapping: while BPSK maintains a 1:1 ratio between bits and symbols, QPSK encodes 2 bits per symbol, making it highly delicate to bit-alignment errors.

4.1. Bit-Shift (Synchronization Error)
In BPSK: The message simply starts with a hold (or early). If you shift by 1 bit, the remainder of the series is inactive readable, just translated by 1 position.In QPSK: It is simply a disaster. Since each symbol is composed of a bit pair (I,Q), shifting by a single bit breaks the first pairings. all fresh symbol becomes a "hybrid" (half of the erstwhile symbol and half of the next), making the data completely unreadable (pure noise).

4.2. Phase Ambiguity (Rotation Error)
- In BPSK (2 phases): There are only 2 possibilities. Either the bits are correct, or they are all inverted (0↔1). It is like looking at a part of paper upside down: you just request to flip it back.
- In QPSK (4 phases): There are 4 possibilities (0∘,90∘,180∘,270∘). An incorrect rotation doesn't just invert bits; it can swap the I channel with the Q channel. Bits are reshuffled and inverted according to the rotation pattern (e.g., at 90∘, the I bit becomes −Q).
In summary: In BPSK, the mistake is linear (bits are either flipped or shifted). In QPSK, a single bit-shift or phase mistake destroys the very structure of the information. What we can do?
Just like in BPSK, we can decode the data as the change in phase between symbols. The receiver doesn't care about the absolute phase, only the difference (Δθ). Limitation: this inactive doesn't fix the bit-shift; you inactive request a Sync Marker to know where the first symbol of the frame is.
Table III: Summary of Carrier Recovery and Synchronization Failures and their Remediation Strategies
5. Blind Detection: Analyzing an Unknown Bitstream
If you don't know if a Barker code (or any known Unique Word/Sync Sequence) exists in the stream, you are fundamentally "flying blind." This is simply a common script in signals intelligence (SIGINT) or erstwhile dealing with raw, unformatted streams. Without a known sync pattern, you must usage Blind Detection strategies.

5.1. Autocorrelation (ACF)
If the data is packetized, there is almost always a pattern that repeats. By capturing a large buffer of bits and performing an Autocorrelation (xcorr(stream,stream)), you can identify periodicity (using BEE bit-editor, the Autocorrelation is performed by "Find Period" tool).
What to look for: Recurring spikes at regular intervals (e.g., all 1024 bits) indicate frame boundaries. Even without knowing a circumstantial bit-pattern, these spikes identify your Bit-Shift anchor.
5.2. Trial and mistake (The "Brute Force" Method)
If you fishy the stream is PSK but don't know the phase rotation, you run parallel demodulators for each possible state (0∘ and 180∘ for BPSK; 4 rotations for QPSK).
The Goal: You scan the resulting bitstreams for recognizable structures, specified as ASCII text, protocol headers, or valid CRC checks. If 1 stream produces valid data while the others produce noise, you have resolved the Phase Ambiguity.

5.3. Look for the "Preamble" First
Before the Unique Word, there is almost always a Preamble (alternating 10101010). Preambles are easier to detect due to the fact that they have a distinct frequency component. If you find a long string of alternating bits, the Unique Word is almost surely the very next series that follows erstwhile that pattern breaks.

5.4. Differential Decoding (The "Safest Bet")
If you don't know the phase and deficiency a sync sequence, apply a Differential Decoder. If the transmitter utilized Differential Encoding (DBPSK/DQPSK), the data will become readable due to the fact that the decoder looks at the change between bits alternatively than the absolute phase. If the transmitter didn't usage it, the data remains garbage, but you have successfully ruled out 1 major modulation possibility.

6. PSK8 ms-110A s-4285 Specialized Decoders
Specialized decoders for standards like STANAG 4285 or MIL-STD-188-110A automatically resolve phase ambiguity and bit-shifting by utilizing periodic training sequences (probes) and adaptive equalizers to constantly "sound" the channel and re-align the signal in real-time. Unlike a generic demodulator, these systems don't just "lock once"; they usage the known structure of the waveform to mathematically calculate and cancel out rotation and timing errors before the data always reaches the output.

7. Encrypted Bitstreams
Because encryption is mathematically designed to look like pure random noise, there are no repeating patterns or ACF 'spikes' to find within the ciphertext. To solve phase ambiguity and bit-shift in an encrypted stream, you must trust on a known Cleartext Sync series to find the exact bit-offset and correct phase so that the encrypted data is perfectly aligned and represented for further analysis.
Idź do oryginalnego materiału