Scientific validation: TorchSig OFDM emitter

Validated with documented limitations.

1. The component

TorchSigOFDMEmitter is a baseband IQ generator for OFDM (Orthogonal Frequency-Division Multiplexing) waveforms. OFDM is a multicarrier modulation scheme that maps data symbols onto N closely-spaced orthogonal subcarriers via an inverse FFT (Fast Fourier Transform: a fast algorithm for the Discrete Fourier Transform), then prepends a copy of the symbol tail called the cyclic prefix (CP), which makes the channel appear as a circular convolution and simplifies equalization. OFDM is the physical-layer waveform of Wi-Fi (802.11a/g/n/ac/ax), LTE, and 5G NR downlink.

The emitter wraps torchsig.signals.builders.ofdm.ofdm_modulator and exposes 12 class labels through the rfgen BaseEmitter interface.

Class signature (constructor + main entry point):

class TorchSigOFDMEmitter(BaseEmitter):
    def __init__(self) -> None: ...          # lazy-imports torchsig
    def generate(
        self,
        *,
        class_label: str,       # e.g. "ofdm-256"
        sample_rate: float,     # Hz, must be finite and positive
        duration_s: float,      # seconds, must be finite and positive
        f_offset_hz: float,     # baseband frequency offset (Hz)
        rng: torch.Generator,   # drives numpy seed; consumed per call
        device_id: str | None = None,
        params: BaseModel | None = None,  # TorchSigOFDMParams
    ) -> Signal: ...

Parameters:

Name

Type

Units

Default

Purpose

class_label

str

-

required

One of 12 ofdm-N labels; N is the FFT/subcarrier count

sample_rate

float

Hz

required

Output sample rate; must be finite and positive

duration_s

float

s

required

Record length; sample_rate * duration_s must be >= 1

f_offset_hz

float

Hz

required

Shift the OFDM band from DC; Nyquist guard enforced

rng

torch.Generator

-

required

Entropy source; each call draws one 64-bit seed

bandwidth_hz

float (via TorchSigOFDMParams)

Hz

1e6

Requested 3 dB occupied bandwidth; must be > 0

Worked example:

import torch
from rfgen.emitters.torchsig_ofdm import TorchSigOFDMEmitter, TorchSigOFDMParams

emitter = TorchSigOFDMEmitter()
rng = torch.Generator()
rng.manual_seed(42)

sig = emitter.generate(
    class_label="ofdm-256",
    sample_rate=8e6,
    duration_s=0.05,
    f_offset_hz=0.0,
    rng=rng,
    params=TorchSigOFDMParams(bandwidth_hz=2e6),
)
print(sig.iq.shape)   # torch.Size([2, 400000])
print(sig.iq.dtype)   # torch.float32
print(sig.metadata.class_taxonomy)  # ('comms', 'ofdm', 'ofdm-256')

12 class labels and standards mapping:

Label

Subcarriers (FFT size)

Standards example

ofdm-64

64

802.11a/g (52 used of 64)

ofdm-72

72

LTE 1.4 MHz channel (6 RB × 12 subcarriers)

ofdm-128

128

802.11n 40 MHz (108 used)

ofdm-180

180

LTE 3 MHz channel (15 RB × 12)

ofdm-256

256

802.11ac 80 MHz, DVB-T2 1k mode

ofdm-300

300

LTE 5 MHz channel (25 RB × 12)

ofdm-512

512

802.11ac 160 MHz

ofdm-600

600

LTE 10 MHz channel (50 RB × 12)

ofdm-900

900

LTE 15 MHz channel (75 RB × 12)

ofdm-1024

1024

802.11ax (HE40), DVB-T2 8k mode

ofdm-1200

1200

LTE 20 MHz channel (100 RB × 12)

ofdm-2048

2048

DVB-T2 16k, 5G NR 30 kHz subcarrier spacing 60 MHz BW

Scope. This emitter produces the waveform envelope of an OFDM signal: N subcarriers modulated with randomly chosen symbols from TorchSig’s 17 constellation pools (PSK/QAM/ASK families), transformed by inverse FFT, and prepended with a randomised CP. It is not a standards-conformant 802.11, LTE, or 5G NR frame. There are no pilot subcarriers, no DC null, no edge guards, no synchronisation preamble (PSS/SSS), no scrambling, no LDPC or convolutional channel coding, and no resource-element mapping. The CP length is randomised by TorchSig: probability 0.5 of CP = 0, otherwise a uniform integer in [2, N/2). The class label ofdm-N encodes only the FFT/subcarrier count; it does not assert PHY conformance with any named standard.

