It’s time to process some signals and compare “real” neural networks and “complex” neural networks. First off let’s explain what in the world we are going to attempt. Part 1 was all about setting up the foundation for how complex numbers work. We learned how to use Wirtinger derivatives to backprop and train models. We learned that complex layers should be able to capture rotations and natural relationships a bit more efficiently than real numbers.

The goal now is to test some complex and real models on the same problem and see what happens.

Modulation Classification

Our task is to take in received bursts of IQ data. Once we receive these bursts we want to classify them into their modulation.

The modulations we are looking at are BPSK, QPSK, 8PSK, and 16QAM. These are the four class labels we want to try and classify. Signals do not come in clean. In the real world signals will contain a lot of noise. Every signal is rotated and additive white Gaussian noise is applied to these signals. These types of rotations are what you would see in the real world and in many cases you would have to deal with many other outside influences.

Modulation Phase states Bits per symbol Use Cases
BPSK (Binary Phase Shift Keying) 2 1 Satellite links, GPS, and other weak or noisy links that need a robust signal.
QPSK (Quadrature Phase Shift Keying) 4 2 Satellite communication, cellular systems, and Wi-Fi control channels.
8PSK (8-Phase Shift Keying) 8 3 Higher-data-rate links where the channel is clean enough for the crowded constellation.
16QAM (16-Quadrature Amplitude Modulation) 16 4 High-throughput Wi-Fi, LTE, 5G, and cable-modem links when signal conditions are good.

If you remember from part 1, these rotations are why we want to test some complex layers. We should be able to learn these natural rotational relationships easier with complex layers. That is the hypothesis. The experiment will show whether complex math alone is enough.

This interactive plot shows the types of signal data we are going to be looking at. The left shows the constellation plot and the right shows the IQ data broken out into in phase and quadrature.

128 symbols; a single phase offset applies to the whole burst. The model must classify the alphabet, not the rotation.

Training Setup

Model Architecture

Our goal is to see if we can only train on a 15 degree rotation band and see if the models generalize after that. There is a real model that is trained on the full rotation degrees just to compare and see what happens.

All four models have similar layers and params. 60,487 for the moment model, 61,655 for the plain complex model, and 60,964 for both real models.

Our models trained on 15 degrees rotation are:

  • Complex: Processes I and Q together as one complex-valued signal. It learns complex features, then pools their magnitudes so its prediction does not change under one overall signal rotation.
  • Complex with moments: Uses the same complex feature extractor, then adds phase moments at orders 2, 4, and 8 on the final learned feature maps. This works by taking a point, ignore how far it is from the origin, keep the angle, multiply that angle by 2, 4, or 8, and average across the burst. Points that repeat at a matching spacing reinforce each other: BPSK has a two-way pattern, QPSK has a four-way pattern, and 8PSK has an eight-way pattern. We keep the size of that average, so rotating the entire signal does not change the feature.
  • Real Value: Splits the signal into separate I and Q channels and processes them with a standard real-valued convolutional network. It has to learn rotation invariance from the examples it sees.

Model trained on the full rotation range:

  • Real Value: The same split-I/Q real model, trained with rotations across the full circle so it can learn that invariance from augmented data.

Dataset

  • Signal: Complex baseband IQ (complex64), 128 symbols per burst, and unit-average-power constellations.
  • Classes: BPSK, QPSK, 8PSK, and 16QAM; balanced and shuffled with 3,000 training bursts per class.
  • Splits: 12,000 training bursts, 4,000 in-distribution validation bursts, and 4,000 full-circle validation bursts.
  • Channel effects: One uniformly sampled carrier phase per burst plus AWGN at 10 dB SNR, scaled to the burst power.
  • Rotation ranges: Narrow runs use +/-15 degrees; real_full uses +/-180 degrees.
  • Reproducibility: Random seed 7, with separate seed offsets for each split.

Training Params

  • Runs: complex_narrow, complex_moment, real_narrow, and real_full.
  • Schedule: 25 epochs, batch size 256, and shuffled training batches.
  • Optimization: Adam with learning rate 0.001, weight decay 0.0001, and gradient-norm clipping at 5.0.
  • Objective: Four-class cross entropy; the checkpoint with the best full-circle validation score is saved as best_model.pt.

Results

Model checkpoints are evaluated with a full-circle rotation sweep in 5 degree steps, a per-modulation rotation sweep, a full-circle SNR sweep, and confusion matrices at 0 and 90 degrees. Rotations use 10 dB SNR and 2,000 generated test bursts at each angle. SNR evaluations use 4,000 bursts at each noise level.

