Offline analysis.

Forum for discussion on different signal processing algorithms
Locked
Shin Young Hak
Posts: 10
Joined: 06 Jul 2010, 09:00

Offline analysis.

Post by Shin Young Hak » 21 Jul 2010, 03:46

Hello all~

I have taken cursor task experiment using BCI2000.
We have two subjects. And we used 12 passive electrodes (Fz,F3,F4,Cz,C3,C4,T7,T8,P3,P4,Pz,Oz)
First, we take the stimulus presentation for acquiring features
We have 8runs(4 real movements and 4 imaginery).
In each run we have 40 trials (20 left and 20 right trials).
after acquiring the stimulus data, we analyze the features using offline analysis tool which is included in BCI2000.
The results is below figures.

1. real movements

<rest VS left>
Image

<rest VS right>
Image

2. imaginery movements

<rest VS left>
Image

<rest VS right>
Image


This results is acquired from the second subject.
Firsrt subject has also very similar result but small r^2 value (0.2)
I think prblem is only channel 6(Cz) has large r^2 value in each <rest vs left> and <rest vs right> case.
I expected if we move the left hand then we have large r^2 value in C4
and vice versa in right hand case.
but we have only Cz ch has large r^2 value.
And we have very small r^2 value in <left VS right> case.

Due to the this problem, I cannot procced our cursor task experiment.
I don't know whether just subject EEG signal is not good or we have some configuration mistakes.

Please give me any comment.

Thank you

Young Hak Shin

jawilson
Posts: 109
Joined: 28 Feb 2005, 16:31

Post by jawilson » 21 Jul 2010, 15:33

Can you post the contents of the parameter file you are using? I would like to see your configuration before commenting.

Shin Young Hak
Posts: 10
Joined: 06 Jul 2010, 09:00

Post by Shin Young Hak » 22 Jul 2010, 02:50

Thank you very much Adam for your response.

Here are our parameters.

Specially, SourceChList is not normal.
We use 12 channels (first ch is 17, last ch is 39) even ch is just RMS value.
Source:TDT:TDTBCI intlist SourceChList= 12 17 19 21 23 25 27 29 31 33 35 37 39 0 1 64 // the list of eeg channels to acquire (blank for all)

And I saw the raw eeg trace using BCI2000 viewer but C3, Cz, C4 are very simillar. So i think we have some problem.
If you can check our data and parameter files then i would like to send to you by email.


