Help on a data acquisition system

I am building a circuit which will sample an analog signal in order to apply some digital signal processing through matlab. I have an external ADC for the sampling which communicates with an arduino DUE through SPI and then the arduino sends the samples to matlab through SerialUSB.

The problem is that by using a usb the sampling frequency is not constant as there is a delay each time I send samples where I can't obtain new samples. Is there any way to make the communication between matlab and arduino independent of the communication between ADC and arduino in order to sample at a constant rate? I thought that a DMA may do the job but I don't have used one before.

This is a common problem. There's lots of information in the archives, although the standard search function doesn't seem to do a good job of searching. Usually logging to SD card is the problem, although the solutions for that will probably be applicable to your situation.



Depends on sampling rate, below 100k it would be more easy to get Timer library to manage synchronisation, than set-up DMA