Simulator for QPSK Modulation
Quadrature (4-PSK)
The Math Behind QPSK
Quadrature Phase Shift Keying (QPSK) is a form of digital modulation that transmits two bits per symbol by changing the phase of a carrier wave.
s(t) = A cos(2ฯfct + ฮธn)
-
Phase (ฮธn): Each pair of bits (dibit) corresponds to a specific phase shift. In Gray coding, we use:
"00" → ฯ/4 (45°)"01" → 3ฯ/4 (135°)"11" → 5ฯ/4 (225°)"10" → 7ฯ/4 (315°)
- Efficiency: Since 4 phases are used, QPSK carries double the data of BPSK in the same bandwidth.
Simulation Workflow
1. Bit Grouping (Dibits)
The input bitstream is split into pairs. A stream of "1,0,1,1" becomes [1,0] and [1,1].
2. Phase Mapping
Each pair is mapped to one of the four quadrature phases using Gray Coding to minimize bit errors.
3. Waveform Synthesis
For every symbol, a carrier wave segment is generated: y = cos(2ฯ * fc * t + phase).
4. Continuous Visualization
The segments are stitched together and plotted using Plotly.js to show the final phase-modulated signal.