Board logo

标题: 【Urgent Question】 Codewarrior Bug or Code error ? ---About The FFT function [打印本页]

作者: cmouse2008    时间: 2006-3-30 22:54     标题: 【Urgent Question】 Codewarrior Bug or Code error ? ---About The FFT function

【Urgent Question】 Codewarrior Bug or Code error ? ---About The FFT function dfr16RFFT


        When  i  use  the  function-dfr16RFFT  in  E  to  execute  a  FFT.  It  doesn't  work  well,Although  i  strictly  follow  the  instructions  of  E's  manual  ,It does not work well . My code goes following . i'm wondering what's wrong with it ?  does Anyone can give me an example of the function dfr16RFFT which give the same result of the answer from Matlab  "fft([0.1 0.2 0.3 0.4],8)"


ans =

  1.0000         
 -0.0414 + 0.7243i
 -0.2000 - 0.2000i
  0.2414 + 0.1243i
 -0.2000         
  0.2414 - 0.1243i
 -0.2000 + 0.2000i
 -0.0414 - 0.7243i

 

 

Thanks A lot!!!!!!!

==============

void main(void)
{
 /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
 
 /*** End of Processor Expert internal initialization.                    ***/

 /* Write your code here */
  dfr16_tRFFTStruct *pRFFT;
 Result             res;
 Frac16            pX[]={FRAC16(0.1),FRAC16(0.2),FRAC16(0.3),FRAC16(0.4)};
 UInt16      options = FFT_SCALE_RESULTS_BY_N;

 dfr16_sInplaceCRFFT *pZ=malloc(sizeof(dfr16_sInplaceCRFFT));


 E_low_level_init();
 pRFFT = dfr16RFFTCreate (8, options); /* N = 8 point RFFT */
 res = dfr16RFFT (pRFFT, pX, pZ);
 
 
 dfr16RFFTDestroy (pRFFT);
 
 for(; {}
}
=====================





欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0