I have started writing a voice recorder application in a similar style to my Oscilloscope app.
It uses the Digilent Microphone Pmod.
I am reading samples from the microphone into 16kb of BRAM (that is, all of it).
I am sampling at about 6k per second to get about 2.7 seconds of audio.
I then send it to the STM32 and play it through the Gameduino speaker, and do a Fast Fourier Transform on it and display the spectogram on the Gameduino screen.
The microphone takes 12-bit samples in 16-bit SPI reads. The Gameduino only plays 8-bit samples. So I am currently chopping the samples down to 8 bits.
I am not very sure about the accuracy of my spectrogram. Also there is quite a bit of noise. I am not sure what the source of that is - perhaps it is the low-frequency sampling. Perhaps I need a low-pass filter.
I am not sure how best to make the app work. Currently it takes a sample and sends it to the STM32 of a regular timer.
Perhaps I should have a button to press and then take the sample and write it to the SD card. To get a bigger sample, I could using the SRAM, but there is limited RAM on the STM32.
I will probably try to get streaming to a Gameduino SD card working. Or I could use the myStorm SD card reader either from the STM32 or the Ice40. So many options.
To get better audio quality I could send the data back to the Ice40 and use my i2s Pmod for output.
I would like to create a guitar tuner app using the same set-up, but I will need more accurate spectrum analysis.
Here is the current Arduino code:
And the Verilog: