FFT and Propeller
Tristor
Posts: 2
I'm designing a device to convert an electric guitar's output into serial scan codes for a synthesizer unit I have. In order to do this I need to do a fast fourier transform in real time to calculate the peak frequency and pass that to a function that determines which code to send based on that frequency. I'm wondering if the Propeller is able to FFTs in real time, if not I am planning on using the Texas Instruments TMS320C6410 DSP to do the FFT and passing that information to a Propeller to do the other function. I'm new to embedded design and programming though, so I'm not sure if the Propeller is capable of doing what I would like. Any advice would be appreciated.
Thanks in advance
EDIT:
I was also thinking about how the way the Propeller is designed each of the 8 cogs has its own independent processor and video unit. If I could use the Propeller to do everything, I'm wondering if the FFT algorithm could be parallelized enough to run across all 8 processor cores for a speed increase. If I use the DSP instead (which I'm thinking I'll probably have to) I was wondering if I could individually control each cog, as I'd like to have a few used for doing video output and one for serial/usb output for debugging purposes.
Post Edited (Tristor) : 2/19/2007 12:06:55 AM GMT
Thanks in advance
EDIT:
I was also thinking about how the way the Propeller is designed each of the 8 cogs has its own independent processor and video unit. If I could use the Propeller to do everything, I'm wondering if the FFT algorithm could be parallelized enough to run across all 8 processor cores for a speed increase. If I use the DSP instead (which I'm thinking I'll probably have to) I was wondering if I could individually control each cog, as I'd like to have a few used for doing video output and one for serial/usb output for debugging purposes.
Post Edited (Tristor) : 2/19/2007 12:06:55 AM GMT
Comments
And that's assuming it would work; I don't think a propeller has very high ADC precision at 40kHz, and I think you'd run out of memory mighty fast unless your sample length was so short as to be useless. I'd like someone with more FFT experience to back me up on that, though.
Yup!
shows a spin implimentation of a FFT. It's rather slow though. Changing to integer math and assembly should allow it to run far faster.
http://en.wikipedia.org/wiki/Fast_Fourier_transform <= this should give a lot of places to look for further info.
http://www.google.com/search?hl=en&q=FFT&btnG=Google+Search <= searching on Google for "FFT" also turns up lots of info, some of the sites even look like they have C-source avalable to pour through.
Have Fun,
Marty
http://forums.parallax.com/showthread.php?p=572721 <- discussion
http://forums.parallax.com/showthread.php?p=615024 <- working spin code, 160 milliseconds for 64 points
http://forums.parallax.com/showthread.php?p=609439 <-CORDIC idea
http://forums.parallax.com/showthread.php?p=592470 <- time estimate 30ms for 1024 point fft
The Propeller does not have a hardware multiplier, and the access to memory as an array may be limiting. Howerver, Propeller ASM is well suited for integer algorithms such as CORDIC. I don't think it could get up to audio frequencies in real time unless you use some tricks. For example, If you can keep the number of samples down, for example, by looking at the times between zero crossings instead of the entire array of analog samples. That might work for a signal with a strong fundamental. I don't have any specific code to offer you, but I'm interested in the subject too.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 2/19/2007 5:31:22 PM GMT
This gadgets use a 300MHz Mips processor with FPU and 512k fast RAM.
Not to mention the 24bit audio ADC's.
I don't think that a propeller is really a good choice for this.
The propeller is shurely a nice part that can toggle it's pins very fast,
but it is not really suitable for complex signal processing.
It is one thing to analyze the complexity of a sound with all its harmonic richness, and another to extract the fundamental frequency of a single instrument. Cheap guitar tuners manage to do that without having a DSP. I do wonder if the full-fledged DSP might not be overkill for your application?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com