I am using TI TMSC5402 DSK and dsplib V2.1 now.My problem is I can't get the correct FFT values. But I can't find what is wrong? I test a 16 point float point data. Ex: float A[16]={0.001,0.002,0.003,0.004, 0.005,0.006,0.007,0.008, 0.009,0.010,0.011,0.012, 0.013,0.014,0.015,0.016}; short AA[16]; short NX; And I follow the next steps to do FFT . scale=0; fltoq15(A,AA,NX); cbrev(AA,AA,(ushort)NX/2); rfft16(AA,scale); Can anyone tell me which step I do is wrong?? Thanks!! |

# About FFT ( using dsplib )

Started by ●March 13, 2002

Reply by ●March 14, 20022002-03-14

HiHave you alligned the the FFT data ( AA[] ) at a 32 word boundary. This is described in the DSP user's guide. The (log2(nx)+1) least significant bits of the address has to be zero, nx is the fft size. Thus, in your case log2(16)+1 = 5, i.e. the fft data has to start at a address where the 5 least significant bits are 0. This can be done as follows: 1) Create a section where the data are placed #pragma DATA_SECTION(AA,".fftdata") short AA[16]; 2) Use this section name in the linker command file together with align(32) as shown in the example below MEMORY { PAGE 0: SCRATCH: origin=0x0060, length=0x0020 /* Scratch-Pad RAM */ PAGE 0: VECTOR: origin=0x0080, length=0x0078 /* Space for int. vectors */ PAGE 0: PROGRAM: origin=0x00F8, length=0x1C00 /* Space for program code */ PAGE 1: PROGDATA: origin=0x1D00, length=0x2300 /* Space for data */ } SECTIONS { .vectors >VECTOR PAGE 0 .text >PROGRAM PAGE 0 .cinit >PROGRAM PAGE 0 fasttext >PROGRAM PAGE 0 .sintab >PROGDATA PAGE 1 .bss >PROGDATA PAGE 1 .data >PROGDATA PAGE 1 .const >PROGDATA PAGE 1 .stack >PROGDATA PAGE 1 .fftdata: >PROGDATA PAGE 1, align(32) } Best regards Torgeir Jakobsen Senior Engineer, Technology Department Aanderaa Instruments AS e-mail: web: www.aanderaa.com phone; +47 55 10 99 00 direct: +47 55 10 99 77 fax: +47 55 10 99 10 ----- Original Message ----- From: "ykm67111" <> To: <> Sent: Wednesday, March 13, 2002 8:41 AM Subject: [c54x] About FFT ( using dsplib ) > I am using TI TMSC5402 DSK and dsplib V2.1 now. > My problem is I can't get the correct FFT values. > But I can't find what is wrong? > I test a 16 point float point data. > Ex: > float A[16]={0.001,0.002,0.003,0.004, > 0.005,0.006,0.007,0.008, > 0.009,0.010,0.011,0.012, > 0.013,0.014,0.015,0.016}; > short AA[16]; > short NX; > > And I follow the next steps to do FFT . > > scale=0; > fltoq15(A,AA,NX); > cbrev(AA,AA,(ushort)NX/2); > rfft16(AA,scale); > > Can anyone tell me which step I do is wrong?? > > Thanks!! > > _____________________________________ > Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. > > _____________________________________ > About this discussion group: > > To Join: Send an email to > > To Post: Send an email to > > To Leave: Send an email to > > Archives: http://www.yahoogroups.com/group/c54x > > Other Groups: http://www.dsprelated.com > ">http://docs.yahoo.com/info/terms/ -- This e-mail has been protected by Song Networks' virus-scan service: http://www.securemail.no |