Example: FFTScope

This image has an empty alt attribute; its file name is fftscope_intro-4-1024x868.png

FFTScope is an open-source, browser-based signal generator and spectrum analyzer for Opal Kelly FPGAs. Built on FrontPanel Platform, it chains three instruments into one app: a tone-summing waveform generator that feeds the DAC, a dual-channel oscilloscope that captures the ADC input, and a spectrum analyzer that displays the FFT of that same capture.

Supported Configurations

This image has an empty alt attribute; its file name is XEM8320-ADC-DAC-Perspective-1024x819.png

FFTScope runs on any supported host board and needs at least one of two peripherals: the SZG-DAC-AD9116 (Port A), an SZG-ADC-LTC226x variant (Port B), or both.

Board / SYZYGY PeripheralSample RateBit WidthSpectrum Range
XEM8320-AU25P
  SZG-ADC-LTC2268125 MSPS14-bit0–62.5 MHz
  SZG-ADC-LTC226440 MSPS12-bit0–20 MHz
SZG-HUB1450-AU10P
  SZG-ADC-LTC2268125 MSPS14-bit0–62.5 MHz
  SZG-ADC-LTC226440 MSPS12-bit0–20 MHz

Operating Modes

The app detects which peripherals are present at startup and runs in one of three modes:

  • Full — DAC on Port A and ADC on Port B. Waveform generator, oscilloscope, and spectrum analyzer are all active.
  • DAC-only — DAC on Port A only. Waveform generator only.
  • ADC-only — ADC on Port B only. Oscilloscope and spectrum analyzer only.

Resources

Host Boards

SYZYGY Peripherals

Links

Getting Started

You’ll need:

To run the example design:

  1. Connect the SZG-DAC-AD9116 to Port A and the SZG-ADC-LTC226x to Port B on the host board. Connect a DAC output to an ADC input. Connect the board to the PC via USB, and power on.
  2. Install the FFTScope.fpp in the Application Launcher.
  3. Drag the FFTScope app card onto the device card.

How To Build the Gateware

Requirements

Build steps

Each supported configuration has its own gateware folder Gateware/<Board>/FFTScope-14/ (SZG-ADC-LTC2268) or Gateware/<Board>/FFTScope-12/ (SZG-ADC-LTC2264). From that folder:

  1. Copy the FrontPanel Vivado IP distribution and the SYZYGY ADC and DAC IP cores into the IP/ folder.
  2. In the Vivado Tcl console cd to the project folder and run source project.tcl.
  3. When Vivado opens, Generate the bitstream. The output is fftscope_14.bit or fftscope_12.bit.

See the README for more details.

How To Build the Software

Requirements

Build steps

From the Software/ folder in the release:

npm install
npm run pack

The packaged .fpp is written to Software/output/FFTScope.fpp. Pre-built bitfiles for all supported configurations ship with the repository, so you do not need to rebuild the gateware first.

Software Architecture Reference

Layers. The App Shell (App.tsx) owns the device lifecycle. It reads each SYZYGYn_PRODUCT_MODEL to find the DAC and the Port B ADC to select the matching bitfile. Finally it builds the drivers. DatapathCtrlDriver handles arm, status and path select. DACDriver handles DAC bring-up and spectrum streaming. ADCDriver handles ADC status and realignment. CaptureSequencer runs the arm, wait and drain cycle, and WaveformGenerator turns the 8 tone slots into a spectrum. The views are FFTScopeView, WaveformGeneratorView, DigitizerView, TimeDomainView, SpectrumView and SpectrogramView.

Transport seam. The drivers depend only on IAxiLite and IAxiStream. On the SZG-HUB1450, these come directly from IFPGADataPortAXI. On the XEM8320, AxiLiteOverClassicDataPort and AxiStreamOverClassicDataPort implement them over IFPGADataPortClassic, using WireIn, WireOut, TriggerIn and BTPipeIn/Out. Nothing above the transport knows which board it is running on.

Gateware Architecture Reference

Data path. On the generate side, the host streams a 2048-bin complex spectrum over AXI-Stream into an inverse Xilinx FFT core. The reconstructed waveform is packed for the SZG-DAC-AD911x and written to a playback buffer, which loops it continuously into the SYZYGY DAC IP on Port A at 125 MSPS. On the capture side, the SYZYGY ADC IP on Port B deserializes and aligns both LVDS channels and outputs signed samples. When software arms a capture, the time capture buffer records 2048 samples per channel which then feeds to two paths. The time path offers those samples directly to the host. The frequency path replays them into a pair of Xilinx forward FFT cores, one per channel, and each FFT result lands in its own frequency capture buffer. The AXI4 Stream Switch, set by datapath_ctrl, selects which buffer streams to the host and holds the other.

