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.

CCS/TMS570LS1224: Problem when performing FFT on MCU

Part Number: TMS570LS1224

Tool/software: Code Composer Studio

7802.pruebas_matlab.m.zip6888.Protesis_de_mano_nov_2016.zipHi

Im having some problems when doing the FFT. I attach an image of the problem and the code:

As can be seen, the green line (MATLAB PROCESS) matches the red line (MCU PROCESS) perfectly at the begging but then the they don't match in amplitude and I have been trying to figure out why could that be happening... I had this problem before but it kinda solved by itself but now is the same error...

I attach the Matlab code with the data and the processes and the MCU code. The Matlab code has almost the same functions as the MCU code and some other things for testing.  

Thanks for the help... 

  • Hello Miquel,

    I have forwarded your post to one of our MATLAB experts. They should get back with you soon.
  • Hola, aun presentas el mismo problema?

    Segun veo, mas parece un problema en la resolucion del muestreador ADC.

    Saludos!
  • Hi Martin

    I would prefer to write in english in case another person has the same problem, it thats ok for you 

    The problem persist yes. emmm a problem with the ADC resolution? what do you mean?

    The data I used for the Matlab code was directly retrieved from the MCU. The data used for the processing is exactly the same. I don't see how the ADC resolution could be causing a problem there.... 

    The processed data in both the MCU and the Matlab code is exactly the same. 

    Saludos!!

  • Martin, Miguel:

    If it is more comfortable to discuss this in your native language, please feel free to do so if it helps to get to the solution faster. You can do this in the public or through private messaging. All I would request is that you close the loop with an English explanation of the problem and solution once you arrive at. Cheers!
  • I understand, you are only using two fourier transforms, one in the Hercules and the other by Matlab and you are simply comparing the answers through the graphs.

    If my way of thinking is correct, there is apparently information loss in the interpolation that matlab performs when it comes to plotting.

    could you compare the vectors of magnitude of Fourier that receives of the Hercules with the one of Matlab, other than using the graph ?, present different values?

    calculate the magnitude of the transform with the same function as the Hercules DSP libraries or calculate it with Matlab?

    Regards
    Martin
  • Hi Martin

    Sorry for the late reply. I have been quite busy with the project. ammm yes I could make the comparison. 

    Just give me a couple of days and I let you know.

    I calculate the magnitude using the DSP library on the hercules and the abs() function in matlab

  • Well, we may suspect that this is a factor that presents different answers!

    Waiting for your comments, my friend!

    Saludos!
  • Hi Martin

    I already check the values and they are different. 

    They begin being similar but then the difference is quite big... I check if the Hanning window could be the problem but no. They are the same numbers and everything...

  • Whats more, after the Hann windowing, the data remains almost the same. The problem is after performing FFT. I think it might be a problem with the library. I will check it but... its driving me crazy

    this is the output after performing FFT to the first window in both matlab and the MCU, look: 

  • Hello, I have seen your results, I will pin to a Matlab expert to request your help.

    The difference between responses is too much, what is the nature of the sampled signal?
  • In this case the signal was white noise. Just that. Its quite similar to EMG signals. 

    I really have no idea but the problem appears just after performing the FFT on the MCU. Im not sure is its a problem with the library or a problem with my matlab. I attach my code from matlab. 1565.arreglo_datos.m.zip