Jump to content
Graham

MSP430FR5994 LEA FFT

Recommended Posts

Hi all,

Question about the results of msp_cmplx_fft_auto_q15. I use TI's DSPLibrary and can't seem to make sense of the results of the msp_cmplx_fft_auto_q15, which invokes LEA on MSPFR5994. Specifically, if I specify:

static DSPLIB_DATA(src1, MSP_ALIGN_CMPLX_FFT_Q15(SAMPLES)) unsigned int src1[SAMPLES * 2];

static msp_fft_q15_params params = {.length = SAMPLES};
static msp_status status;

...

uint16_t shift = 0;
for(unsigned int i = 0; i < SAMPLES * CMPLX_INCREMENT; i += CMPLX_INCREMENT) {
	CMPLX_REAL(&src1[i]) = 1;
	CMPLX_IMAG(&src1[i]) = 0;
}
status = msp_cmplx_fft_auto_q15(&params, src1, &shift);

I don't get the result I expect. 

Instead of: Real: 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 Imag: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

I get: Real: 1, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 0 Imag: 0, -7, -3, -3, -1, -1, -1, -1, 0, 1, 1, 1, 1, 3, 3, 7

and shift = 0

I gather it could be a couple of things. 1) I need to input a twiddle table 2) LEA just doesn't get the integer datatype and needs something else 3) The results need to be scaled or interpreted in a different way 

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...