I was recently reading an article on signal processing and embedded systems (Linux Magazine France n°149, p32-50 (http://http://diamond.izibookstore.com/produit/53/9786000048532/GNULinux%20Magazine%20n149%20%20Migrez%20votre%20systeme%20de%20fichiers%20vers%20Btrfs%20!), sorry, nice magazine browsing with page flipping, but in French only!). Stated shortly, the article first provides some concepts on Fourier analysis before implementing a fixed point FFT on an STM32 microcontroller and applying it to a continuous Wave (CW) RADAR system.
This article is making reference to Maxim's AN3722 "
Developing FFT Applications with Low-Power Microcontrollers" that turned very difficult to find, as Maxim apparently wiped it from its servers!
After some time googling around for it, I eventually found it as a 2005 design article (http://http://www.eetimes.com/design/embedded/4025598/Develop-FFT-apps-on-low-power-MCUs) in EETimes, later included in Maxim's EngineeringJournal #57 (http://http://pdfserv.maxim-ic.com/en/ej/EJ57.pdf) pp. 9-13. There is a corresponding "3722Firmware.zip" file that is also quite difficult to locate, but is eventually still hidden somewhere at Maxim's here (http://http://www.maxim-ic.com/images/appnotes/3722/3722Firmware.zip)!
Originally written for the MAXQ CPU, it can be ported easily to other CPUs, as it is written in pure C.
This is really great stuff if you want to do real-time FFT on a microcontroller.
On the same subject, a recent (October 2011) Application Note from NXP (AN11115 with source code (http://http://www.nxp.com/documents/software/AN11115.zip)) is using similar technique to perform a quite impressive real-time FFT on audio over an USB device link on a small Cortex-M0 LPC11U14 CPU:
[attachment=0]
i have tried similar on an 8051, actually had surprising results, but limited to about 50khz, even at 100 mips.
are you going to develop hardware for this?
Well, yes, check the USBug LPC1343 Development Board (http://http://dangerousprototypes.com/forum/viewtopic.php?f=19&t=4064) thread... More info on my corresponding Gitub page (http://http://squonk42.github.com/USBug/). I am sending free bare PCB for the postage cost, let me know by PM if you are interested.
As of today, I have mounted 3 boards:
- 1 x LPC11U24 (Cortex-M0, 50 MHz, 32 KB Flash)
- 1 x LPC1343 (Cortex-M3, 72 MHz, 32 KB Flash)
- 1 x LPC1347 (Cortex-M3, 72 MHz, 64 KB Flash)
All these CPUs are pin-to-pin compatible (not software-compatible, though!).
As for speed, the AN11115 claims 32 16-bit PCM audio ksps, 1 FFT operation of 64 samples performed every 64 ms, the 64 points FFT result (8-bit data) is sent back @ 1 kSPS/s on 115200 bps VCOM, all this on a 50 MHz LPC11U14.
ChaN fixed-point library for MegaAVR (http://http://elm-chan.org/works/akilcd/report_e.html) @ 16 MHz performs a 16-bit x 64 points FFT @ measured 19 ksps, 128 points @17.5 ksps, 256 points @ 16.1 ksps, and 512 points @ 14.9 ksps. For example, it is used in the XProtoLab (http://http://www.gabotronics.com/development-boards/xmega-xprotolab.htm).
So yes, I agree with you: these microcontroller-based FFT are good for audio, but if you want a better throughput (up to some 100s Msps), an FPGA is the only way to go.
i have a few samples of the dspic33 in dip packages, i am interested in building audio filter/dsp with them for my desktop mic. however this is going to be a long ways away as i have no experience with dspic.
i have another project in the works using an m4 that would be a good host for FFT and other dsp operations.
as far as the 8051 goes, some have multiply and accumulate engines and implementing in sdcc requires some assembly routines to use. however i sure i could push it harder if i utilized the MAC.
You shouldn't be too afraid of using non-DIP packages: with just a few minutes of practice on sacrificed chips, you should become an expert in SMD soldering... Just check Davind Jone's tutorial (http://http://www.eevblog.com/2011/07/18/eevblog-186-soldering-tutorial-part-3-surface-mount/).
Even for prototyping, you can get cheap adapter boards to use SMD chips on breadboards. The big advantage is that you have then a much larger choice of usable chips.
The problem with DSPs is that each one is different. I mean, REALLY different: not at all the same architecture (beside the MAC), so you cannot port one DSP program to another DSP, and if it leverages the burden on math computation, then the problem is with registers banks, memory access, etc.
This is why I stopped investing useless time in them, and moved directly to FPGAs: standard language (Verilog or VHDL), much more flexible, faster... Get an Open Bench Logic Sniffer (http://http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer) or even better, a Papilio board (http://http://papilio.cc/) and dive into it, you won't regret it! As for the particular field of signal processing on FPGA, I strongly recommend the reference book "Digital Signal Processing with Field Programmable Gate Arrays (http://http://www.amazon.com/Digital-Processing-Programmable-Communication-Technology/dp/3540726128/ref=dp_ob_title_bk)" by Uwe Meyer-Baese: a must-read!
Maybe the M4 will help to get a de facto standard for DSPs that will be widely used... We will see!
[quote author="Squonk"]You shouldn't be too afraid of using non-DIP packages: with just a few minutes of practice on sacrificed chips, you should become an expert in SMD soldering... Just check Davind Jone's tutorial.[/quote]
soldering smd is not a problem, i just happen to like to use breadboards and dips can be used for realy quick and dirty prototypes/hacks.
[quote author="Squonk"]The problem with DSPs is that each one is different. I mean, REALLY different: not at all the same architecture (beside the MAC), so you cannot port one DSP program to another DSP, and if it leverages the burden on math computation, then the problem is with registers banks, memory access, etc.[/quote]
agreed, exploring the different arch available for dsp including non dsp chips has been fun and helped me to better understand signal processing overall.
ill see if i cant find that book somewhere.
[quote author="sqkybeaver"]ill see if i cant find that book somewhere.[/quote]
Yes, this book is really worth its price: it is full of signal processing algorithms and implementations on FPGA (but with easy translation into whatever you want, since the algorithms are explained).
Be careful, there are 3 editions, last one is from 2007 (ISBN 3540726128), and it exists both in soft and hard cover.
A cheap way to get it is through Abebooks (http://http://www.abebooks.com/servlet/SearchResults?sts=t&tn=Digital+Signal+Processing+with+Field+Programmable+Gate+Arrays), both used and new. But again, be careful with cheap phototcopies from India!