FFT example code

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT example code

3,199 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuockal on Sat Dec 12 04:08:13 MST 2015
hi NXP,

I am using LPC4078, and I want to do FFT on that MCU

Are there any example code or user manual about how to use DSP library, specially FFT functions?

Where can I get start for FFT?

Thanks in advance
Labels (1)
0 Kudos
3 Replies

304 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuockal on Mon Jan 18 23:37:22 MST 2016
hello,

I finally passed the issue,

the bug is belong to CMSIS DSP library.

Follow to some other site, I don't remember now. Just change the code at line 57 of file arm_bitreversal2.S
from: #define CODESECT .section text
to: #define CODESECT .section .text
(add . before text)

Thanks

304 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by phuockal on Fri Jan 15 02:41:16 MST 2016
Hello,

I tried to use CMSIS_DSPLIB_CM4 with function arm_rfft_fast_f32(). but the controller LPC4078 crashed.
my code look like:

//create memory for fft calculation
fftInput = new float[FFT_SAMPLE];
fftOutput = new float[FFT_SAMPLE];
//create FFT instance
fftInstance = new arm_rfft_fast_instance_f32;
//init FFT instance
arm_status status = arm_rfft_fast_init_f32(fftInstance, FFT_SAMPLE);
//collect data to do FFT
fftInput[fftIndex++] = pressureMgr->GetLastValue();
if(fftIndex >= FFT_SAMPLE)//input array full
        {
       //do FFT
      arm_rfft_fast_f32(fftInstance, fftInput, fftOutput, 0);
        }

Please show me what I did wrong.

Thanks in advance,
0 Kudos

304 Views
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Sat Dec 12 10:45:29 MST 2015
There is a "CMSIS DSP" library provided with LPCXpresso examples. Includes source code.

There is also a more optimised version (for Cortex-M3 rather than M4) here:
http://www.nxp.com/documents/application_note/AN10913_CM3_DSP_library_v1_0_0.zip
0 Kudos