spectralSize and spectralStep

Forum for discussion on different signal processing algorithms
Locked
tahdah
Posts: 14
Joined: 22 Apr 2011, 18:12

spectralSize and spectralStep

Post by tahdah » 10 Jan 2012, 16:00

Hello all,

I've been working with the OfflineAnalysis tool for a while now, but I want to make sure I understand how the data is processed exactly. If anyone has a good (read as 'detailed') explanation of this process, would you mind explaining it to me?

Also, I've found that there are 2 parameters used called: spectralSize and spectralStep, they are found in the 'settings' structure loaded from the datasets on line 73 of the file "OfflineAnalysis.m". In the baseline recording settings, there is no way to alter these settings, can someone tell me what they do and what their relevancy to epoching might be?

Thanks,
-tahdah

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: spectralSize and spectralStep

Post by mellinger » 11 Jan 2012, 14:19

I've been working with the OfflineAnalysis tool for a while now, but I want to make sure I understand how the data is processed exactly. If anyone has a good (read as 'detailed') explanation of this process, would you mind explaining it to me?
Basically, the OfflineAnalysis tool operates in two steps. In a first step, it transforms recorded data such that it is now represented by a certain set of features rather than by EEG time courses. The set of features differs by the type of data analyzed as follows:

For P300 (ERP) data, a single feature corresponds to
* raw EEG amplitude
* at a certain time offset after the stimulus
* in a certain channel.

For mu rhythm (SMR) data, a single feature corresponds to
* absolute value of EEG amplitude
* at a certain frequency
* in a certain channel.

After transformation from raw EEG into features, data are selected/sorted into two groups according to the conditions specified in the OfflineAnalysis GUI. Again, the meaning of these conditions depends on the type of data analyzed: For P300 data, one condition is the presentation of an unattended stimulus, while the other condition is the presentation of an attended stimulus. For mu rhythm data, one condition may be imagined movement of the left hand, while the other condition may be rest.

Now, for a single feature, you have a number of sampled values, taken from two sets (conditions). What OfflineAnalysis now does is that it uses these values to compute a number representing how much a feature's value tells about the condition under which it was recorded. That measure is called "determination coefficient", or "r^2 (r squared)," and is a number between 0 and 1. The larger a feature's r^2, the more correlation exists between a feature's value and the condition under which it was recorded. For details about how r^2 values are computed, see http://www.bci2000.org/wiki/index.php/G ... ination.29.

Finally, OfflineAnalysis produces a main graph that shows r^2 values, plotted over the two dimensions that locate a feature. Using this graph, you may identify and select individual channels and time offsets/frequencies for which to display more detailed information about a subset of features, i.e. topographic plots, ERP wave forms, spectra.
Also, I've found that there are 2 parameters used called: spectralSize and spectralStep, they are found in the 'settings' structure loaded from the datasets on line 73 of the file "OfflineAnalysis.m". In the baseline recording settings, there is no way to alter these settings, can someone tell me what they do and what their relevancy to epoching might be?
These two parameters are present in the online system as well. There, spectralSize is called WindowLength, and is explained on this page:
http://www.bci2000.org/wiki/index.php/U ... e:ARFilter
The spectralStep parameter is called SampleBlockSize in the online system, and is explained here:
http://www.bci2000.org/wiki/index.php/U ... eBlockSize
I'm not sure what you mean by "baseline recording settings," but in case you are referring to the parameters for the initial mu session, there is no online processing performed for these data. Thus, OfflineAnalysis does not read its spectralSize and spectralStep parameters from the data file.

In order to determine the frequencies at which the mu rhythm signal depends on the task condition, the measured EEG signal, which is in the time domain, must first be analyzed for which frequencies it contains. In BCI2000, this is done by the so-called AR algorithm but any method may be used that allows to estimate spectra (=distributions over frequency). Any such method takes as its input a signal time course consisting of a certain number of samples, and produces as its output a spectrum with a given resolution. The output of such a method cannot contain more information than available in its input, so as a rule of thumb, these methods produce about as many sample points in the frequency domain as they are fed in the time domain. Thus, in order to obtain a certain resolution in the frequency domain, one needs to use a certain amount of sample points for analysis.

Also, one typically wants to know how the frequency spectrum of a signal varies with time. In order to compute a time-varying spectrum, one moves a sliding window over the time domain data, and computes the spectrum from the data within that window. Now, when moving the window by a single sample only between one spectrum computation and the next, the data within the window will have changed only marginally, and the resulting spectrum is therefore expected to differ little from the previous one. Thus, it makes more sense to move the window in larger steps. On the other hand, when there is no overlap between subsequent windows, then the result will partly depend on the exact locations of the windows, rather than best representing the analyzed signal. Thus, one typically uses an overlap of half a window size between subsequent windows.

From this, you will understand that the spectralSize/WindowLength parameter defines spectral resolution, whereas the spectralStep/SampleBlockSize parameter defines the time interval between subsequent spectra.

Best,
Juergen

tahdah
Posts: 14
Joined: 22 Apr 2011, 18:12

Re: spectralSize and spectralStep

Post by tahdah » 13 Jan 2012, 16:10

mellinger wrote:
I'm not sure what you mean by "baseline recording settings," but in case you are referring to the parameters for the initial mu session, there is no online processing performed for these data. Thus, OfflineAnalysis does not read its spectralSize and spectralStep parameters from the data file.
Thanks for your reply, it was extremely helpful!

I was talking about the 'initial mu session'. A couple things. First, I've been collecting data without using the ARSignalProcessing.exe, I don't know if that makes a difference or not, it also explains why I wasn't able to see those parameters. Second, I don't quite understand what you mean when you say that OfflineAnalysis doesn't read spectralSize and spectralStep because those parameters are acquired from the 'setting' parameter which is gotten from the data file. Is there something I'm not reading properly?

-tahdah

mellinger
Posts: 1341
Joined: 12 Feb 2003, 11:06

Re: spectralSize and spectralStep

Post by mellinger » 16 Jan 2012, 13:53

Second, I don't quite understand what you mean when you say that OfflineAnalysis doesn't read spectralSize and spectralStep because those parameters are acquired from the 'setting' parameter which is gotten from the data file. Is there something I'm not reading properly?
I didn't write the OfflineAnalysis tool, so I'm not too familiar with how it's written internally. The two parameters are probably chosen based upon the data file's sampling rate, and thus not copied from parameters present in the data file.

-Juergen

Locked

Who is online

Users browsing this forum: No registered users and 0 guests