Control path. Alongside the data paths, FrontPanel exposes a per-block register interface for configuration, status flags, and one-shot triggers. On the SZG-HUB1450, okHost speaks native AXI-Lite and AXI-Stream, which a SmartConnect fans out to each block. On the XEM8320, the FrontPanel Vivado IP Core exposes classic endpoints which are translated to AXI using classic-to-AXI shims.

MCP Description

Waveform Generator (6 Tools)

Eight independent frequency-vector slots are summed by an IFFT engine. Each slot has an FFT bin number, a dBFS amplitude, and an enable flag.

  • wavegen_initialize — enables DAC playout and re-applies the current 8 slots.
  • wavegen_reset — silences the DAC and returns all 8 slots to disabled at -120 dBFS.
  • wavegen_set_vector — configures one slot (slot, bin, amplitudeDbfs, enabled).
  • wavegen_set_autoscale — scales tones down so their summed amplitude stays at or below full scale.
  • wavegen_get_state — reads the current state of all eight slots.
  • wavegen_get_sample_rate — reads DAC sample rate, IFFT length, and per-bin frequency spacing.

Digitizer (7 Tools)

Two-channel ADC capture, with both a continuous-refresh loop and a single-shot mode.

  • digitizer_reset — realigns the ADC, clears its sticky flags and resumes continuous capture.
  • digitizer_set_channel_enabled — show or hide a channel’s trace.
  • digitizer_set_continuous — start or stop the periodic capture loop (≈ 35 ms refresh).
  • digitizer_capture_once — captures one 2048-sample frame on both channels.
  • digitizer_read_samples — captures one frame and returns 2048 MSB-aligned signed 16-bit samples per channel.
  • digitizer_get_sample_rate — read the ADC sample rate in Hz, the FFT length, and the bin spacing.
  • digitizer_get_channel_enabled — read whether a channel is currently displayed.

Spectrum / Spectrogram (7 Tools)

FFT-domain display of the most recent capture, with a switchable spectrogram view.

  • spectrum_set_mode / spectrum_get_mode — switches between live spectrum and rolling spectrogram.
  • spectrum_set_noise_floor / spectrum_get_noise_floor — spectrogram floor in dBFS.
  • spectrum_set_gamma / spectrum_get_gamma — spectrogram contrast curve.
  • spectrum_read_latest — captures one hardware FFT frame and returns 1024 dBFS bins per channel

Diagnostics (2 Tools)

Tools to help read the status and config registers

  • status_read — returns datapath STATUS plus the decoded SYZYGY ADC and DAC status registers
  • config_read — returns datapath CONFIG

Example Session — Claude Code with Scripting

User: Drive a 5 MHz tone at -6 dBFS and tell me which FFT bin holds the peak and its level.

  const { binSpacingHz } = await mcp.tools.wavegen_get_sample_rate();
  const bin = Math.round(5e6 / binSpacingHz);            // 82 -> 5.005 MHz

  await mcp.tools.wavegen_reset();
  await mcp.tools.wavegen_set_vector({ slot: 0, bin, amplitudeDbfs: -6, enabled: true });

  // Loopback: DAC channel 1 is cabled to ADC channel 2
  const { ch2, binSpacingHz: adcSpacing } = await mcp.tools.spectrum_read_latest();
  let peakBin = 1, peakDb = -Infinity;
  for (let i = 1; i < ch2.length; i++) {
      if (ch2[i] > peakDb) { peakDb = ch2[i]; peakBin = i; }
  }
  return { peakBin, peakHz: peakBin * adcSpacing, peakDb };

AI: The peak is at bin 82 (5.005 MHz) at ‹measured› dBFS, which matches the requested tone to within one bin.Code language: JavaScript (javascript)

Release Notes

Release downloads are available on GitHub at: opalkelly-opensource/FFTScope Releases

FFTScope Example Design 2.1.0 (2026-11-11)

  • Add support for the XEM8320

FFTScope Example Design 2.0.0 (2026-11-02)

  • New AXI-based FFTScope architecture
  • Allow full 125MSPS sample rate for SZG-ADC-LTC2268 on the SZG-HUB1450

FFTScope Example Design 1.2.0 (2026-08-07)

  • Add MCP support

FFTScope Example Design 1.1.1 (2026-08-05)

  • New application icon
  • Built app on Frontpanel 6.1.0

FFTScope Example Design 1.1.0 (2026-04-20)

  • Add SZG-HUB1450-AU10P host board support
  • Add spectrogram mode with floor (dBFS) and contrast (gamma) adjustments
  • Gateware built with Vivado 2025.2
  • Bug fixes and general cleanup

FFTScope Example Design 1.0.0 (2026-04-14)

  • Gateware built with Vivado 2023.2
  • Initial Release