2. What we validated

This validation establishes 6 load-bearing claims. Each is restated and supported by evidence in §3.

  1. Output shape, dtype, metadata, and determinism (§3.1): all 12 labels produce the correct tensor shape, float32 dtype, metadata fields, and bit-identical reproduction from a fixed seed.

  2. 3 dB occupied bandwidth matches the request (§3.2): the realised -3 dB bandwidth stays within ±5% of the requested value for all 12 labels.

  3. PAPR CCDF matches OFDM theory (§3.3): the instantaneous-power tail probability matches the asymptotic reference within a factor of 2 at three threshold levels.

  4. Time-domain samples are complex-Gaussian (§3.4): two normality tests fail to reject Gaussianity at the 1% significance level for all six tested subcarrier counts.

  5. Frequency offset shifts the spectrum correctly (§3.5): the -3 dB band center lies within ±2% of the sample rate of the requested offset for four tested offset values.

  6. Cyclic-prefix autocorrelation peak at the expected lag (§3.6): the seed-averaged autocorrelation envelope peaks at lag 4N for N in {64, 128}.

Limits and scope-bounded items appear in §4; full citations are in §5.

3. Evidence per claim

3.1 Output shape, dtype, metadata, and determinism

Claim. Every call to generate returns a Signal with IQ tensor of shape (2, round(sample_rate * duration_s)), dtype torch.float32, finite values, metadata family "comms", class taxonomy ("comms", "ofdm", label), snr_db = inf, and extras["num_subcarriers"] equal to the integer parsed from the label. A fresh torch.Generator seeded with the same value reproduces IQ bit-for-bit. Consecutive calls on the same generator advance the seed and produce different IQ.

Design. Parametric over all 12 labels at sample_rate = 8 MHz, duration_s = 5 ms, bandwidth_hz = 2 MHz. Determinism verified by exact equality (np.array_equal) across two fresh torch.Generator(seed=42) instances. Consecutive-call advance verified by asserting inequality between calls on the same generator. DC subtraction contract (|mean|/|peak| < 1e-4) tested at duration_s = 50 ms for labels in {ofdm-64, ofdm-128, ofdm-256, ofdm-1024}.

Result. 28 tests pass for all 12 labels. DC residual: |mean|/|peak| < 3e-9 (contract threshold is < 1e-4). See tests/validation/emitters/torchsig_ofdm/test_experiment_contract.py.

3.2 3 dB occupied bandwidth matches the request

Claim. For all 12 class labels, the realised -3 dB occupied bandwidth as measured by Welch’s periodogram is within ±5% of the requested bandwidth_hz. PSD (power spectral density: the distribution of signal energy across frequency) is estimated using scipy.signal.welch.

Design. All 12 labels at bandwidth_hz = 2 MHz, sample_rate = 8 MHz, duration_s = 50 ms. The -3 dB bandwidth is the width of the contiguous frequency interval where Welch PSD >= peak - 3 dB, using nperseg = 2048 (≈ 3.9 kHz resolution at 8 MHz, one part in 500 of the 2 MHz target). The ±5% bound is an engineering regression threshold for the wrapper’s requested-versus-realized bandwidth contract, not an RF-standard limit or a claim about downstream classifier sensitivity. The experiment uses one seed per label, so it verifies the listed realizations and does not estimate across-seed bandwidth variation.

Tolerance: ±5% of requested bandwidth.

Result. All 12 labels pass this engineering threshold. Measured errors: +1.17% for ofdm-64 and ofdm-72; +0.39% for ofdm-128 and ofdm-180; 0.00% (sub-bin) for ofdm-256 through ofdm-2048. The small-N excess arises from polyphase resampler edge effects in TorchSig. See tests/validation/emitters/torchsig_ofdm/test_experiment_psd_bandwidth.py.

Figure 1: Welch PSD for all 12 OFDM labels at bandwidth_hz = 2 MHz and sample_rate = 8 MHz. Each label shows the characteristic flat-topped OFDM spectral mask; the -3 dB threshold (black dashed) confirms occupied-bandwidth conformance for all labels. Supports §3.2.

Figure 1 shows the normalised PSD for all 12 labels. The flat-topped OFDM mask is visible across the range; each label’s -3 dB bandwidth matches the 2 MHz request within the tolerance.

