Arduino and FFT
Moderator: phalanx
Re: FFT code
Hi
What compiler do you use to compile it?
I cannot get it to work in arduino ide.
Please explain.
Thank you
What compiler do you use to compile it?
I cannot get it to work in arduino ide.
Please explain.
Thank you
It would be good to change this code that is now in the timer interrupt service routine:
to run in the main() code. It's unwise/risky to do library calls like (printf, etc) and do extensive function calls from an ISR - due to reentrancy. Indeed, the butterfly FFT calcs are called from the ISR.
Code: Select all
SIGNAL(SIG_OVERFLOW0) {
...
fft_input(capture, bfly_buff);
fft_execute(bfly_buff);
fft_output(bfly_buff, spektrum);
print_FFT(spektrum, NUM_SAMPLES/2);
Re: fft
I used AVR Studio.iq66 wrote:how did you get the code to compile?
what type of cable do you use for it?
thanx
What cable are you referring to?
If it is the prgramming cable, I used Atmel AVR ISP MkII on the 6-pin Arduino ISP connector.
fft
Hi I compiled the code with AVR studio but it gave me 3 compile error. However, they are included in "ffft.h" header file.
fft_input(capture, bfly_buff);
fft_execute(bfly_buff);
fft_output(bfly_buff, spectrum);
How do I get the fundamental frequency from the fft code? I basically need to see the output on the serial terminal. I do not have an lcd display.
Thanx.[/quote]
fft_input(capture, bfly_buff);
fft_execute(bfly_buff);
fft_output(bfly_buff, spectrum);
How do I get the fundamental frequency from the fft code? I basically need to see the output on the serial terminal. I do not have an lcd display.
Thanx.[/quote]
Re: fft
[/quote]iq66 wrote:Hi I compiled the code with AVR studio but it gave me 3 compile error. However, they are included in "ffft.h" header file.
fft_input(capture, bfly_buff);
fft_execute(bfly_buff);
fft_output(bfly_buff, spectrum);
How do I get the fundamental frequency from the fft code? I basically need to see the output on the serial terminal. I do not have an lcd display.
Thanx.
Maybe you forgot to include the FFFT.S file?
An FFT could be quite useful for other things. There was an attempt about 5 years back to directly decode WWVB on a microcontroller (60KHz time standard in the US), which wasn't entirely successful...but the person didn't really indicate why or even what one he/she was using. There is a 75KHz similar operation in europe.
Id imagine you'd connect the ADC to a loop antenna (perhaps with an op amp on the front end, optional crystal filter if WWVB doesnt come in strong in your location), mix in a PWM near its frequency to get it low in the baseband, and decode it with a low frequency bucket, there might be some success possible.
Its just some 1 bps signal where they cut the power 17dB (ASK) to indicate the type of bit. 17dB should show up with even the crudest of FFT resolutions.
It would be really cool with some wound wire on the ADC line though wouldn't it? you could practically build in a RTC into anything for almost zero cost. You wouldn't really need to run it much either to make use of one of the many arduino software RTC's. Sync when you need to.
Id imagine you'd connect the ADC to a loop antenna (perhaps with an op amp on the front end, optional crystal filter if WWVB doesnt come in strong in your location), mix in a PWM near its frequency to get it low in the baseband, and decode it with a low frequency bucket, there might be some success possible.
Its just some 1 bps signal where they cut the power 17dB (ASK) to indicate the type of bit. 17dB should show up with even the crudest of FFT resolutions.
It would be really cool with some wound wire on the ADC line though wouldn't it? you could practically build in a RTC into anything for almost zero cost. You wouldn't really need to run it much either to make use of one of the many arduino software RTC's. Sync when you need to.
-
- Posts: 1
- Joined: Sun Sep 18, 2016 4:25 pm
Re: Arduino and FFT
Just in case anyone else is looking for FFT code, I did some benchmarking tests of FFT on different flavors of Arduino, and on a Teensy. My write-up below shows the relative speeds of the different boards. It also has a link to my GitHub for the FFT and benchmarking code:
https://openaudio.blogspot.com/2016/09/ ... speed.html
My results show that the Arduino Uno is, predictably, very very slow in doing FFTs. The Teensy (especially the new K66-based Teensy 3.6) is way better for such computational tasks.
Chip
https://openaudio.blogspot.com/2016/09/ ... speed.html
My results show that the Arduino Uno is, predictably, very very slow in doing FFTs. The Teensy (especially the new K66-based Teensy 3.6) is way better for such computational tasks.
Chip