Model Training rotations Accuracy at 0 degrees Accuracy at 90 degrees Lowest accuracy across 360 degrees Mean accuracy across 360 degrees
Complex + moments +/-15 degrees 98.6% 98.3% 97.9% 98.4%
Complex +/-15 degrees 81.4% 81.2% 80.2% 81.0%
Real narrow +/-15 degrees 97.1% 72.2% 45.9% 63.5%
Real full +/-180 degrees 72.0% 72.2% 70.6% 72.0%

The moment model stays nearly flat over every rotation. The narrow real model does well near 0 degrees where it trained, then crumbles outside that band and a few symmetry-friendly angles: 97.1% at 0 degrees, 72.2% at 90 degrees, and 45.9% at its worst angle. It learned the band it saw instead of learning the symmetry. Training the real model across the whole circle removes that collapse but it still does not match the moment model.

Overall rotation accuracy. The notebook evaluates every 5 degrees from -180 to +180 degrees.

Classification accuracy versus carrier phase rotation for all four models

Accuracy by modulation type. These panels show where each modulation contributes to the narrow real model's rotation sensitivity.

Per-modulation classification accuracy versus carrier phase rotation

Model 20 dB SNR 10 dB SNR 5 dB SNR 0 dB SNR
Complex + moments 97.1% 98.3% 39.3% 25.0%
Complex 83.8% 81.9% 29.9% 25.0%
Real narrow 57.2% 62.7% 29.8% 25.0%
Real full 68.5% 71.5% 44.6% 25.0%

At 0 dB and below, all models are at the four-class chance level of 25%.

A few notes that are worth pointing out is how some models do better at 10 dB than 20 dB. This is because the models were trained at 10 dB, so they match that noise level better. All the models take a hit at 5 dB for multiple reasons. The models are trained at 10 dB for one, and 5 dB is hard since the signal starts blending into the noise.

Noise sweep. Each point uses rotations uniformly distributed across the full circle.

Full-circle modulation classification accuracy at different SNR values

Confusion matrices. Rows are true modulation labels and columns are predicted labels. The 90 degree column is outside the narrow training band.

Confusion matrices comparing in-distribution and out-of-distribution carrier-phase rotations

Explaining the Results

My hypothesis was that complex models generalize better from a narrower range of rotations. The results support this (I was finally right but also kind of wrong), but that is not the full picture.

While the plain complex model generalized better than the real narrow model, this does not mean the complex math was the reason for all the gains. Most of our performance is from the moment model that built a way capture the symmetry. Calculating those phase moments on the learned features and averaging them gave the best model for generalizing beyond the trained 15 degrees of rotation.

This does not mean a real model trained on the full range of degrees could not also learn this. The full real model does the best at 5 dB in this run. The complex versions are able to generalize with a smaller degree of rotation, not with fewer examples. They saw the same amount of training data, just over a narrower rotation band.

The SNR sweep is measuring a different problem entirely. Lower SNR makes the signal harder to separate from the noise since it blends into it, which is a robustness problem rather than a symmetry problem.

Limitations

Keep in mind that this problem in the real world is harder. Signals come faded, contain frequency offsets, timing offsets, imbalances and more. Our example shows how building known symmetries into the model can help you get more out of a narrower training rotation range.

This is also a single seed at a single training SNR, and the data is generated with TorchSig rather than captured over the air (OTA).

RF Fingerprinting

The next task we will tackle is a bit more challenging. We will try to do RF fingerprinting, which is where you try to tell which emitter sent the signal. Even if two emitters send the same signal, no manufacturer produces an antenna and apparatus to be exactly the same. They are allowed a margin of error. Our task is to detect the exact emitter that sent a signal even when two emitters send the same message.

In this experiment, every emitter sends QPSK. The emitter ID is the class label, while the message content changes between segments. Each model must identify the emitter from repeatable hardware distortions such as I/Q imbalance, oscillator phase noise, and power-amplifier nonlinearity.

Model Input Output
Real CNN One 256-sample IQ capture, split into two real channels: I and Q Four scores, one for each emitter class
Complex CNN The same 256-sample IQ capture represented as one complex-valued channel Four scores, one for each emitter class

Gain, carrier phase, and channel noise change for every signal, so the classifier has to learn the transmitter rather than the channel.

Both panels begin with the same QPSK symbols. The small, persistent differences are the synthetic transmitter fingerprints; the phase rotation and noise are channel effects that change each capture. This demo shows two emitters for clarity. The experiment below uses four.

Training Setup

Model Architecture

Dataset

  • Signal: QPSK complex baseband IQ, 256 samples per capture.
  • Classes: 4 synthetic emitters.
  • Hardware fingerprint: Fixed differential I/Q gain and phase imbalance, oscillator phase noise, and power-amplifier nonlinearity per emitter.
  • Per-capture channel effects: Independent payload, gain (0.8 to 1.2), phase (-0.05 to 0.05 rad), and AWGN; bursts normalized to unit power.
  • Training split: 400 captures per emitter, 1,600 total, at 20 dB SNR.
  • Test split: 120 held-out captures per emitter, 480 total, at 20 dB SNR.