Figure 2: Measured -3 dB bandwidth error as a percentage of the 2 MHz request for all 12 OFDM labels. All bars fall within the ±5% tolerance (red dashed); the largest error is 1.17% at small subcarrier counts and converges to 0.00% for N >= 256. Supports §3.2.

Figure 2 shows the per-label bandwidth errors relative to the 2 MHz request.

3.3 PAPR CCDF matches OFDM theory

Claim. The per-sample instantaneous-power CCDF (complementary CDF: the probability that instantaneous power exceeds a threshold) matches the asymptotic reference exp(-γ) within a factor of 2 at γ ∈ {3, 5, 7} for N ∈ {64, 128, 256, 512, 1024, 2048}.

Theoretical basis. For an OFDM signal with N subcarriers carrying independent symbols, the time-domain samples approach complex Gaussian by the CLT (Central Limit Theorem: a result stating that sums of independent random variables converge to a Gaussian distribution) as N grows [Wei et al. 2010]. Under complex Gaussianity, per-sample instantaneous power follows an exponential distribution, giving CCDF = exp(-γ). The finite-N per-symbol correction is 1 - (1 - exp(-γ))^N [van Nee & Prasad 2000, Ch. 6]. PAPR (peak-to-average power ratio) governs the dynamic-range headroom that any downstream channel or quantiser must reserve.

Design. For each of the six labels, generate 50 ms at bandwidth_hz = 2 MHz, sample_rate = 8 MHz (~4 × 10^5 samples). Compute per-sample power, normalise to mean power, form the empirical CCDF. At γ = 5, ~4 × 10^5 samples give a standard error of ~0.0004 on the estimated fraction; the factor-of-2 tolerance is conservative relative to that precision.

Result. All six labels pass at all three γ thresholds. Representative measurements for ofdm-256: obs(γ > 3) = 0.0493 vs theory 0.0498; obs(γ > 5) = 0.0065 vs 0.0067; obs(γ > 7) = 0.0009 vs 0.0009. Peak PAPR for ofdm-256 at 50 ms is in the 8–13 dB range consistent with Han & Lee (2005). See tests/validation/emitters/torchsig_ofdm/test_experiment_papr_ccdf.py.

Figure 3: Empirical PAPR complementary CDF (solid lines) vs the van Nee and Prasad asymptotic reference exp(-γ) (black dashed) and factor-of-2 bounds (black dotted) for N in {64, 128, 256, 512, 1024, 2048}. All six empirical curves lie within the factor-of-2 bounds at γ = 5 and γ = 7. Supports §3.3.

Figure 3 shows all six empirical CCDF curves against the asymptotic reference exp(-γ). Every curve falls within the factor-of-2 bounds (dotted lines).

3.4 Time-domain samples are complex-Gaussian

Claim. For N ∈ {64, 128, 256, 512, 1024, 2048}, the I-channel samples of the emitter output are consistent with a Gaussian distribution at significance level α = 0.01 under two independent normality tests.

Theoretical basis. Wei, Goeckel, and Kelly (2010) prove that the complex envelope of a bandlimited OFDM signal converges in distribution to a circularly-symmetric complex Gaussian as N → ∞, with the finite-N residual in the fourth moment scaling as 1/N [DOI: 10.1109/TIT.2010.2059550]. At N = 64 the residual is approximately 1.6% in kurtosis (the fourth standardised central moment: a measure of tail heaviness).

Design. Generate 50 ms at bandwidth_hz = 2 MHz, sample_rate = 8 MHz. Draw 5000 random I-channel samples. Apply: (a) KS (Kolmogorov-Smirnov) test on standardised samples vs N(0,1) via scipy.stats.kstest; (b) D’Agostino-Pearson omnibus test (combined skewness + kurtosis) via scipy.stats.normaltest. 5000 samples give power to detect ~3% deviation in variance; the 1.6% kurtosis residual at N = 64 is below that sensitivity floor. Significance level α = 0.01.

Result. All 12 tests (6 labels × 2 tests) pass. Representative p-values: ofdm-64 KS 0.903, D’Agostino 0.817; ofdm-2048 KS 1.000, D’Agostino 0.640. Minimum observed p-value: 0.087, well above α = 0.01. See tests/validation/emitters/torchsig_ofdm/test_experiment_gaussianity.py.

Figure 4: KS and D'Agostino-Pearson normality test p-values for I-channel samples at N in {64, 128, 256, 512, 1024, 2048} (5000 samples per label). Blue bars are KS p-values; orange bars are D'Agostino p-values. All bars exceed the α = 0.01 threshold (red dashed), confirming failure to reject Gaussianity. Supports §3.4.

