LimeSDR Mini FPGA-Accelerated Real-Time Spectrogram

"I plan to implement the spectrogram accelerator on a LimeNET Micro and distribute it via LimeNET Store," says developer Gaspar Karm of his effort to implement a hardware-accelerated spectrogram on the LimeSDR family's field-programmable gate array (FPGA) chip.

The LimeSDR family of software defined radios is famous for its flexible, powerful Lime Microsystems LMS7002M field-programmable radio-frequency (FPRF) chip, but that isn’t the only impressive component in its design: each board also features a field-programmable gate array (FPGA), a user-configurable chip which arrives pre-loaded with gateware to support the LimeSDR’s standard functions. That pre-loaded functionality, though, can be changed, and with the gateware being made available under an open-source licence one user has been doing exactly that to add new hardware-accelerated functionality to the boards.

Nuand BladeRF

“I was introduced to SDRs in a university course some years ago,” developer Gaspar Karm explains. “Back then we used the BladeRF board, which features the [Lime Microsystems] LMS6002D chip. It was a practical course, where one of the task was to implement a bandpass filter in the FPGA. It turned out to be not that hard, which gave me confidence to try other stuff as-well.

“The LimeSDR was a logical step up from BladeRF,” Karm continues. “I was mostly excited about the increased bandwidth. The LimeSDR Mini is especially interesting for me, as I don’t use the [LimeSDR USB’s] MIMO [multiple-input multiple-output] features yet.”

Hardware Acceleration

Having previously proven the concept of taking the FPGA on a software defined radio and co-opting it for his own use, Karm turned his focus to solving a real-world problem he had encountered. “I had a need for a spectrogram accelerator,” he explains. “The first thing I tried was the GPU [host PC graphics processing unit], which worked, but I ran into problems when i wanted to accelerate a neural network on the same GPU.” The FPGA, it turned out, was the obvious solution: offloading the work of spectrogram acceleration from the host PC’s GPU, leaving it free to work on neural network tasks, without overloading its general-purpose CPU.

LimeSDR USB, LimeSDR Mini Side-by-Side Comparison

Having the FPGA hardware present and modifying it to run your own programs without losing functionality is a challenge, though, given that may of the FPGA’s resources are given over to running LimeSDR functions already. “The FPGA of LimeSDR Mini was already quite packed,” Karm explains, “so the first step was to throw out everything I didn’t need – e.g. anything related to TX. Doing that, I got the utilisation down to ~25%.

“Next, I implemented the DSP [digital signal processing] blocks: DC removal – Gets rid of the centre peak on the spectrogram; Windowing and 8192-point FFT [fast Fourier transform] – Core blocks for the spectrogram; Average pooling – Applies an averaging window to the spectrogram, which reduces the noise and decimates the data-rate, enabling monitoring of 80 MHz of bandwidth with a data rate of only 2.5 MB/s. In addition, it saves a lot of FPGA resources – which kind of made it all possible.

Gaspar Karm's Spectrogram Accelerator Flow Diagram

“I also implemented a driver based on SoapySDR-Remote and a GUI to display FFT frames in real-time. The result of all this is that you can run the driver on an Arm board and stream 80 MHz of bandwidth into your remote computer, where you can plot it in real-time.”

“Drastically Reduced” Data Rate

The result is a spectrogram which runs smoothly even on low-end systems, including embedded hardware. “The major benefit [of the project] is that a lot of compute is offloaded to the FPGA, but I think even more important than that is that the data rate from the FPGA to host is drastically reduced,” Karm explains, “[which is] especially useful on Arm boards which can really accept only a few MB/s.”

Gaspar Karm's Spectrogram, Wi-Fi Signal

Karm credits the LimeSDR’s open source nature, under which everything from the hardware schematics to the driver source code is made available for modification, as being key to the success of his project. This extends also to the LimeNET Micro platform, which combines the capabilities of a LimeSDR software defined radio with a Raspberry Pi Compute Module 3 general-purpose processing platform to create a single-board all-in-one system.

“I plan to implement the spectrogram accelerator on a LimeNET Micro and distribute it via the LimeNET Store,” Karm explains, referring to the application distribution system developed by Lime Microsystems in partnership with Canonical. “Also, I have some ideas on how to further decrease the data rate to the host.”

Karm’s spectrogram accelerator can be found on his GitHub repository, along with a modified gateware which adds a DC removal filter to the FPGA.

See also: