I'm working on an application where I receive a large amount of data via the USB from 4 sensors and displaying them in Matlab.
The streaming works perfectly , however, I need to do some processing on the data as it's streaming. I use segments of the incoming data and process them then plot the processed data. The incoming data is taken segment by segment and processed.
My problem is that, if I'm processing 5 seconds' worth of data in every segment. When the processing and plotting is implemented, the streaming stops, therefore when it's time for the next batch to process, I have to wait for the streaming of the next 5 seconds segment. Even if I delay the beginning of the processing to let's say after 20 seconds, the streaming will always stop when the processing starts and I will always have a small pause to read new data. How can I keep the streaming or the data reception from the serial port going even when I'm processing the data?
Thanks