Source:Signal%20Properties:DataIOFilter int SourceCh= 12 16 1 % // number of digitized and stored channels
Source:Signal%20Properties:DataIOFilter int SampleBlockSize= 32 32 1 % // number of samples transmitted at a time
Source:Signal%20Properties:DataIOFilter int SamplingRate= 256 256Hz 1 % // sample rate
Source:Signal%20Properties:DataIOFilter list ChannelNames= 12 1 2 3 4 5 6 7 8 9 10 11 12 // list of channel names
Source:Signal%20Properties:DataIOFilter floatlist SourceChOffset= 12 0 0 0 0 0 0 0 0 0 0 0 0 0 % % // Offset for channels in A/D units
Source:Signal%20Properties:DataIOFilter floatlist SourceChGain= 12 1 1 1 1 1 1 1 1 1 1 1 1 0.003 % % // gain for each channel (A/D units -> muV)
Storage:Data%20Location:DataIOFilter string DataDirectory= C:\Documents%20and%20Settings\admin\%b9%d9%c5%c1%20%c8%ad%b8%e9\bci2000_1004_cont\data\20100720 ..\data % % // path to top level data directory (directory)
Storage:Session:DataIOFilter string SubjectName= LSJ Name % % // subject alias
Storage:Session:DataIOFilter string SubjectSession= 001 001 % % // three-digit session number
Storage:Session:DataIOFilter string SubjectRun= 02 00 % % // two-digit run number
Storage:Documentation:DataIOFilter string ID_System= % // BCI2000 System Code
Storage:Documentation:DataIOFilter string ID_Amp= % // BCI2000 Amp Code
Storage:Documentation:DataIOFilter string ID_Montage= % // BCI2000 Cap Montage Code
Visualize:Timing:DataIOFilter int VisualizeTiming= 0 1 0 1 // visualize system timing (0=no, 1=yes) (boolean)
Visualize:Source%20Signal:DataIOFilter int VisualizeSource= 1 1 0 1 // visualize raw brain signal (0=no, 1=yes) (boolean)
Visualize:Source%20Signal:DataIOFilter int VisualizeSourceDecimation= 1 1 1 % // decimation factor for raw brain signal
Visualize:Source%20Signal:DataIOFilter int VisualizeSourceTime= 2s 2 0 % // how much time in Source visualization
Visualize:Source%20Signal:DataIOFilter int SourceMin= -100muV -100muV % % // raw signal vis Min Value
Visualize:Source%20Signal:DataIOFilter int SourceMax= 100muV 100muV % % // raw signal vis Max Value
Source:TDT:TDTBCI string CircuitPath= C:\Documents%20and%20Settings\admin\%b9%d9%c5%c1%20%c8%ad%b8%e9\exp\chAcquire64_RZ2xs4_2.rcx 0 0 1024 // RCO circuit path (inputfile)
Source:TDT:TDTBCI int TDTBufferBlocks= 32 0 1 128 // determines the size of the TDT buffer as TDTBufferBlocks*16*blockSize
Source:TDT:TDTBCI float LPFfreq= 100 256 0 1024 // Low Pass Filter Frequency
Source:TDT:TDTBCI float HPFfreq= 3 3 0 256 // High Pass Filter Frequency
Source:TDT:TDTBCI float notchBW= 10 10 1 30 // 60 Hz notch filter BW
Source:TDT:TDTBCI float TDTgain= 1000000 1 1 100000000 // TDT pre-gain
Source:TDT:TDTBCI int nProcessors= 5 5 0 5 // Number of processors (set the RCO file accordingly!):
Source:TDT:TDTBCI int NumEEGchannels= 12 64 1 64 // Number of EEG channels to be acquired
Source:TDT:TDTBCI intlist SourceChList= 12 17 19 21 23 25 27 29 31 33 35 37 39 0 1 64 // the list of eeg channels to acquire (blank for all)
Source:TDT:TDTBCI intlist FrontPanelList= 0 0 1 16 // list of front panel components to acquire
Source:TDT:TDTBCI float DigitalGain= 1 1 0 % // the gain in converting from TTL to float
Source:TDT:TDTBCI float FrontPanelGain= 1 1 0 % // the gain in converting from front panel to float
Storage:Documentation:BCI2000FileWriter int SavePrmFile= 1 1 0 1 // save additional parameter file (0=no, 1=yes) (boolean)
Storage:Documentation:BCI2000FileWriter string StorageTime= Tue%20Jul%2020%2020:37:58%202010 // time of beginning of data storage
Source:Alignment:AlignmentFilter int AlignChannels= 1 0 0 1 // align channels in time (0=no, 1=yes)
Source:Alignment:AlignmentFilter floatlist SourceChTimeOffset= 0 0 % % // time offsets for all source channels (may be empty)
Source:Online%20Processing:TransmissionFilter list TransmitChList= 12 1 2 3 4 5 6 7 8 9 10 11 12 // list of transmitted channels
System:Core%20Connections string SignalSourcePort= 7771 4200 1024 65535 // the SignalSource module's listening port
System:Core%20Connections string SignalSourceIP= 127.0.0.1 127.0.0.1 % % // the SignalSource module's listening IP
System:Configuration matrix SignalSourceVersion= { Framework Revision Build } 1 2.1 2770,%202010/03/31%2019:27:09 2010/04/01%2017:40:40 // SignalSource version information
System:Configuration matrix SignalSourceFilterChain= 8 { Filter%20Name Position%20String } DataIOFilter 0 TDTBCI 1 NullFileWriter 1 BCI2000FileWriter 1 GDFFileWriter 1 EDFFileWriter 1 AlignmentFilter 1.1 TransmissionFilter 1.2 // SignalSource filter chain
Visualize:Processing%20Stages int VisualizeAlignmentFilter= 0 0 0 1 // Visualize AlignmentFilter output (boolean)
Visualize:Processing%20Stages int VisualizeTransmissionFilter= 0 0 0 1 // Visualize TransmissionFilter output (boolean)
System:Configuration matrix OperatorVersion= { Framework Revision Build } 1 2.1 2770,%202010/03/31%2019:27:09 2010/04/01%2017:40:40 // operator module version information
System:State%20Vector int StateVectorLength= 9 16 1 30 // length of the state vector in bytes
System:Core%20Connections string SignalProcessingPort= 7770 4200 1024 65535 // the SignalProcessing module's listening port
System:Core%20Connections string SignalProcessingIP= 127.0.0.1 127.0.0.1 % % // the SignalProcessing module's listening IP
System:Configuration matrix SignalProcessingVersion= { Framework Revision Build } 1 2.1 2770,%202010/03/31%2019:27:09 2010/04/01%2017:40:40 // SignalProcessing version information
System:Configuration matrix SignalProcessingFilterChain= 0 { Filter%20Name Position%20String } // SignalProcessing filter chain
Connector:ConnectorInput list ConnectorInputFilter= 0 // list of state names or signal elements to allow, "*" for any, signal elements as in "Signal(1,0)"
Connector:ConnectorInput string ConnectorInputAddress= % localhost:20320 % % // IP address/port to read from, e.g. localhost:20320
Visualize:Application%20Window:ApplicationBase%%3a%%3aDisplayVisualization int VisualizeApplicationWindow= 1 0 0 1 // Display miniature copy of application window (boolean)
Visualize:Application%20Window:ApplicationBase%%3a%%3aDisplayVisualization int AppWindowSpatialDecimation= 8 8 1 % // Application window decimation (shrinking) factor
Visualize:Application%20Window:ApplicationBase%%3a%%3aDisplayVisualization int AppWindowTemporalDecimation= 4 16 1 % // Application window time decimation factor
Application:Window:ApplicationBase int WindowWidth= 1200 640 0 % // width of application window
Application:Window:ApplicationBase int WindowHeight= 900 480 0 % // height of application window
Application:Window:ApplicationBase int WindowLeft= -1500 0 % % // screen coordinate of application window's left edge
Application:Window:ApplicationBase int WindowTop= 150 0 % % // screen coordinate of application window's top edge
Application:Window:StimulusTask string WindowBackgroundColor= 0xD2FFD2 0x505050 % % // background color (color)
Application:Sequencing:StimulusTask float PreRunDuration= 3s 1 % % // pause preceding first sequence
Application:Sequencing:StimulusTask float PostRunDuration= 3s 0 0 % // pause following last sequence
Application:Sequencing:StimulusTask float PreSequenceDuration= 0s 2s 0 % // pause preceding sequences/sets of intensifications
Application:Sequencing:StimulusTask float PostSequenceDuration= 0s 2s 0 % // pause following sequences/sets of intensifications
Application:Sequencing:StimulusTask float StimulusDuration= 4s 40ms 0 % // stimulus duration
Application:Sequencing:StimulusTask float ISIMinDuration= 3s 80ms 0 % // minimum duration of inter-stimulus interval
Application:Sequencing:StimulusTask float ISIMaxDuration= 3s 80ms 0 % // maximum duration of inter-stimulus interval
Application:Result%20Processing:StimulusTask int InterpretMode= 0 0 0 2 // interpretation of results: 0 none, 1 online free mode, 2 copy mode (enumeration)
Application:Result%20Processing:StimulusTask int DisplayResults= 0 1 0 1 // display results of copy/free spelling (boolean)
Application:Sequencing:StimulusPresentationTask intlist Sequence= 2 1 1 // Sequence in which stimuli are presented (deterministic mode)/ Stimulus frequencies for each stimulus (random mode)
Application:Sequencing:StimulusPresentationTask int SequenceType= 1 0 0 1 // Sequence of stimuli is 0 deterministic, 1 random (enumeration)
Application:Sequencing:StimulusPresentationTask int NumberOfSequences= 20 1 0 % // number of sequence repetitions in a run
Application:Sequencing:StimulusPresentationTask intlist ToBeCopied= 0 1 1 % // Sequence in which stimuli need to be copied (only used in copy mode)
Application:Sequencing:StimulusPresentationTask string UserComment= Left%20Hand%20vs.%20Right%20Hand // User comments for a specific run
Application:Stimuli:StimulusPresentationTask matrix Stimuli= { caption icon audio } { stimulus1 stimulus2 } LEFT%20HAND RIGHT%20HAND % % % % // captions and icons to be displayed, sounds to be played for different stimuli
Application:Stimuli:StimulusPresentationTask matrix FocusOn= { caption icon audio } { focuson } Please%20focus%20on images\focuson.bmp sounds\uh-uh.wav // initial announcement what to focus on
Application:Stimuli:StimulusPresentationTask matrix Result= { caption icon audio } { result } The%20result%20was images\result.bmp sounds\uh-uh.wav // final result announcement
Application:Stimuli:StimulusPresentationTask int StimulusWidth= 0 0 0 100 // StimulusWidth in percent of screen width (zero for original pixel size)
Application:Stimuli:StimulusPresentationTask int CaptionHeight= 10 0 0 100 // Height of stimulus caption text in percent of screen height
Application:Stimuli:StimulusPresentationTask string CaptionColor= 0x000000 0x00FFFFFF 0x00000000 0x00000000 // Color of stimulus caption text (color)
Application:Stimuli:StimulusPresentationTask string BackgroundColor= 0x80FF00 0x00FFFF00 0x00000000 0x00000000 // Color of stimulus background (color)
Application:Stimuli:StimulusPresentationTask int CaptionSwitch= 1 1 0 1 // Present captions (boolean)
Application:Stimuli:StimulusPresentationTask int IconSwitch= 0 1 0 1 // Present icon files (boolean)
Application:Stimuli:StimulusPresentationTask int AudioSwitch= 0 1 0 1 // Present audio files (boolean)
Application:Stimuli:StimulusPresentationTask float AudioVolume= 100 100 0 100 // Volume for audio playback in percent
Connector:ConnectorOutput string ConnectorOutputAddress= % localhost:20320 % % // IP address/port to write to, e.g. localhost:20320
Application:Localization:Localization string Language= Default Default % % // Language for user messages
Application:Localization:Localization matrix LocalizedStrings= { German } { TIME%20OUT%20!!! Waiting%20to%20start%20... } Zeit%20abgelaufen! Warte%20... // Localized user messages
System:Core%20Connections string ApplicationPort= 7772 4200 1024 65535 // the Application module's listening port
System:Core%20Connections string ApplicationIP= 127.0.0.1 127.0.0.1 % % // the Application module's listening IP
System:Configuration matrix ApplicationVersion= { Framework Revision Build } 1 2.1 2770,%202010/03/31%2019:27:09 2010/04/01%2017:40:40 // Application version information
System:Configuration matrix ApplicationFilterChain= 3 { Filter%20Name Position%20String } ConnectorInput 2.9999 StimulusPresentationTask 3 ConnectorOutput 3.9999 // Application filter chain


