I'm trying to acquire a signal from sensor and process it "real time" with Raspberry and Python. I use ADC converter to have digital input. I was told to implement a sort of buffer since time processing takes too time and would stop ADC acquisition. My scheme is:
- Acquisition thread: ADC outputs samples at choosen sample rate and put them into a ring buffer (Queue in Python)
- Processing thread:takes samples from buffer when it's full and processes in one block
My question Is: how can I send ADC data saved in buffer all in one block to the processing code? I've read that processing in blocks it's more convenient but I don't know how to do this. I want to use threds because I don't want to loose samples