I have made a proof of concept for adding FFT (spectral analysis) to the DSO Nano. The code is based on version 3.11 (the latest open source code).
The change is limited to the file “function.c”, where three functions are added. Furthermore, I have used assembler routines from the company Embedded Signals (see embeddedsignals.com).
The code calculates a 128 elements FFT, resulting in displaying 64 requency bins.
More work has to be done to make this a full feature on the DSO Nano, e.g.:
- switch FFT mode on/off (now FTT is always displayed in the left side of the screen);
- switch vertical scale to linear/log scale (now a log scale is used);
- use horizontal cursor to display frequency/amplitude of FFT;
- add peak-hold function;
- increase number of bins (probably some memory overlay is needed to free memory).
Enjoy this prototype! Everyone is welcome to improve this code, possibly ending up in some future BenF version.
Files included in the zipfile:
Ei_FFT128Real32b.s (function FFT128Real_32b)
Ei_log2.s (function log2_16q16)
Function.c (modified for FFT)
APP.dfu & LIB.dfu (executable)
FFT.zip (41.6 KB)