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.

Question about how to export data from DSP to Matlab

Hi,

I want to record the data from one of my microphone when the main program is running. Can I simply use a buffer to store the value from my microphone, use the graph tool to plot the buffer, and use the save memory option to store the data? But when I use the above method, the values stored in the buffer is just like garbage data. Is there a better way to save same data of my interest in the same time with DSP application running? Thanks

  • Hi,

    Thanks for your post.

    To my knowledge, whatever the buffer methodology you use to capture line input (Mic.) data would be the right option but it matters, how & where you place the buffer in the code appropriately to capture incoming Mic. data. Usually the line input raw audio samples will go directly to the ADC codec and the same audio data will go to audio serial port peripheral McASP via I2C interface, so, it would be better to place the buffer to capture the audio input samples appropriately in the ADC codec register or the audio serial port McASP data registers. By this way, you can copy the raw input samples either from ADC codec registers or McASP data registers to the buffer placed in the code, so that, you could export the buffer data from DSP to MATLAB and plot the buffer data through applicable graph tools.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thank you for your answer. So in order to place the buffer in the ADC codec register or audio serial port McASP data registers, what should I do in the software? I simply declare the buffer as a global array outside of the interrupt service routine and main program. How do I know if this buffer is associated with the above two areas of registers? Why does it matter? Thanks.

  • Hi,

    Thanks for your update.

    It would be better to identify the McASP Data register dump data in the code and copy the same to the global buffer array and thereby, you could export this DSP buffer data to MATLAB & plot the buffer data in a graphical view through MATLAB tools.

    In code perspective, please identify the memory address of SOC_MCASP_0_DATA_REGS as source of audio line in Mic. data and copy this source address to global buffer array which is a destination address through memcopy, so  that, the data in destination array can be plotted graphically in MATLAB.

    Thanks & regards,

    Sivaraj K

    -------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question

    -------------------------------------------------------------------------------------------------------

  • Hi Sivaraj,

    Thanks for answer. Do you know a way to dump the data when DSP application is running using a serial to USB connector to computer? I still can not use a global array to record the data I want, because sometimes it just give complaints that I have no idea to solve it. Is there a simple way to transfer the data in DSP to a file in computer, so I can use it for later analysis? Thanks.