Hardware-impaired constellations. Two of the four emitters. The same QPSK waveform develops different point-cloud shapes after each emitter's fixed hardware effects and capture variation.

Constellations from two synthetic QPSK emitters with different hardware fingerprints

Training Params

  • Models: Real CNN and complex CNN; both use 3 stride-2 convolutional layers and a 64-value embedding.
  • Epochs: 17.
  • Batch size: 128.
  • Optimizer: Adam.
  • Learning rate: 0.001.
  • Objective: Four-class cross entropy.

Results

Both the real and complex models contain almost the same amount of params.

Model Real scalar parameters Test accuracy Worst-emitter accuracy
Real CNN 34,476 100.0% 100.0%
Complex CNN 34,964 99.8% 99.2%

Closed-set confusion matrices. Rows are the true emitter identities and columns are predicted identities for the held-out captures.

Real and complex CNN confusion matrices for four synthetic RF emitters

The models also perform well at different noise levels as seen below.

Model 6 dB SNR 10 dB SNR 14 dB SNR 18 dB SNR 22 dB SNR
Real CNN 98.0% 100.0% 100.0% 100.0% 100.0%
Complex CNN 96.5% 99.5% 99.5% 100.0% 100.0%

Noise sweep. The trained models are evaluated on newly generated captures at each SNR without retraining.

RF fingerprinting accuracy at different signal-to-noise ratios for real and complex CNNs

The open-set test used two emitters the models had never seen before. Both models scored similar and the complex model just edged out a higher score, but not enough to draw any major conclusions.

Model Unknown-emitter AUROC
Real CNN 0.656
Complex CNN 0.699

Learned embeddings. The 64-value encoder outputs are projected to two dimensions with PCA; color identifies the true emitter.

PCA projections of real and complex RF fingerprint encoder embeddings

Explaining the Results

For modulation classification the moment model clearly blasted its way to victory. The real and complex models are effectively tied, and that difference lies in the geometry and task.

The modulation task had a symmetry worth squeezing all that juice out of: a global carrier phase rotation changes the input but not the label. RF fingerprinting is not the same. The label is the emitter ID. The hardware distortions are the clues used to identify that emitter. Gain, phase, and noise still change every capture, but there is no geometric trick that captures all the device-specific crap in this setup. Without that kind of symmetry, complex layers do not offer the same help they did for modulation classification.

  • Both models see the exact same IQ waveform. Hand a real CNN I and Q as two channels and it figures out the relationship between them.
  • These fingerprints are random device-specific garbage, not a clean rotation symmetry. Complex layers have a built-in edge for rotations; here they have nothing special to grab onto.
  • The I/Q imbalance does have a conjugate structure the complex model can write down directly. But a real CNN with enough capacity can learn the same transform, it just has to grind it out of the data.
  • Both models sit at roughly 34.5k params, and with only 4 emitters everyone is near perfect anyway. No headroom left for either one to separate.

Limitations

This RF fingerprint example is heavily simplified compared to the real world. This problem may show a different story if we took the time to make it more intricate and more realistic. RF fingerprinting is challenging and there are many ways to scale this experiment to include more distortions and expand the open and closed set of emitters.

This experiment only trains on 4 emitters, which is very small, and all of the data is synthetic, generated with torchsig. Real emitters will not play as neat and tidy as our examples. There are real RF fingerprinting datasets out there, but for this blog post we emulated the problem instead.

There are many distortions we have not applied, and no doppler shifting or frequency offsets. This is also a single run, the open-set test only has two unknown emitters, and the gaps between models are tiny. These results are here to show that complex models are not automatically better than real models. You have to understand the problem and know when to reach for them.

Conclusion

We have taken our knowledge of Wirtinger derivatives and applied them with complex models to test how they compare with real models. The gist of it is that when a problem has a global geometric symmetry, complex layers give you a natural way to build that symmetry into the architecture. In this experiment that meant generalizing from a narrower rotation range instead of needing full circle augmentation. They are not always the best. For fingerprinting there are so many device-specific modifications that you lose that advantage, because there is no single clean geometric structure left to capture.

The modulation experiment shows that complex arithmetic on its own was not enough. The plain complex model lost to the real model inside its training band. The gain came from the invariant pooling head built on top of those complex features. Complex layers make that kind of head easy to express.

The important part is understanding when a problem actually has a symmetry worth encoding, and recognizing that when it doesn’t, a well-built real model will do fine.

Modulation Classification Notebook

RF Fingerprinting Notebook