This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR5994: FFT results using LEA

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSP430WARE

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.

  • Hi Graham,

    You can refer to the official example code for help. You can find the example and documention in below link:

    file:///C:/ti/msp/MSP430Ware_3_80_01_01/dsplib/html/transform_ex2_cmplx_fft_auto_q15_8c-example.html

    If my post helped solve your issue, please click on the  VERIFY ANSWER    button. 

    Winter,

    Search E2E! Your questions may already be answered! 

**Attention** This is a public forum