User Tools

Site Tools


analysis:rhythms:step1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
analysis:rhythms:step1 [2016/03/30 13:59]
mvdm [Obtaining the code you need to load the Emotiv data]
analysis:rhythms:step1 [2020/01/15 14:58]
mvdm
Line 44: Line 44:
  
 <​code>​ <​code>​
-addpath('​\Documents\GitHub\PSYC50Rhythms'​);​+addpath(genpath('​\Documents\GitHub\PSYC50Rhythms'​));
 </​code>​ </​code>​
  
-(obviously, if you placed the code in some different place, substitute that.)+Obviously, if you placed the code in some different place, substitute that. Also, it may be that your computer prefers forward slashes (''​\''​) instead of backslashes (''/''​)!
  
 Now you've told MATLAB to add this new location to the list of places it looks for commands (the "​path"​). To check that MATLAB can find our shiny new EDF loader, do ''​which edfread''​. If things are set up right, MATLAB should reply with the location of where the ''​edfread.m''​ file is located, and you're all set for the final step below. Now you've told MATLAB to add this new location to the list of places it looks for commands (the "​path"​). To check that MATLAB can find our shiny new EDF loader, do ''​which edfread''​. If things are set up right, MATLAB should reply with the location of where the ''​edfread.m''​ file is located, and you're all set for the final step below.
Line 74: Line 74:
 {{ :​analysis:​rhythms:​sethplot.png?​nolink&​600 |}} {{ :​analysis:​rhythms:​sethplot.png?​nolink&​600 |}}
  
-The traces you see include some signals recorded from the Emotiv'​s electrodes, positioned on the skull (the traces at the top), signals from the Emotiv'​s accelerometers (the signals in the middle), and some timing and event channels (at the bottom).+The traces you see include some signals recorded from the Emotiv'​s electrodes, positioned on the skull (the traces at the top), signals from the Emotiv'​s accelerometers (the signals in the middle), and some timing and event channels (at the bottom). ​The neural data traces don't look great: there are various features that we suspect are probably non-neural artifacts, such as the sharp spikes appearing on a few channels simultaneously. But it will do in having something to work with for now!
  
 === Structure of Emotiv data === === Structure of Emotiv data ===
Line 83: Line 83:
  
 ☛ Construct a vector of timestamps containing the time, starting with 0, of each of the 8448 samples in this data. This requires knowing the sampling rate of the Emotiv; consult the manual or the file header to find this out. Then, replot the data using this time vector. ☛ Construct a vector of timestamps containing the time, starting with 0, of each of the 8448 samples in this data. This requires knowing the sampling rate of the Emotiv; consult the manual or the file header to find this out. Then, replot the data using this time vector.
 +
 +==== Optional: streaming Emotiv data ====
 +
 +If you want to access Emotiv data in (near) real-time, rather than loading a previously saved file, I recommend using the FieldTrip toolbox. Use Git, as above, to clone the current FieldTrip repository. Then, in MATLAB, add it to your path as follows:
 +
 +<​code>​
 +cd('​C:​\Users\mvdm\Documents\GitHub\fieldtrip'​);​
 +ft_defaults;​
 +</​code>​
 +
 +Make sure your Emotiv headset is on and you have the Bluetooth receiver'​s light flickering. Then, from a command prompt, launch the following two executables:​ ''​buffer.exe''​ (in \GitHub\fieldtrip\realtime\bin\win32) and ''​./​emotiv2ft.exe emotiv-config.txt''​. If that looks like it's working (you should get some status updates showing up in the command prompt), do this in MATLAB:
 +
 +<​code>​
 +ft_realtime_plot([])
 +</​code>​
analysis/rhythms/step1.txt · Last modified: 2020/01/15 15:00 by mvdm