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.

TMS320F28377S: F28377D , VCU2 and FFT

Part Number: TMS320F28377S

About example  2837x_vcu2_cfft_128 ,ask a few question.

1.the result of data_output.h  are  inconsistent with the matlab calculation

2.What is input data format? is it Real+image? or image+Real?

thanks.

  • I'm sorry for the length of time taken to get a reply to you. We are having difficulty finding the right contact to support this question. Thank you for your patience.
    Regards,
    Richard
  • Hi,

    The input is Re + Imag. I tried the following in MATLAB and got the same magnitude plot

    A = [ copy all data from data_input.h here] ;
    data = reshape(A',1, 32*8); 
    input = data(1:2:256)+data(2:2:256).*i;
    input(1); % should be  2232 + 1930i
    spec =fft(input);
    spec_mag = abs(spec);
    B = [ copy all data from data_output.h here] ;
    gold = reshape(B',1,32*8);
    gold_complex = gold(1:2:256)+gold(2:2:256).*i;
    sp(1)=subplot(1,2,1), plot(abs(spec_mag)/128);
    sp(2)=subplot(1,2,2), plot(abs(gold_complex));
    title(sp(1), 'MATLAB FFT');
    title(sp(2), 'GOLDEN OUTPUT');

    And i get the following figure

    As for the complex spectrum, there are bound to be differences on account that MATLAB does a double precision computation while the VCU does 16-bit fixed point arithmetic.

  • plot(abs(spec_mag)/128),Why to divide by 128?