# Demo — RWR Scope

A radar warning receiver hears one merged stream of pulses from every emitter in view. Its first job is not hearing but *sorting* — deinterleaving that chaos into per-emitter buckets and classifying each against a threat library. This demo runs that pipeline on a dense scene built from the Block 1 cast.

## The pipeline

Each pulse becomes a descriptor; the processor clusters by frequency and AoA, estimates each cluster's PRI from time-of-arrival differences, then matches (frequency, PRI, PW) against the library and reads the mode from PRF jumps.

## Interactive demo

<a class="demo-fullscreen" href="../_static/demos/RWRScope.html" target="_blank" rel="noopener">Open in full screen</a>

<div class="demo-wrap">
<iframe src="../_static/demos/RWRScope.html"
        title="Interactive RWR deinterleave and classify scope"
        width="100%"
        loading="lazy">
</iframe>
</div>

## Walkthrough

1. **Look at the interleaved stream.** Three emitters — EW (0.5 GHz, PRI 5 ms), ACQ (3 GHz, PRI 2 ms), TTR (10 GHz, PRI 0.1 ms) — merge into one timeline. It is hard to read anything by eye.
2. **Hit Deinterleave.** The stream splits into per-emitter lanes grouped by frequency. Now each emitter's regular PRI is obvious.
3. **Read the threat table.** Each bucket resolves to a measured frequency, an estimated PRI, a classified type, and a mode — the TTR's tiny PRI marks it as a tracker, not a searcher.
4. **Add clutter.** Raise the noise slider and watch spurious pulses crowd the interleaved view — the sort gets harder, which is exactly the RWR's real problem.
5. **Classify the mystery emitter.** Turn it on and call it from its parametrics.

## Key observations

- **PRI is the most diagnostic single number.** Frequency narrows the band; PRI and scan name the system and its mode.
- **Deinterleaving precedes classification.** You cannot identify what you have not first separated.
- **Mode determination is kill-chain awareness.** A PRF jump from search to track is the IADS handoff happening live on the scope.

## Source

<a class="matlab-link" href="../_static/downloads/ECE%20495%20EW%20%E2%80%93%20Code.zip#code/L12_RWRPulseSort.m" download><svg viewBox="0 0 22 22" width="14" height="14" aria-hidden="true" style="vertical-align:-2px;margin-right:6px;"><rect width="22" height="22" rx="3" fill="#e87722"/><text x="11" y="15.5" text-anchor="middle" font-family="'Inter',sans-serif" font-size="9" font-weight="800" fill="#fff" letter-spacing="-0.04em">MAT</text></svg><span class="ml-text">MATLAB · code/L12_RWRPulseSort.m</span><span class="ml-arrow">↓</span></a>

The in-class script merges three emitters' pulse trains into one time-of-arrival stream, deinterleaves by measured frequency, estimates each cluster's PRI, and classifies against a three-entry library.
