Redboard Artemis Fast sampling and FFT

Hello SparkFun community,

I like to believe that many of you have struggled with the same issue as I have:
How do you achieve the impressive sampling rates on the Apollo3?
And how can you perform an FFT on the captured data?

Well, you’re in luck. I’ve developed an ADC library and an FFT library specifically for the Redboard Artemis. These libraries allow you to sample at rates of up to:

  • 2.4 MSPS at 8-bit
  • 2.0 MSPS at 10-bit
  • 1.5 MSPS at 12-bit
  • 1.2 MSPS at 14-bit

You can even take advantage of the onboard hardware-accelerated oversampling feature, which helps improve the signal-to-noise ratio (SNR). The library uses the M4 cores DSP instructions, making the compute time minimal, in fact the FFT uses more time on LUT and interpolation than on complex calculations.

All you need to do is clone the linked git repo.

To visualize the data, i have also created a simple python code that will recieve that FFT data and plot it, simple as that.

The following is a figure of a sampled AM modulated signal.

This was performed on a 10 kHz carrier signal with a 1 kHz AM modulation at 2.5% depth.
The sample rate was 1.2 MSPS, with 16× oversampling and 14-bit ADC precision mode.
The window used here is Flat-Top, and the FFT size was 4096 points.

Below is an example of a 300 kHz sine wave at 2 Vpp.


Here, the sample rate is again 1.2 MSPS at 14-bit resolution with no oversampling, using a 4096-point FFT and a Blackman-Harris window.

Make sure to use proper timer-based sampling with the FFT library; otherwise, you may observe incorrect phase noise or unintended FM modulation on the sampled signals.

1 Like

This is awesome!!!

Thank you for sharing your hard work :slight_smile:

I don’t see the FFT code in the library (in particular, there seems to be no #include file named Laymans_FFT.h).

You are completly right, i have added the DMA files instead of the FFT files, this should be fixed now. Make sure to use the latest driver for the redboard, as the setup for memory might not work in older version with regards to the DMA.