Page 1 of 1

State Variables and Passing Information Between Modules

Posted: 15 Dec 2011, 15:04
by mwronk
Hi,
I'm working on a filter that will detect certain features in the brain signal to tell the application module exactly when to present stimuli in a stim presentation task. Basically I want to time the presentation of stimuli based on brain features in real-time. There are a couple of issues I wanted to ask before I keep working on this project:

1) Are state variables (with a small sample block size) the best way to quickly pass an indicator from the signal processing module to application module?

2) If so, is there any way to create a matrix state variable? I want to pass information about multiple channels to the application module.

Thanks and let me know if there is a better way to do this,
Mark

Re: State Variables and Passing Information Between Modules

Posted: 19 Dec 2011, 13:56
by jawilson
Mark,
State variables are the best way to communicate between modules. You cannot create matrix states, only states with some number of bits. Depending on your task, you could encode the required information in the state bits, e.g., use bitwise operators on an unsigned integer to encode some information in the signal processing, and decode it in the application.

Probably your best bet is to do all of the processing in the signal processing module, and decide exactly what stimulus you want to present using the state, based on all of the channels. Without more information about what exactly you are trying to accomplish, I don't think I can give more help that this.

Adam