I'm in the early stages of design a project I'm working on for fun - a radar speed detector using a simple Doppler radar module and an Arduino (or possibly another similar microcontroller).
I've gotten the analog side working - displaying a good signal when connected to an oscilloscope and audible when attached to an audio amplifier + speaker (and I've found a plethora of resources on where to improve if my current design on the radar/amplifier side doesn't work well enough). However, I've found much less information on how best to sample this sort of signal with a microcontroller.
I'm looking for a sampling frequency of at least 40 kHz, so I figured looking into audio sampling using microcontrollers would give me a good baseline, and have much more resources available. Most of what I've found has been focused on taking qualitative measurements (measuring an audio spectrum for a spectrum visualizer, for example, where you don't care about the actual frequencies, just the frequency bins, so the sampling frequency doesn't have to be well-defined). I don't need this data to be real-time, and I don't think # of samples/memory available will be an issue.
So far, these two methods from the audio-processing world look promising:
I'd set up a timer to produce an interrupt on a certain interval, and fill up a buffer with each new ADC sampled value at each interrupt. Once the buffer was full, I'd process the data.
I'd need to get either a microcontroller with a built in I2S ADC (Apparently the ESP32 is able to use it's I2S interface with it's own ADC like this? I'm not finding much documentation for this from Espressif themselves) or an external ADC that can talk to the microcontroller over I2S. This would removing the burden of timing the ADC sampling from the microcontroller.
Let me know if there's anything simpler or more effective I can do with regard to ADC sampling at a constant rate, and if the options I've detailed might work.