chipKIT® Development Platform

Inspired by Arduino™

chipkit32 FFTs

Created Thu, 02 Feb 2012 04:38:20 +0000 by cubicfeat


cubicfeat

Thu, 02 Feb 2012 04:38:20 +0000

Hi there

Is it possible to access the FFT routines from the pic32 DSP library? I was poking around in MPLAB and it looks like they have them coded in assembly in some libdsp.a libraries. The only other post on this forum regarding this specifically mentions that the DSP libraries are not packaged with the MPIDE compiler , but i'm wondering if it would be possible to get these to work if I brought them over myself.

I'm specifically referring to the libdsp.a and libdsp.h files (if that's the correct file names, I don't have it in front of me currently). Is this possible, or am I out to lunch on this one?

EDIT : More specifically, I want to use these libraries from within MPIDE. Is this possible, and if so, would it involve anything more than just copying those 2 files over so the compiler can see them?

thanks


radiosky

Sun, 06 May 2012 23:54:26 +0000

Wish someone who could answer your post would reply. I would like to know the answer to your questions also. It seems to me that the MPIDE would be greatly enhanced by some way to call in line assembler routines or libraries. Or is there a way and I just don't know it?


xray_drifter

Tue, 08 May 2012 13:10:30 +0000

I am not sure what other features contains in the dsp library, but have you tried fix_fft? That seems to work for me if you are only interested in doing FFT/IFFT.


NMC

Thu, 08 Nov 2012 12:54:57 +0000

I'm also very interested in a DSP lib for Cerebot MX7cK, I've tried the fix_fft function posted but the results were not as I expected...

Does anyone know at least a nice FFT algoritm to implement in my project? thanks


pito

Wed, 14 Nov 2012 17:50:31 +0000

Does anyone know at least a nice FFT algoritm to implement in my project?

There is only one algorithm for FFT - the FFT algorithm ;) The pic32 does not include any DSP or something similar afaik, you may use ie. dspic33 - there are libs for FFT available and the chip is prepared for such stuff. Works nice.. p.


snovich

Wed, 14 Nov 2012 20:28:03 +0000

I'm also very interested in a DSP lib for Cerebot MX7cK, I've tried the fix_fft function posted but the results were not as I expected... Does anyone know at least a nice FFT algoritm to implement in my project? thanks

There's a few things floating around, that aren't directly made for the chipkit/pic, but should work (or are easily ported): 1 - KissFFT: http://sourceforge.net/projects/kissfft/ 2 - FFT/FHT from Open Music Labs: http://wiki.openmusiclabs.com/ 3 - Depending on the size of the FFT/DFT you're trying to implement, you could actually do a hand-coded optimized DCT. If you do a google scholar search on DCT algorithms since ~2008, you'll get a bunch of papers that have some step-by-step instructions for ultra-efficient implementations, but they're size-specific.


WestfW

Fri, 16 Nov 2012 07:19:50 +0000

Is this possible, and if so, would it involve anything more than just copying those 2 files over so the compiler can see them?

Code is code. If you build the assembler and link it to the C code, the standardization of MIPS API definitions should allow it to be compiled.

There are a couple of possibly significant problems.

  1. AFAIK, mpide (and Arduino) doesn't have a way to include an already-built library binary in an image.

  2. The FFT assembler library may be written in the Microchip Assembler format (assuming that there is such a thing. Since MIPS is a pre-existing architecture, Microchip may just be relying on the existing MIPS assemblers.) Gnu assembler (which I think mpide will understand and compile, if the source is named with a .S extension), tends to have its own format for instructions, frequently not matching the manufacturers' defined assembly languages. (sigh.)

It would certainly be worth trying. Since Microchip libraries do not usually have licenses compatible with "open source" sensibilities, it is unlikely that the library could be included with mpide...


majenko

Fri, 16 Nov 2012 10:25:59 +0000

C32 is just the gnu toolchain (gcc + binutils) with some MCP specific changes:

$ /opt/microchip/mplabc32/v2.02/bin/pic32-as -v
GNU assembler version 2.20.51 (pic32mx) using BFD version (Microchip Technology) 2.20.51.  MPLAB C Compiler for PIC32 MCUs v2.02-20111116

WestfW

Sat, 17 Nov 2012 02:14:18 +0000

(It does look like Microchip is using the gnu assembler as THE assembler for PIC32 (and for the 16bit PIC24/dsPIC30/dsPIC33 as well) So that's one non-problem!)