Orientation, Phase, and Polarization¶
Many signal processing problems involve signals that carry more geometric information than a scalar or complex number can represent cleanly. QSP addresses this by using quaternions as the native representation for signals that have spatial, rotational, or polarization structure.
The limits of scalar and complex representations¶
Classical DSP treats signals as sequences of real or complex numbers. This works well for:
- Amplitude-modulated signals (real-valued)
- Phase-modulated signals (complex-valued, using IQ representation)
It becomes strained for:
- Signals from multi-axis sensors (e.g., 3-axis accelerometer, 3-axis magnetometer)
- Polarized EM signals where the polarization state rotates in 3D
- Orientation-sensitive signals where the spatial orientation of the sensor matters
- Problems where phase and rotation must be represented simultaneously
The IQ (complex) representation handles one plane of phase rotation. When the signal geometry involves rotation in 3D space, or when polarization and orientation must be composed, a single complex number is insufficient.
Quaternions as a signal representation¶
Quaternions extend complex numbers to a four-dimensional algebra:
where i, j, k are basis elements satisfying i² = j² = k² = ijk = -1.
Unit quaternions parameterize 3D rotations compactly and avoid the coordinate singularities (gimbal lock) that affect Euler angles. This makes them well-suited for:
- Representing the orientation of a sensor platform
- Encoding the polarization state of an EM wave in 3D
- Composing phase rotations that occur in multiple planes simultaneously
Orientation¶
In navigation and sensing, orientation refers to the attitude of a rigid body relative to a reference frame. A unit quaternion encodes this orientation as a rotation, and quaternion multiplication composes rotations correctly.
The qsp-orientation package works in this domain: it ingests sensor data and produces quaternion-valued orientation estimates that track the platform's attitude over time.
Phase¶
In signal processing, phase encodes the offset of a sinusoidal signal in time. The classical representation uses a complex exponential. In QSP, phase can be generalized to encode rotation in a higher-dimensional space — for example, when the signal occupies a 3D signal space rather than a 2D one.
The qsp-fft package handles spectral analysis in this framework, and qsp-modulation works with phase-space signal representations.
Polarization¶
Polarization describes the orientation of the oscillation of a wave (e.g., an EM field vector) relative to its direction of propagation. Linear, circular, and elliptical polarization states can be represented as points in a geometric space. Quaternions provide a natural representation for the full polarization state, including transitions between states.
How QSP treats these together¶
The QSP ecosystem does not rigidly separate these concepts. A signal may carry orientation, phase, and polarization information simultaneously, and the QSP type system allows this to be expressed cleanly. The shared types in qsp-core ensure that:
- A signal produced by
qsp-fftcan flow intoqsp-filter - A conditioned signal from
qsp-filtercan enterqsp-modulationorqsp-orientation - The geometric meaning of the signal is preserved across processing stages
This is the core engineering motivation for a unified quaternionic type system across the package family.