LoRa ELM Estimator

LoRa Synchronization

A LoRa packet consists of 6-12 preamble upchirps, 2 sync word upchirps and 2.25 downchirps. The existing 3-stage DSP algorithm (Xhonneux et al. 2021) estimates the Carrier Frequency Offset (CFO) and Symbol Timing Offset (STO) from these symbols by exploiting the known chirp structure. The question is whether an Extreme Learning Machine (ELM) can improve on ( or replace ) this deterministic approach.

Extreme Learning Machine

An Extreme Learning Machine (ELM) is a feed-forward neural network with one hidden layer where the input weights are randomly initialized and never trained. Only the output weights are learned via closed-form least squares (ridge regression). This makes training extremely fast: a single matrix solve instead of iterative backpropagation.

To use an ELM for CFO and STO prediction, two approaches were tested.

Approach 1: ELM on DSP Residuals

The purpose of this approach is to predict the residual error left after applying the synchronization algorithm. We extracted 10 intermediate DSP values (such as fractional CFO, preliminary STO, and upchirp/downchirp peak positions) as features and trained an ELM with 64 hidden neurons to predict the residual (true CFO — DSP CFO, true STO — DSP STO).

The Result: The ELM yielded an \(R^2 \approx 0.035\).

This means the features explain only 3.5% of the residual variance. The remaining 96.5% is uncorrelated with any measured feature. Why? Because the existing 3-stage DSP algorithm is already acting as an asymptotic Maximum Likelihood Estimator (MLE) for a complex sinusoid in Gaussian noise. The residuals are essentially irreducible Additive White Gaussian Noise (AWGN).

Expanding the feature space (adding quadratic terms, cross-correlation phase angles, sync word deviations) or increasing hidden neurons (up to 2048) did not improve the \(R^2\). There was no hidden signal left to extract, the DSP had already reached the information-theoretic bound for the given preamble data.

Experiment CFO $$R^2$$ STO $$R^2$$
10 DSP features, linear regression 0.035 0.042
+ quadratic terms 0.036 0.042
+ ELM (64 hidden) 0.025 0.038
+ ELM (512 hidden) 0.035 0.042
+ cross-corr + SW dev features 0.035 0.042
Scatter plot of DSP residuals vs true CFO and STO. The circular, uncorrelated distribution visually demonstrates that the residuals are purely AWGN; no model can learn to reduce them further.

Approach 2: The Raw ELM — Replacing the DSP Entirely

Since predicting residuals failed, the second approach was to bypass the DSP entirely and map the raw preamble features (a 77-dimensional vector of peak positions, cross-correlation phase angles, and phase-invariant neighbor bin differences) directly to the absolute CFO and STO using the ELM.

Training

The model was trained on 365,000 synthetic samples generated from a real GNU Radio preamble template. Each sample applies a random CFO ∈ [−6, 6] bins, STO ∈ [−64, 64] samples, and SNR ∈ [−25, 0] dB. The ELM used 2048 hidden units with tanh activation and z-score normalization, trained via closed-form ridge regression.

Split CFO RMSE CFO $$R^2$$ STO RMSE STO $$R^2$$
Train 2.45 bins 0.49 16.7 samples 0.78
Validation 2.46 bins 0.48 17.0 samples 0.78

Interpreting these metrics:

  • RMSE is the average prediction error in the original units (bins or samples). A CFO RMSE of 2.45 bins means the typical prediction is off by about 2.45 bin spacings, which at BW=125kHz and SF=7 corresponds to \(2.45 \times 125000/128 \approx 2390\) Hz. For context, the target range is [−6, 6] bins, so the error covers about 20% of the full range.
  • \(R^2\) measures the fraction of variance explained by the model, relative to a baseline that always predicts the mean. \(R^2 = 1\) is perfect, \(R^2 = 0\) means the model is no better than guessing the average, and \(R^2 < 0\) means it is worse. A CFO \(R^2\) of 0.49 indicates the model explains about half the variance — the other half is unexplained error. An STO \(R^2\) of 0.78 indicates better performance for timing estimation, explaining nearly 80% of the variance.

These numbers suggest a model that has learned the CFO/STO mapping to a reasonable degree.

Decode Performance

The trained model was then tested on real GNU Radio packets at various SNR levels (no CFO,STO insertion). The goal was to use the predicted CFO and STO to frequency-correct and time-align the packet, then demodulate and decode the payload. The result:

SNR CFO error STO error BER Decoded?
−20 dB ~3.7 bins ~−2.7 samp 46% No
−15 dB ~3.7 bins ~−2.7 samp 42% No
−10 dB ~3.7 bins ~−2.7 samp 37% No
−5 dB ~3.7 bins ~−2.7 samp 38% No
0 dB ~3.7 bins ~−2.7 samp 38% No
Clean 3.70 bins −2.73 samp 37% No

The CFO error stays at ≈3.7 bins regardless of SNR; even on a perfectly clean packet with no noise. The BER never drops below ≈37%, which is essentially random symbol demodulation for the LoRa coding scheme used (SF=7, BW=125khz, implicit header, CR=1, CRC enabled).

Discussion

Despite achieving a validation CFO RMSE of 2.46 bins and \(R^2 = 0.48\), the model never decoded a single packet correctly.

The ELM’s validation metrics actually look better than the DSP’s when measured at low SNR:

Metric (at −15 dB SNR) DSP ELM Better?
CFO RMSE 13.10 bins 2.46 bins ELM ✓
CFO $$R^2$$ 0.21 0.48 ELM ✓
STO RMSE 18.7 samples 17.0 samples ELM ✓
BER 27% 42% DSP ✓
Packets decoded Yes Never DSP ✓

The ELM beats the DSP on CFO RMSE, \(R^2\), and STO RMSE — yet the DSP decodes packets while the ELM decodes none. The CFO error on every real packet was dominated by a ≈3.7-bin systematic shift, not by noise. The DSP’s estimates are unbiased (zero-mean), so as SNR improves the error converges to zero and decoding succeeds. The ELM’s error remained constant regardless of SNR because the bias is embedded in the learned mapping, not driven by noise.

This raises a fundamental question: why does a model with better CFO/STO estimation accuracy (measured by RMSE and \(R^2\)) fail to decode every packet it is asked to synchronize?

The Real Path Forward: Symbol Demodulation

The conclusion from these experiments is definitive: deterministic parameter estimation should be left to exact mathematical frameworks. The DSP exploits closed-form arithmetic and physical signal properties that stochastic weights simply cannot approximate more efficiently.

However, this does not mean Machine Learning has no place in the LoRa physical layer. While ML cannot improve synchronization, it excels at pattern recognition on synchronized data.

Once the deterministic DSP has successfully compensated for the CFO and STO, recovering the actual symbol values from a noisy environment becomes a denoising problem. One approach is to train a Diffusion transformer to reconstruct (denoise) the symbol under extreme snr conditions.




Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • SatNOGs Ground Station
  • Building a SatNOGs Ground Station in Egypt
  • End of My GSoC journey
  • Documentation and Soapy Sdr source
  • Multiple Recording Feature