Even Faster Fourier Transforms On The Raspbery Pi Zero

Oftentimes in computing, we start doing a thing, and we’re glad we’re doing it. But then we realise, it would be much nicer if we could do it much faster. [Ricardo de Azambuja] was in just such a situation when working with the Raspberry Pi Zero, and realised that there were some techniques that could drastically speed up Fast Fourier Transforms (FFT) on the platform. Thus, he got to work.

The trick is using the Raspberry Pi Zero’s GPU to handle the FFTs instead of the CPU itself. This netted Ricardo a 7x speed upgrade for 1-dimensional FFTs, and a 2x speed upgrade for 2-dimensional operations.

The idea was cribbed from work we featured many years ago, which provided a similar speed up to the very first Raspberry Pi. Given the Pi Zero uses the same SoC as the original Raspberry Pi but at a higher clock rate, this makes perfect sense. However, in this case, [Ricardo] implemented the code in Python instead of C as suits his use case.

[Ricardo] uses the code with his Maple Syrup Pi Camera project, which pairs a Coral USB machine learning accelerator with a Pi Zero and a camera to achieve tasks such as automatic licence plate recognition or facemask detection. Fun!

7 thoughts on “Even Faster Fourier Transforms On The Raspbery Pi Zero

  1. Nice work. The RPi zero GPU is very powerful for it’s price point. It’s an excellent platform for an HMI that runs very fast and smooth. I hope one day the foundation will start selling the chips for us to make our own boards. Getting it down to one PCB will make for some very nice little projects. Would love to see the RPi Zero chip with the 2040 added in a new silicon. Will be better than the i.MX6 ULL chips I have worked with.

    1. Unlike the 2040, the BCM2835 SoC is Broadcom IP. You could theoretically buy it from Broadcom, but i doubt the Foundation is authorized to sell bare BCM2835 chips. They are also not trivial to use or design a board for, since they were designed for use in phones and appliance controllers.

      Using them bare is challenging enough that the minor added effort of desoldering them from a donor Pi does not noticeably complicate the project. If the desoldering sounds ‘hard’, working with the bare chip is probably infeasible at that skill level.

      1. They have some sort of non-compete deal with the foundation, HardKernel somehow managed to buy some but only for one production run before it got lawyered out of existence. (still have the board floating around somewhere)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.