Spectrum Analyzer FPGA IP and Web-UI

Figure 1: An overview of the system. The signal is acquired via an ADC, processed in the SoC FPGA and visualized on the PC.

This bachelor thesis (by N. Hüsser & R. Frey) realizes a system for measuring analog signals in the kilohertz to low megahertz range with a digital signal processing system in real time, offering an affordable alternative to expensive oscilloscopes and spectrum analyzers. The basic components of the system are a Red Pitaya STEMlab for signal acquisition and processing and a personal computer or mobile device for data visualization and further analysis.

To allow transmission over an Ethernet connection and to improve signal quality, the high-rate data stream coming from the STEMlab's analog-to-digital converter is decimated to a lower-rate signal using the integrated FPGA. During decimation, the signal passes through one of six filter chains to attenuate aliasing effects. The filter chains are tuned to the needs of the supervising professor, Prof. Gut, who wants to use the STEMlab for educational purposes in the field of signal processing, using audio signals. Thus the 25kHz chain was the most important one. The filter chains run on the STEMlab's FPGA. They are based on a combination of FIR and CIC filters, and decimate the incoming 125MHz signal to output frequencies between 50kHz and 25MHz, depending on the chain. They achieve an aliasing attenuation of 60dB and exhibit negligible passband droop. A signal-to-noise ratio of up to 84dB has been measured.

Figure 2: The STEMlab system, a multi-purpose measuring device with an onboard ZYNQ SoC and a 125MSps ADC.
Figure 3: The measured SNR results. For lower sampling rates, an SNR of more than 84dB was measured.

The decimated signal is transfered to the shared RAM between the FPGA and the ARM Cortex using the AXI bus, where the samples are picked up by the embedded GNU/Linux runing on the ARM core. For this process a VHDL IP core and a kernel module were developped in an earlier project. To transfer the acquired datasamples over the network, a server application running in userspace and requesting samples from the kernel module hast been written. To enable a web application to open a socket, WebSockets are required. For this purpose uWS, a small and highly performant C++17 library was used.

A newly developed oscilloscope web application allows observation of the signal from a client device. The application is based on JavaScript, allowing for easy deployment across any platform with a modern browser available. To enable fast and continuous data transmission, vanilla WebSocktes are used and Mithril manages the general UI. For plotting the measured signals, a vanilla WebGL renderer was written. The application features all common functions of an oscilloscope: It can trigger (various types) in auto or normal mode, record a single shot and force a trigger. Various transformations - raw data (no transform), frequency data (fast fourier transform) or an arbitrary third transform - can be applied to the measured data and multiple traces can be displayed simultaneously. Key propierties of each signal, such as SNR, THD, rms value, etc. are calculated automatically. To enable the correct calculation of a signal's specturm, the most common windowing functions can be applied. And, last but not least, the sampling rate can be adjusted.

All components created for this project are provided under the MIT license. A comprehensive toolchain covering filter design, FPGA tools, embedded GNU/Linux and front end development, along with documentation, allows anyone to extend and modify the system and to tailor it to their needs.

The different project parts are available on Github (Main Thesis Project, Oscilloscope Webapp).

Figure 4: The webinterface to view and process the signals measured by the hardware.