I'm doing the first steps and so I apologize for the childish questions))
There is a periodic signal. What are the close values of frequencies of the signal will be optimal for the algorithm?
How to set the size of the sample ?
I don't understand your questions. Signal shown on the picture doesn't need an fft, regular digital counter 'd be sufficient to determine F. Plz, start another thread if you don't know how, as it not related to fft at all.
Magician:
I don't understand your questions. Signal shown on the picture doesn't need an fft, regular digital counter 'd be sufficient to determine F. Plz, start another thread if you don't know how, as it not related to fft at all.
It is a signal from the receive coil of the metaldetector.
I want to try to decompose the signal from the target using fft, to accumulate data from multiple samples , and to process the obtained data.
This should improve the quality of recognition of the material type and purpose.
sorry, I'm missing the link for the FFT lib for Due in between those many posts -
can anybody please provide a download link (e.g., on githib or where ever)?
ArthurD:
sorry, I'm missing the link for the FFT lib for Due in between those many posts -
can anybody please provide a download link (e.g., on githib or where ever)?
I've been with arduino nearly since the begining. (had a Parallax Basic Stamp as my first MCU, then the Propeller (wow) and then bought a MEGA2560ADK (official). And over the last few years I've gotten a YUN, HUZZAH ESP8266, a few mini's and now a DUE last week. Been on the forums for a few years learning C && C++ fun.
Forgive my ignorance on the subject. So the FFT_SIZE is 2x the number of "bands" available and the analog sample rate is 2x the nyquist sample rate? Does it matter if I configure it for say 16 or 32 or 512 FFT size and audio rates?
I've little background in algebra and dont know calculus so sorry for that. Tried to read a book on FFT and howto implement it in a digital sense but found it hard to follow the calculus (frustrating having only some AEES studies sometimes)
If i can get this to compile and want to display maybe 7 bins/bands for starters on my TFT, I just leave the FFT library as standard in Magicians library demo and just pick every 146 bin for display (1024 / 7 = 146)?
I found this elsewhere rinkrides hope this helps you out.
johnwasser:
The results of the FFT will be a list of amplitudes at a set of frequencies. The frequency of each sample depends on the sample frequency.
For each 'bin' N the frequency is N * Sample_Rate / FFT_Size
Your sample rate is whatever the free-runing rate of the ADC is. I don't remember offhand. It should be in the datasheet. Let's call it 70 KHz.
Your FFT_Size is 256.
Bin 0 frequency = 0 * 70,000/256 = 0 (DC offset)
Bin 1 frequency = 1 * 70,000/256 = 273.43 Hz (this will also be the step size in your frequency)
Bin 2 frequency = 2 * 70,000/256 = 546.875
Bin 3 frequency = 3 * 70,000/256 = 820.3125
...
Bin 127 frequency = 127 * 70,000/256 = 34,726.56
The top frequency is half the sample rate.
The sample step size is the sample rate divided by the the sample size.
And now i have a question myself. I understand what i am getting. but I do not understand the operation. When ever i try to take the array (magnitude) and try to do some processing on it, it just stops working and no further process happens. ... it even prints half of the message out of my Serial.println. I spent a good 4 days fiddling with this stuff between google and the program. Cant really get it to work.
HEREs what i know for sure... I have no idea how the example code works. so i do not know when it gets samples in data (altho i have an idea when) and where it starts to process that data. I would like to take that data and crunch some data out to make some light flash in different locations based on frequency. Thanks in advance
Don't know if there original problem was already solved. I've tried several options, including FFT/FHT from Open Music Lab, fix_fft and Radix_4. However, I found the library not easily readable for beginners. So I wrote my own version FFT with the basic Cooley-Turkey algorithm.
I didn't put the .ino file in GitHub, but if someone needs it, I can send it to you.
Hope it helps the beginners.
Hi, thanks for sharing your FFT solution, I have previously looked at the Radix-4 FFT solution posted on the no longer existent coolarduino.wordpress.com site, I am interested in looking at yours also, would you mind sharing the .ino with me please?
I wonder if you use interrupts or how you read the signal and use the functions provided.