Figure 4 shows the KS (blue) and D’Agostino (orange) p-values for all six subcarrier counts. Every bar exceeds the α = 0.01 threshold.

3.5 Frequency offset shifts the spectrum correctly

Claim. When f_offset_hz is non-zero, the rfgen wrapper applies the complex-exponential multiplication iq *= exp(j f_offset_hz · n / sample_rate) that shifts the OFDM band center to f_offset_hz. The -3 dB band centroid (power-weighted mean frequency within the -3 dB band) lies within ±2% of the sample rate of f_offset_hz.

Design. Test at f_offset_hz {0, +1e6, -1.5e6, +2e6} Hz with bandwidth_hz = 1 MHz, sample_rate = 8 MHz, ofdm-256. Band centroid is the power-weighted mean frequency over the -3 dB Welch mask. Tolerance ±2% of fs = ±160 kHz, approximately 3 standard deviations of the centroid estimator’s sampling distribution (~50 kHz at nperseg = 2048 with ~256 bins in the band).

Result. All four offsets pass. See tests/validation/emitters/torchsig_ofdm/test_experiment_frequency_offset.py.

Figure 5: Welch PSD for three frequency offset values (ofdm-256, bandwidth_hz = 1 MHz). Dashed vertical lines show the measured -3 dB band centroid; dotted verticals show the requested offset. Each centroid lies within ±2% of fs (±160 kHz) of the request. Supports §3.5.

Figure 5 shows the PSD for offsets 0, +1 MHz, and -1.5 MHz. Each band’s centroid (dashed) aligns with the requested offset (dotted) within the stated tolerance.

3.6 Cyclic-prefix autocorrelation peak at the expected lag

Claim. TorchSig’s ofdm_modulator prepends a CP: a copy of the last CP samples of the OFDM symbol: creating a deterministic copy in the time-domain signal visible as a peak in the autocorrelation at lag equal to the oversampled IFFT size 4N. The peak is observed at the correct lag for N ∈ {64, 128}.

Theoretical basis. For CP-OFDM, E[x[n] x*[n+L]] peaks when L equals the IFFT size, because the CP creates a copy of the symbol tail at a displacement of exactly that length [Hara & Prasad 2003, Ch. 3]. TorchSig’s internal ofdm_modulator_baseband oversamples by 4× before resampling; at the test conditions (bandwidth_hz / sample_rate = 0.25), the resampler ratio is 1.0, so the peak lands at lag 4N in the output.

Design. Average the magnitude autocorrelation envelope |E[x[n] x*[n+lag]]| over 20 seeds for ofdm-64 (expected lag 256) and ofdm-128 (expected lag 512). TorchSig sets CP = 0 with probability 0.5; the 20-seed average stabilises the peak for small-N labels. Tolerance: ±8 samples.

Restriction to N ∈ {64, 128}. For N >= 256 at 20 seeds, the CP-zero fraction dilutes the autocorrelation peak below the detection threshold at the current sample budget. The N ∈ {64, 128} result confirms the CP mechanism is operative.

Result. Both labels pass. Observed peak lag: 256 for ofdm-64 (expected 256); 512 for ofdm-128 (expected 512). See tests/validation/emitters/torchsig_ofdm/test_experiment_cp_autocorrelation.py.

4. Limits and what’s not validated

Waveform envelope, not a standards-conformant frame. No class label produces a decodable 802.11, LTE, or 5G NR frame. There are no pilot subcarriers, DC null, synchronisation preamble, scrambling, LDPC coding, or resource-element mapping. A receiver running a standards demodulator on the output will fail. The construct is appropriate for OFDM-envelope recognition but not for standards-compliance testing.

No deterministic CP-length control. The CP length is randomised inside TorchSig’s ofdm_modulator_baseband: probability 0.5 of CP = 0, otherwise uniform in [2, N/2). The rfgen caller cannot request a specific CP fraction (e.g., LTE normal-CP vs extended-CP modes). The CP-length policy is not surfaced through TorchSig’s current API.

No per-subcarrier modulation control. The subcarrier modulation is drawn uniformly from TorchSig’s 17 constellation pools and applied uniformly across all subcarriers. There is no per-subcarrier or per-resource-block modulation override.

