> ## Documentation Index
> Fetch the complete documentation index at: https://docs.embedder.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Spectrum analyzer

> Run frequency sweeps on a Siglent SSA3015X Plus over LAN, view them in the Monitor's Spectrum Analyzer tab, and script captures with spectrum_* helpers.

Use a spectrum analyzer to check RF emissions, clock harmonics, switching-regulator noise, and other frequency-domain behavior. Embedder supports the **Siglent SSA3015X Plus**. Sweeps appear in the Monitor's **Spectrum Analyzer** tab.

## Check the model

Only the SSA3015X Plus is supported. Embedder checks the analyzer's `*IDN?` response and rejects other models.

* **Range:** 0 to 1.5 GHz with a nonzero span. Rated instrument performance begins at 9 kHz.
* **Mode:** swept spectrum in dBm with positive-peak detection.
* **Not supported:** zero span, IQ, vector network analysis, modulation analysis, and tracking-generator control. Embedder never enables the tracking generator output.

Support is verified against a protocol simulator based on Siglent's SSA3000X Plus programming guide. Check a sweep against a known signal the first time you use your analyzer's firmware.

## Connect

The analyzer connects over LAN on SCPI port `5025`. Embedder needs Python 3 on the host, but no vendor or VISA packages.

1. Put the analyzer on a network reachable from the Embedder host.
2. Open the Monitor and select **+**. Select the analyzer under **On the bench**, or type its address, such as `192.168.1.20`, in the search field and select the **Connect to** result.
3. The **Spectrum Analyzer** tab connects when the analyzer is **Ready**. If the device bar shows **Set up & connect**, for example when Python 3 is missing, select it.

The tab's device bar shows the analyzer's state and offers **Rename** and **Rescan**, plus **Forget** for a saved analyzer that isn't currently detected. See [Connect a bench instrument](/debug-mode/overview#connect-a-bench-instrument) for device states.

## Run a sweep in the Monitor

Open the setup panel to set the sweep:

| Field | Unit | Range |
| - | - | - |
| **Start frequency** | MHz | 0 to 1500 |
| **Stop frequency** | MHz | 0 to 1500 |
| **Resolution BW** | Hz | 1 to 1,000,000 |
| **Reference level** | dBm | -100 to 30 |
| **Sweep timeout** | s | 1 to 300 |

Then choose a capture mode:

* **Single:** acquire one sweep.
* **Record:** record repeated sweeps until you select **Stop**. Settings are locked while recording.

The tab shows the peak frequency and peak amplitude of the selected sweep. Use the zoom controls to inspect part of the span. Use the previous and next sweep controls to step through a recording, or select **Latest** to follow the latest completed sweep.

Embedder saves every sweep as it completes. Stopping a recording keeps the saved sweeps. Open capture history to reopen earlier recordings without the analyzer connected.

## Ask Embedder for a sweep

```text theme={"system"}
Connect to the spectrum analyzer and sweep 90 to 110 MHz with 10 kHz RBW
and a 0 dBm reference level. Report the peak frequency and amplitude.
```

Name the frequency range, resolution bandwidth, reference level, and how many sweeps you need.

## Script a sweep

Use `spectrum_*` helpers in a [hardware script](/debug-mode/hardware-scripts):

```python theme={"system"}
import json

spectrum_connect(timeout_s=30)  # analyzer selected in the Monitor
spectrum_configure(start_hz=90e6, stop_hz=110e6, rbw_hz=10000, reference_dbm=0)
result = spectrum_capture(name="RF check")
spectrum_disconnect()
print(json.dumps({"success": True, "summary": "Spectrum captured", "data": result}))
```

| Helper | Purpose |
| - | - |
| `spectrum_connect(host=None, *, port=None, timeout_s=10.0)` | Connect and verify the model. With no host, uses the analyzer selected in the Monitor, then `EMBEDDER_SPECTRUM_HOST`. |
| `spectrum_configure(*, start_hz, stop_hz, rbw_hz=10000, vbw_hz=None, reference_dbm=0, attenuation_db=None)` | Set the sweep. Returns the applied settings because firmware may round bandwidths. |
| `spectrum_capture(*, name="Spectrum recording")` | Acquire and save one sweep. Repeated calls append numbered sweeps to the same recording. Returns the capture ID, sweep number, point count, peak, and applied settings. |
| `spectrum_settings()` | Read the analyzer's current settings. |
| `spectrum_screenshot(path)` | Save a BMP or PNG screenshot. |
| `spectrum_query(command)` / `spectrum_write(command)` | Send raw SCPI. |
| `spectrum_disconnect()` | Restore the original continuous-sweep setting and close the connection. |

Attenuation stays under instrument control unless you pass `attenuation_db`. For long sweeps, increase `timeout_s` up to 300 seconds. Without a Monitor selection, pass the address or set it before launching Embedder:

```bash theme={"system"}
export EMBEDDER_SPECTRUM_HOST=192.168.1.20
```

## Troubleshoot

* **No analyzer:** check the IP address and network, then select **Rescan** or type its address in the **Connect** tab.
* **Model rejected:** only the SSA3015X Plus is supported.
* **Sweep timeout:** increase **Sweep timeout** or `timeout_s`, or narrow the span or widen the RBW.
* **Capture failed:** Embedder fails the sweep on malformed data, command errors, or settings that changed during the sweep. Reconnect after a transport error before retrying.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.