Calibrated stateful RF chain¶
Validated with documented limitations.
1. The component¶
rfgen.rf_chain compiles an immutable hardware profile and ordered stage configurations into a deterministic processor for complex baseband samples. Complex baseband represents a radio waveform as paired in-phase and quadrature components, conventionally written as one complex sample. A calibration profile supplies the frequency-indexed gain, noise-figure, compression, phase-noise, converter, and provenance values used by the processor.
class StatefulRFChain:
def reset(self, seed: int) -> RFChainStateV1: ...
def process(
self, iq: ComplexTensor, state: RFChainStateV1 | None = None
) -> RFChainResultV1: ...
def snapshot(self, state: RFChainStateV1) -> bytes: ...
def restore(self, raw: bytes) -> RFChainStateV1: ...
def compile(
profile: HardwareProfileV1,
stage_configs: tuple[RFCompiledConfigV1, ...],
*, sample_rate_hz: float, carrier_hz: float,
) -> StatefulRFChain: ...
Parameter |
Type |
Units |
Default |
Purpose |
|---|---|---|---|---|
|
|
profile-defined |
none |
Hash-bound calibration and converter settings. |
|
tuple |
none |
none |
Ordered enabled transformations. |
|
float |
Hz |
none |
Complex-baseband sampling rate. |
|
float |
Hz |
none |
Frequency at which profile curves are evaluated. |
chain = compile(profile, (CFOStageConfigV1(stage=Transformation.CFO, offset_hz=125.0),),
sample_rate_hz=1_000_000.0, carrier_hz=915_000_000.0)
result = chain.process(torch.ones(1024, dtype=torch.complex64), chain.reset(7))
assert result.iq.shape == (1024,)
assert result.iq.dtype is torch.complex64
The implementation uses SciPy interpolation and finite impulse-response design, scikit-rf for locally verified Touchstone network files, and PyTorch for CPU or CUDA tensor execution. The processor rejects non-finite or non-complex64 input instead of silently casting it.
2. What we validated¶
This validation establishes five load-bearing claims. Each is supported in §3.
P1dB Rapp compression (§3.1): the stated knee is reached by the implemented AM/AM transfer.
CFO rotation and restart (§3.2): phase direction and serialized restart agree with a known tone.
Friis added noise (§3.3): sampled LNA noise matches the stated one-stage power equation.
Converter codebook (§3.4): an N-bit converter exposes exactly its signed codeword count.
Phase-noise restart boundary (§3.5): a snapshot preserves the stochastic trajectory within the stated tolerance.
3. Evidence per claim¶
3.1 P1dB Rapp compression¶
Claim. The PA stage reaches one decibel of AM/AM compression at the profile P1dB input power when memory_depth=1.
The transfer is Rapp’s soft limiter, (y=x[1+(|x|/A)^{2p}]^{-1/(2p)}G), with the profile P1dB value analytically mapped to saturation amplitude. test_rapp_proxy_hits_declared_p1db_with_independent_closed_form uses a 64-sample constant-amplitude signal at 1.5 dBm and measures -1.000 dB within 2e-5 dB. The test would fail if the dBm-to-watt conversion, gain convention, exponent, or saturation mapping changed. The source is the Rapp transfer in StatefulRFChain.process.
Rapp, C., Effects of HPA-Nonlinearity on a 4-DPSK/OFDM-Signal for a Digital Sound Broadcasting System, 1991, Eq. 3, is the model reference NASA ADS record.
3.2 CFO rotation and restart¶
Claim. A configured carrier-frequency offset rotates a unit complex tone by (\exp(j2\pi f_\mathrm{off}n/f_s)), and snapshot restoration preserves that sequence.
test_cfo_matches_complex_exponential_and_restart_is_bit_exact compares all 64 samples at offset 0.125 Hz and sample rate 1 Hz to the independently constructed complex exponential with absolute and relative tolerance 2e-6. A 23-sample snapshot split has relative root-mean-square error at most 1e-6 against one-shot processing. This detects a sign reversal, radians-versus-cycles error, or lost serialized phase.
The positive-exponent baseband convention is stated in the project RX capture reference; the executable rotation is _rotate in rfgen.rf_chain.
3.3 Friis added noise¶
Claim. The LNA stage adds the one-stage receiver noise contribution (kT_0BG(F-1)), where (F=10^{NF_\mathrm{dB}/10}), without relabeling it as a complete receiver noise floor.
test_lna_added_noise_matches_friis_power_with_statistical_margin processes 32,768 zero samples at a 1 Hz complex-baseband rate. It compares mean complex power to the closed-form value at NF=1.5 dB, G=1.5 dB, and T0=290 K, with 8% relative tolerance; each real component mean is bounded by 3% of its predicted standard deviation. The test would fail for a missing gain term, a noise-factor/dB confusion, or materially biased innovations.
Friis, H. T., Noise Figures of Radio Receivers, 1944, DOI 10.1109/JRPROC.1944.232049, supplies the noise-figure relation. The project RX capture reference records the T0=290 K and complex-baseband bandwidth convention.
3.4 Converter codebook¶
Claim. A signed N-bit ADC or DAC uses codes ([-2^{N-1}, 2^{N-1}-1]), has exactly (2^N) uniformly spaced values, and saturates positive full scale one least-significant bit below the negative-inclusive range endpoint.
test_signed_n_bit_converter_has_exactly_two_to_the_n_codewords exercises a 3-bit ADC with complex values spanning both rails. It verifies the complete expected codebook and observes eight distinct real codes over a dense input sweep. This test is independent of report metadata and would fail for a doubled code range or a missing saturation bound. The convention is the signed uniform converter representation used by the implementation and is consistent with IEEE Std 1241-2010.
3.5 Phase-noise restart boundary¶
Claim. The finite phase-noise shaper reproduces the same seeded trajectory after snapshot and restore within relative RMS 1e-6.
test_phase_noise_restart_and_input_boundary_are_explicit uses an offset-frequency spectrum from 0.001 to 0.5 Hz, a 2nd-order serialized state, and 128 complex samples. Splitting at sample 47 and restoring the canonical state produces relative RMS error no greater than 1e-6 against one-shot processing. The same test confirms that complex128 is rejected rather than narrowed. The finite shaper uses scipy.signal.firwin2; its spectral approximation is bounded by the profile resolution and finite filter length.
The implementation’s counter-indexed stream is based on Philox4x32. Salmon et al., Parallel Random Numbers: As Easy as 1, 2, 3, 2011, DOI 10.1145/2063384.2063405, author-hosted paper, defines the generator family. The existing Layer 27 Welch experiment additionally checks phase-noise spectral shape at calibrated offset points.
4. Limits and what is not validated¶
The verified envelope is CPU torch.complex64 input, finite rank-one vectors, a carrier covered by the profile, and the tested sample-rate/profile combinations. CUDA execution follows the same tensor contract but was not exercised by this validation run.
The PA is a P1dB-bound Rapp AM/AM proxy. Its equal-weight causal drive average is not a coefficient-identified memory polynomial; measured AM/PM and lag-dependent coefficients or a signed vendor model asset are required for calibrated EVM or spectral-regrowth claims.
The profile’s temperature range is provenance, not a runtime interpolation coordinate: compile and process have no operating-temperature argument or temperature-indexed calibration assets. A temperature-resolved model requires a public API and data-model extension.
The LNA test validates only the added one-stage output noise term. It excludes antenna/source temperature and a cascade of upstream receiver noise figures.
No measurement trace from a physical unit was available in this run. The report validates the declared equations, deterministic state handling, and profile-bound numerical behavior; it does not establish agreement with a particular manufactured receiver.
5. References¶
Reference |
Identifier, version, and role |
|---|---|
Rapp PA model |
Rapp (1991), NASA ADS record, Eq. 3; AM/AM transfer. |
Friis noise figure |
Friis (1944), DOI 10.1109/JRPROC.1944.232049; one-stage added-noise equation. |
Philox |
Salmon et al. (2011), DOI 10.1145/2063384.2063405, author-hosted paper; counter-based random stream. |
SciPy |
PyPI |
PyTorch |
PyPI |
scikit-rf |
PyPI |
cbor2 |
PyPI |