FFT implementation on FRDM k64F

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

FFT implementation on FRDM k64F

1,005 次查看
abdurrehman98
Contributor I

Hi, i am trying to implement fft on frdm k64f. I am using the complex.h to work on complex numbers. I have also used the newlibNano of NXP MCU expresso compiler. But still my code is slow. If anyone can recommend any FFT library or how to speed up FFT code.

 

while(1) {

r1p=0;
//i1p=0;
r2p=0;
//i2p=0;

GPIO_PortToggle(BOARD_INITPINS_ptc2_GPIO, 1u << BOARD_INITPINS_ptc2_PIN);
for (n = 0; n<((N/2)-1);n++)
{

//Index for even and odd
eveind = 2*n;
oddind=(2*n)+1;

//Input for sin and cos
ang= -((2*pi*k*n)/(N/2))*I;

expc=cexp(ang);


//Even Part
r1[0]= r1p +(x[eveind]*expc);

 

r1p=r1[0];

//Odd Part

r2[0]= r2p +(x[oddind]*expc);

r2p=r2[0];
//i2p=i1[0];

}

//Calculation for multiplication with odd part

//Calculation for e
angm=-((2*pi*k)/(N))*I;

 

//COnverting back to the rectangular form
r2_[0]= r2[0]*cexpf(angm);


// Adding odd and even parts of even and odd parts
rfft=(r1[0]+r2_[0])/(N/2);

//Amp of fft final answer

magfft=cabsf(rfft);

//Toggle GPIO
GPIO_PortToggle(BOARD_INITPINS_ptc2_GPIO, 1u << BOARD_INITPINS_ptc2_PIN);

}

 

 

0 项奖励
回复
1 回复

986 次查看
CarlosGarabito
NXP TechSupport
NXP TechSupport
0 项奖励
回复