No transmitter impairments. The emitter does not model PA (power amplifier) non-linearity, IQ (in-phase/quadrature) imbalance, phase noise, or Doppler shift. Real OFDM transmitters show 30–40 dBc ACLR (adjacent channel leakage ratio: power leaked into adjacent frequency bands) floors from PA non-linearity. These impairments belong in the channel layer.

No live over-the-air capture comparison. The emitter does not produce standards-conformant frames, so direct comparison with an 802.11 or LTE OTA (over-the-air) capture is not meaningful at the waveform-envelope level.

CP autocorrelation tested only for N ∈ {64, 128}. For N >= 256 at the 20-seed budget, the CP-zero fraction dilutes the autocorrelation peak below the detection threshold. Extending this test to larger N would require approximately 200 seeds to maintain the same peak-to-background SNR, which exceeds the validation suite’s per-test wall-clock budget.

Short-record statistics. The class docstring recommends sample_rate * duration_s >= 1e4 for callers needing stable bandwidth and PAPR estimates. Below that threshold, PSD-based estimates and CCDF tails are dominated by finite-FFT variance. The emitter does not enforce this guideline; caller responsibility.

5. References

Published works

Citation

Role

Boegner, A. et al., “Large Scale Radio Frequency Signal Classification,” arXiv:2207.09918 (2022). https://arxiv.org/abs/2207.09918

TorchSig canonical reference; source of the 12-label ofdm-N taxonomy and CLASS_FAMILY_DICT.

Proakis, J.G. and Salehi, M. Digital Communications, 5th ed. McGraw-Hill (2008). ISBN: 978-0072957167. §13.5.

OFDM time-domain expression x[n] = (1/N) sum_k X[k] exp(j k n/N).

van Nee, R. and Prasad, R. OFDM for Wireless Multimedia Communications. Artech House (2000). ISBN: 978-1580530156. Chapter 6.

PAPR CCDF reference curve 1 - (1 - exp(-γ))^N; asymptotic exp(-γ) form.

Wei, S., Goeckel, D.L., Kelly, P.A. “Convergence of the Complex Envelope of Bandlimited OFDM Signals.” IEEE Transactions on Information Theory, vol. 56, no. 10, pp. 4893–4904 (2010). DOI: 10.1109/TIT.2010.2059550.

Proof of CLT-driven complex Gaussianity for OFDM time-domain samples; 1/N finite-N correction.

Han, S.H. and Lee, J.H. “An overview of peak-to-average power ratio reduction techniques for multicarrier transmission.” IEEE Wireless Communications, vol. 12, no. 2, pp. 56–65 (2005). DOI: 10.1109/MWC.2005.1421929.

Published PAPR range 8–13 dB for OFDM with N ~ 256; bounds the test_papr_within_published_range assertion.

Hara, S. and Prasad, R. Multicarrier Techniques for 4G Mobile Communications. Artech House (2003). ISBN: 978-1580537629. Chapter 3.

CP autocorrelation theory: E[x[n] x*[n+L]] peaks at IFFT size when CP > 0.

IEEE Std 802.11-2020, §17.

FFT sizes 64, 128, 512, 1024 for Wi-Fi a/g/n/ac/ax PHYs.

3GPP TS 36.211 Release 17 (2022), §6.12.

LTE OFDM subcarrier counts 72, 180, 300, 600, 900, 1200 (RB × 12).

3GPP TS 38.211 Release 17 (2022), §4.4.1.

5G NR FFT size 2048 at 30 kHz subcarrier spacing, 60 MHz BW.

ETSI EN 302 755 V1.4.1 (2015).

DVB-T2 FFT modes 256 (1k), 1024 (8k), 2048 (16k).

Libraries

PyPI distribution

Installed version

Docs URL

Role in validation

torchsig

2.1.1

https://torchsig.com/

OFDM IQ synthesis via ofdm_modulator; source of 12-label taxonomy

torch

2.12.1

https://pytorch.org/docs/stable/

torch.Generator entropy source; IQ tensor container

numpy

2.4.6

https://numpy.org/doc/stable/

Array operations; DC subtraction; frequency-shift exponential

scipy

1.18.0

https://docs.scipy.org/doc/scipy/

Welch PSD (scipy.signal.welch); KS test (scipy.stats.kstest); D’Agostino test (scipy.stats.normaltest)

matplotlib

3.11.0

https://matplotlib.org/stable/

Figure generation in generate_figures.py

pydantic

2.13.4

https://docs.pydantic.dev/latest/

Parameter validation via TorchSigOFDMParams