Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Real Time signal processing
#1
I have a Raspberry-pi4 and ADC which communicates through SPI and sends samples from sensor to Pi. The signal needs to be processed "real time" but the sample rate is bigger than processing rate. I was told to take a batch approach: sending data samples from ADC to a sort of buffer and the process a block of samples at once. I've thought about implementing buffer with python queue and using threading. In this way, the main thread should continuously fill the buffer, while the second thread should process a block of samples receveid when the buffer is full.
But how can I send the whole buffer's content to the processing code when It becomes full? The processing code should work on array. Is it right implementing threading? How can I control the right sampling frequency?
I want to acquire a slow signal (breath signal) at 100 Hz.
Reply
#2
you might want to take a look through: https://pypi.org/search/?q=signal+%2B+processing
Since I haven't used any of these packages, I can't point to a specific example.
However, with a small amount of effort looking through these you might save yourself a lot of time.
Reply
#3
Ok, but anyone who has implemented the scheme I suggested? Threading + buffer?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Non-blocking real-time plotting slow_rider 5 3,597 Jan-07-2023, 09:47 PM
Last Post: woooee
  Real time database satyanarayana 3 1,661 Feb-16-2022, 01:37 PM
Last Post: buran
  Real time data satyanarayana 3 23,147 Feb-16-2022, 07:46 AM
Last Post: satyanarayana
  Real time Detection and Display Gilush 0 1,782 Feb-05-2022, 08:28 PM
Last Post: Gilush
  Real-Time output of server script on a client script. throwaway34 2 2,045 Oct-03-2021, 09:37 AM
Last Post: ibreeden
  Why recursive function consumes more of processing time than loops? M83Linux 9 4,221 May-20-2021, 01:52 PM
Last Post: DeaD_EyE
  Real Time Audio Processing with Python Sound-Device not working Slartybartfast 2 3,954 Mar-14-2021, 07:20 PM
Last Post: Slartybartfast
Question I can't get my real-time chart with Python (Help!) Bastian_ElProfe 1 2,215 Jan-20-2021, 01:34 PM
Last Post: wostan
  Real-time processing tagalog 5 3,113 Oct-06-2020, 03:45 PM
Last Post: tagalog
  Real time MIDI with python eythoralex 1 3,443 May-19-2020, 07:17 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020