Example 2: Visual speller

Part 3

<- Go back to Part 2 - Continue with Part 4 ->

In the previous parts of this visual speller example, all actions were executed by the BrainStream Matlab session. In this section, we will describe how to enable parallel processing. All actions related to stimulus presentation will be handled by a client.

Below, the new flowcharts of the experiment are shown. Actions indicated in orange are executed at the BrainStream Matlab session, whereas actions indicated in blue are executed at the client.


Figure 1: Main flowchart. In the stimulus presentation import-table, actions are defined for the BrainStream Matlab session as well as the client (see Figure 2).

At the start of the experiment, the speller is intialized on the client. The client then sends a marker to BrainStream to trigger the initTrain function. The advantage of this construction is that you are always sure that the stimulus client is correctly initialized before the actual experiment starts.


Figure 2: Import-table flowchart

In the import-table flowchart you can see why it is advantageous to use parallel processing: if the action of updating the codebook (at the BrainStream session) is delayed or takes more than 0.07 seconds, the duration of the stimulus (at the client) is not affected.

In order to build this experiment, we first need to indicate that we want to use parallel processing and define the client. This can be done in the block file speller_common.blk:


stim = 'localhost';

Thus, the name of the client is 'stim'. Furthermore, 'stim' is an internal client of type 'localhost'. This means that in order to run the experiment, we must start a second Matlab session manually and connect this session to the BrainStream session by typing the command connect_brainstream_client('localhost') in the client's command window.

Now that we have specified the client in the block file, we can direct the execution of any action to this client. We can do this by specifying the name of the client in the 'client' column of the Actions table:


Figure 3: Actions sheet of the speller_train table


Figure 4: Actions sheet of the speller_common table


<- Go back to Part 2 - Continue with Part 4 ->

Topic attachments
I Attachment Action Size Date Who Comment
pngpng flowchart_main_4.png manage 180.3 K 30 Jan 2012 - 10:47 MarjoleinVanDerWaal  
pngpng flowchart_plugin_3.png manage 164.8 K 30 Jan 2012 - 10:58 MarjoleinVanDerWaal  
pngpng stim1.png manage 48.8 K 04 Jan 2012 - 10:26 MarjoleinVanDerWaal  
pngpng stim2.png manage 63.8 K 04 Jan 2012 - 12:38 MarjoleinVanDerWaal  
pngpng stim2_2.png manage 63.8 K 04 Jan 2012 - 12:38 MarjoleinVanDerWaal  
Topic revision: r5 - 14 Nov 2014 - 15:34:26 - PhilipVanDenBroek
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback