## FFT proof of concept

Moderators: lily.li, violet, jeremy882, crail.lyu969

Paulvvz
Pre-kindergarten
Posts: 18
Joined: Fri Jan 07, 2011 3:14 am

### Re: FFT proof of concept

The assember routines from Embedded Signals are available for different compilers (Keil, IAR, GCC). The attached zipfile contains them all. The second letter (k, i or g) of the filename determines the compiler (Keil, IAR, GCC).
Attachments
FFT128real32.zip

Eli
Pre-kindergarten
Posts: 3
Joined: Fri Mar 25, 2011 5:14 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: DSO nano V2

### Re: FFT proof of concept

Hi Paulvvz,

your FFT is really fantastic. I've made some measurements at my highschool with a frequency generator and the results of your FFT-ROutine were very exactly.
I only had the Problem, that only signals in the area of 2kHz to 60 kHz were able to be measured right. The result for sinuswaves with lower of higher Frequency were that they also should have a peakfrequency at the area of 2 kHz to 60 kHz.
Do you know where the Problem could be? I gave pure SInuswaves with Frequency from 5 Hz to about 500 kHz as an input, but only got a peakfrequency at the kHz-area.
Thank you very much.

Eli

Paulvvz
Pre-kindergarten
Posts: 18
Joined: Fri Jan 07, 2011 3:14 am

### Re: FFT proof of concept

Hi Eli,
a FFT algorithm computes the frequencies of the samples depending on the sample frequency. By changing the TD (time per division), the max frequency of the FFT changes. Try changing the TD to higher sample frequency.
The inherent nature of FFT algorithms is that frequencies above the Nyquist frequency (sample frequency divided by two) will be displayed as a lower frequency. That is the reason that ideally a low-pass filter should be used with a filter-frequency equal to the Nyquist freq.

wlacerda
Pre-kindergarten
Posts: 1
Joined: Wed Jan 11, 2012 4:46 am
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: DSO Nano

### Re: FFT proof of concept

Hello, I tested the firmware that implements the FFT by Paulvvz and I was really impressed. In order to allow inclusion, in future versions, of the FFT calculus using open code, I used the libraries of DSP from ST and the work done by Benf and Paulvvz to also implement an FFT aplication. So, I am posting the code and firmware here. This FFT can operate with 64, 256 or 1024 points. The graph of the frequency is superimposed on the temporal graph, but using a different color. IAR 5.4 was used in the compilation.

Paulvvz
Pre-kindergarten
Posts: 18
Joined: Fri Jan 07, 2011 3:14 am

### Re: FFT proof of concept

Hi wlacerda,
Nice work! Superimposing the FFT with yellow is very well done. This FFT really works great!
Some suggestions for improvement:
- the frequency at the bottom left (nicely in yellow) always displays Hz, but can be also KHz;
- the FFT amplitude varies with input amplitude. Can the value be displayed relative in dB?

And now we wait for someone to integrate this in the latest version or someone who writes a boot-laoder that let the user choose which application to boot. That would be really awesome.
Paul
Last edited by Paulvvz on Wed Mar 07, 2012 2:37 am, edited 1 time in total.

fatihinanc
Pre-kindergarten
Posts: 1
Joined: Sun Feb 26, 2012 8:48 pm
Are you a staff member of seeedstudio?: yes

### Re: FFT proof of concept

Hello,

This FFT Code is really impressive. I've tested it. But avaliable APP version is 3.11.
Is there any way to porting BenF v3.64 ?

Thanks.

tsiros
Pre-kindergarten
Posts: 1
Joined: Fri Apr 06, 2012 8:02 pm
Are you a staff member of seeedstudio?: no
Which products/projects are your favorite?: DSO nano v1

### Re: FFT proof of concept

just wanted to say you guys are awesome.

next up, tetris.

tormod
Elementary-2
Posts: 271
Joined: Mon Oct 18, 2010 1:18 am

### Re: FFT proof of concept

Paulvvz wrote:And now we wait for someone to integrate this in the latest version or someone who writes a boot-laoder that let the user choose which application to boot. That would be really awesome.
Paul

I finally got to integrate the free FFT stuff into my git tree (which had the open-source 3.11 + my "infrastructure" fixes to build with gcc and IAR4/5 from common code but not much new features). For now it is in a separate fft-relocated branch at https://gitorious.org/dsonano/dso-firmware . I also intend to merge the later released open-source 3.13 code, which will simplify code relocation (more on that later). I have not pushed it to my master branch yet, awaiting some rebasing to make the merges cleaner.

I think I will post more on the boot-loader work in a new thread, but using it for dual-booting Benf and the free FFT version seemed like a good demonstration of it. The boot loader is work in progress and the implementation here to select BenF/FFT is just a hack. Instructions are in the zip-file.

I hope this can encourage more development on the DSO Nano!

Note: This only works with the old USB bootloader, not the new "HEX" file-based bootloader firmware.
Last edited by tormod on Tue Aug 07, 2012 1:49 am, edited 1 time in total.

Paulvvz
Pre-kindergarten
Posts: 18
Joined: Fri Jan 07, 2011 3:14 am

### Re: FFT proof of concept

Hi Tormod,
Great work! This is really a very nice big step for further improvements/extensions. Thanks!
Paul