Ok, I am almost ready to begin my implementation of DFT and FFT and perform tests. At this point, I have a good handle on the math and general algorithms, and recognize that there are a few ways to approach it, not just one specified way. So, there’s a little flexibility there to let me try different routes.
First, I already have the ATMega328 set up with the SSD1306 on the board, so.. I’ll just use an ADC channel off of that and use it for input from an audio line signal and go to town on a channel of audio. Even before that, though, I’m going to simulate it with static “fake” data and compare a n^2 DFT implementation with a true n log n FFT implementation, and convince myself that the outputs are the same. I’ll suspend working with the ST7565R display until I get something going here..
My general path for the algorithm of FFT will be :
• Capture the amplitude data in a periodic window (nyquist freq * 2 [maybe 30kHz for now]) @ the update rate (maybe 15fps)
• Normalize the data.
• Split those into the odd-even butterfly containers
• Take the DFT of those, in place, as iterations proceed
• Re-order the indices with a reverse “bitmask” into input/capture order
• Take the imaginary / complex parts and flip and mirror them back over to the other side of the axis.
• And then sort (horizontally) and scale (vertically) the DFT data out to match my GUI bins
• And, then animate them on screen at my x fps
Alright, so now…. just gotta get set up to do it. Gotta get the right frame (of mind) to start this and set up some time where I won’t be disturbed (have to go to bed, go to work, go to a social outing, etc). I haven’t done anything this complicated since I implemented perspective projection or texture mapping, and I remember that being taxing 😉 . This is where I’m at right now in my journey, and it’ll be nice to have this tacked. Then, I can see about optimizations. I’ll plan some time this weekend to start.