thank you

Young Hak Shin

jawilson
Posts: 109
Joined: 28 Feb 2005, 16:31

Post by jawilson » 22 Jul 2010, 08:27

Ok, a few things:

1. I would use labels for your ChannelNames, to make sure that the channels are in the right order, e.g.,

Code: Select all

 ChannelNames= 12 F3 F4 P3 P4 C3 Cz C4...
(I'm not sure what order your channels are in, so adjust this accordingly).

2. Do you have a low impedance EEG headstage? If so, then

Code: Select all

 TDTgain= 50000
, not 1000000.

3. I would imagine that

Code: Select all

SourceChList
is the source of the problem somehow. Are you SURE that the channels are in the right order?

Maybe you could set up the system by connecting the EEG cap to the headstage, connect all of the wires, etc, and take a picture of it, send it to me, so I have a better idea of all the components you are working with. Or, if you have the specifications for the EEG cap you are using (e.g., which wires/connectors correspond with which electrodes), that would help as well. Finally, are you using any of the items on this page: http://www.tdt.com/products/headstages_low.htm. If so, let me know which ones.

Seung-Chan Lee
Posts: 10
Joined: 16 Jul 2010, 09:08

Post by Seung-Chan Lee » 22 Jul 2010, 11:17

Hello.

Thank you for your reponse Adam.
I am coworker with Young Hak Shin.

I would like to explain our hardware setting.

First, we used TDT RZ2 processor and PZ3 low impedance amplifier.
But, We do not use the headstage.
Since we do not use headstage, So acording to your guidence, we use 1000000 TDT gain to convert from micro volt unit to volt unit scale.
I think that is no problem. Is this right?
Here is part of your response about TDTgain.
The gain factor is designed to convert from A/D units to microvolts (muV). The values acquired by the TDT are in volts, so we need to multiply by 1e6 to get the units in muV. However, if you have a low-impedance headstage, as you should with EEG, this provides a 20x gain prior to digitization. Therefore, the value for the TDTgain should be 50000, since 50000*20 = 1,000,000, which gets your units in muV. If you DON’T have a headstage, then TDTgain should be 1000000. The SourceChGain should just be 1.
Here are our device pictures.
Image
This is RZ2 base station.(processor)

Image
This is PZ3 low impedance amplifier and S-BOX signal spliter.
The role of the S-BOX is just split the signal and connect between electrodes and amplifier.

Image
S-BOX have 32 channels and common reference mode only.

Image
We use wire electrodes 12 channels + reference 1 channel + GND 1 channel.

Image
We use from 9th to 20th channels.
(We think that the 1st -8th channels have more noise. connector's condition is not good. so we use 9 to 20 channels. channel mapping is correct.)

And, the PZ3 low impedance amplifier have two output per one channel.
Since we use common reference mode due to S-BOX signal spliter, the even channels are RMS values of the EEG signals and these are useless.
So, we use odd channels only.
And, the channels number are 17, 19, 21,...,39. These channel numbers are clearly correct.

And we used below montage for our experiment.
Image

Thank you.

Seung-Chan Lee.

Seung-Chan Lee
Posts: 10
Joined: 16 Jul 2010, 09:08

Post by Seung-Chan Lee » 27 Jul 2010, 00:04

I have a another question about spectra channel plot.

Here is offline analysis result and spectra channel plot is just right down.
Image

I wonder that what is the mean of Y axis of spectra channel 6 plot.
The maximum value of Y axis is approximately 70000.
How calculate this value like there?

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

Post by mellinger » 03 Aug 2010, 10:54

Units in spectra plots are muV/sqrt(Hz). As Adam pointed out, your gain value is too high. With the correct gain value, the peak in the spectrum would be at 3500 rather than 70000.

--Juergen

Seung-Chan Lee
Posts: 10
Joined: 16 Jul 2010, 09:08

Post by Seung-Chan Lee » 04 Aug 2010, 10:12

Hi.

Thank you for your response.
I have a another question about spectra channel plot.
In our result, the maximum value of spectra channel plot is about 70000.
I wonder how to calculate spectra channel value.
And what is mean of spectra channel value.
I don't know why we adjust spectrum would be 3500 rather than 70000.
Last edited by Seung-Chan Lee on 04 Aug 2010, 10:35, edited 1 time in total.

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

Post by mellinger » 04 Aug 2010, 10:25

What are you referring to by "mean of value of spectra channel value"?

Seung-Chan Lee
Posts: 10
Joined: 16 Jul 2010, 09:08

Post by Seung-Chan Lee » 04 Aug 2010, 11:19

I am sorry about mistake in my sentence.
Actually, the range of EEG signal is 10-100uV.
But the maximum value of Spectra Channel plot is almost 70000uV/square(Hz).
In spite of the small range of EEG signal, how do big value (70000uV/square(Hz)) can be calculated?
And what is meaning of 70000uV/square(Hz).

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

Post by mellinger » 04 Aug 2010, 11:35

Adam suggested that you use a TDTgain value of 50000 rather than 1e6. This would rescale the input signal by a factor of 200, resulting in an amplitude of 3500 muV/sqrt(Hz) (sqrt, not square). For a single sharp peak, as in your case, this is a reasonable value, as the energy of the signal is concentrated around a single frequency.

Seung-Chan Lee
Posts: 10
Joined: 16 Jul 2010, 09:08

Post by Seung-Chan Lee » 09 Aug 2010, 08:29

Thank you for response. I have another question about calculation.
I don't know how can that value(3500 muV/sqrt(Hz)) be calculated?
How to determine that value?
I want to know process of calculation (or calculation step).

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

Post by mellinger » 30 Aug 2010, 11:43

Spectra are calculated by first fitting an autoregressive (AR) model to the data, using the MEM/Burg algorithm. Typically, the AR model order is 16 or 20. Then, the AR model is evaluated for amplitude over the frequency range of interest, and the resulting spectra are averaged over the segments for which they were calculated.

Just as it happens with Fourier-calculated spectra, amplitudes in the frequency domain may by far exceed amplitudes in the time domain if signal energy is concentrated around certain frequencies.

Locked

Who is online

Users browsing this forum: No registered users and 1 guest