Test for my discrete Fourier/Hartley-like transform algorithm
I'm working on an Arduino project which needs to get accelerometer data and find the peaks in the frequency spectrum.
However, the Arduino Uno only has 2048 bytes of SRAM, which is pretty much nothing.
The usual libraries for spectrum analysis use the Fast Hartley Transform, which runs on at most 256 16-bit samples. You need to store them in an array, window, transform then read the results. In total, the damn thing eats up about half of the memory available, and it's super slow considering data keeps pouring in.
This also sucks because that'd mean I could only detect frequencies up to half of the sampling rate. Half of the transform is just redundant, as it is
I needed something faster that can run on any range of frequencies I want and that used less memory. So I came up with some dumb, kinda naive algorithm to do it. It worked really well!
I might write about this later on. Lots of ideas for ways to refine it.
----
This was the result of a prototype, made in Python, of the algorithm running over a sound file, the last few notes of "Magnetic Rag" by Scott Joplin, as played by Alessandra Celletti.
The results compare very well with the abs value of the FFT of the same data, although my algorithm works different than the usual FFT.