Reputation: 1285
I'm currently trying to do some real-time signal-processing and I would like to use "gnuradio". I will be processing multiple channels of EEG which come in trough a custom interface (namely "Lab Streaming Layer"; LSL) in python. Now my question is if there is an existing block already where you can kind of "push" samples into the signal-processing-graph during run-time? The only blocks I've found so far offer support for audio hardware, TCP-streams and files.
Upvotes: 0
Views: 1611
Reputation: 43851
The most flexible method is to write your own GNU Radio block, but there are several options for getting data into a flow graph without using any custom blocks. (Naming from the Python perspective.)
gnuradio.blocks.message_source
, which takes data from a gnuradio.gr.msg_queue
.
You can use a gnuradio.blocks.file_descriptor_source
where the file descriptor is one end of a pipe.
Upvotes: 0
Reputation: 36442
You will have to write your own block; that can be done in Python or C++, whatever is better for your case.
The GNU Radio Guided Tutorials (you should really read them in order from 1 to 5, at least) do explain how to do that.
Because we all know that people are lazy at reading, here's a rough preview of what you'll learn:
gr_modtool newmod sensorinterface
, change into the newly generated directory: cd gr-sensorinterface
gr_modtool add eeg_sensor_source
; the block type you'll want is "source"; you will be asked to fill in some block details.lib/
or python/
, depending on which language you chose:
float
work
function; add code to get new samples, and copy those to the output_items
buffer.The guided tutorials are really nice!
Upvotes: 0