manual_EEG.cpp 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /* manual_EEG.cpp
  2. *
  3. * Copyright (C) 2012,2015 Paul Boersma
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "ManPagesM.h"
  19. void manual_EEG_init (ManPages me);
  20. void manual_EEG_init (ManPages me) {
  21. MAN_BEGIN (U"EEG", U"ppgb", 20180329)
  22. INTRO (U"EEG means electro-encephalography: brain potentials recorded via e.g. 32 or 64 electrodes on the scalp. "
  23. "In Praat, an EEG object looks like a combination of a Sound object with e.g. 32 or 64 channels "
  24. "and a TextGrid object that marks the events.")
  25. ENTRY (U"1. How to get an EEG object in Praat")
  26. NORMAL (U"You typically create an EEG object in Praat by opening a BDF/EDF file with @@Read from file...@. "
  27. "Praat tries to read the whole file into memory, so you may want to work with a 64-bit edition of Praat "
  28. "if you want to avoid \"out of memory\" messages.")
  29. NORMAL (U"After you do ##Read from file...#, an EEG object will appear in the list of objects.")
  30. ENTRY (U"2. How to look into an EEG object")
  31. NORMAL (U"Once you have an EEG object in the list, you can click ##View & Edit# to look into it. "
  32. "You will typically see the first 8 channels, but you scroll to the other channels by clicking on the up and down arrows. "
  33. "You can scroll and zoom in the same way as in a Sound window.")
  34. NORMAL (U"The channel names that you see are often A1, A2, ... A32, B1, B2, ... B32, C1, C2, ... C32, and so on. These represent the cap electrodes. "
  35. "If the number of cap electrodes is 32, though, the channel names are Fp1, AF3, ... Cz, "
  36. "and if it is 64, the channel names are Fp1, AF7, ... O2. You can change these names with "
  37. "##Set channel name...# from the #Modify menu.")
  38. NORMAL (U"Below the cap electrodes you may see a number of channels for the external electrodes. "
  39. "These are typically named EXG1, EXG2, ... EXG8, but you can change these names with ##Edit external electrode names...# "
  40. "from the #Modify menu.")
  41. NORMAL (U"Below the external electrodes you may see a number of special channels, "
  42. "perhaps named GSR1, GSR2, Erg1, Erg2, Resp, Plet, Temp, and Status. "
  43. "These represent recordings from other sensors than the electrodes.")
  44. NORMAL (U"The Status channel is special. It is the 8-bit digital signal that you fed to your EEG apparatus. "
  45. "When reading the BDF file, Praat extracts all 8 bits from this status signal, "
  46. "and these 8 bits are shown in the EEG window as TextGrid interval tiers named S1, S2, ... S8. "
  47. "These bits are the place to mark events. For instance, in our lab we use S8 to mark any event, "
  48. "S5 to mark a \"standard\" event, and S4 to mark a \"deviant\" event.")
  49. ENTRY (U"3. What to do to an EEG object")
  50. NORMAL (U"The raw EEG signal that you have read from a file is typically quite noisy and may have a very large "
  51. "DC (direct-current) component as compared to the small vibrations that you are interested in. "
  52. "There are several ways to clean it up.")
  53. NORMAL (U"##Subtracting a reference signal.# The voltage on the whole scalp may rise and fall in time. "
  54. "You are unlikely to be interested in these global movements; instead, you are likely to be interested only "
  55. "in the voltage movements on the brain-influenced part of the scalp (the cap electrodes) "
  56. "with respect to the voltage movements on the non-brain-influenced part of the scalp (the external electrodes). "
  57. "If you have external electrode recordings that include the left and right mastoids, you can use these channels as a %%reference signal%, i.e., "
  58. "you can use ##Subtract reference...# to subtract the average of the two mastoid channels from all electrode channels (including the external electrodes themselves). "
  59. "If you have no such recordings, you can still regard the average of a range of electrode channels as a reference signal, "
  60. "and use ##Subtract mean channel...# to subtract this from each electrode channel.")
  61. NORMAL (U"##Detrending.# With #Detrend, you subtract from each electrode channel a line in such a way that the first sample and the last sample become zero. "
  62. "Detrending and reference subtraction can be performed in either order.")
  63. NORMAL (U"##Filtering.# With ##Filter...#, you band-pass filter each electrode channel. Filtering has to be done after detrending, but "
  64. "filtering and reference subtraction can be performed in either order.")
  65. ENTRY (U"4. How to do an ERP analysis")
  66. NORMAL (U"An ERP is an Event-Related Potential. Events are marked somewhere in S1, S2, ... S8. In the above example, "
  67. "we extract all the \"deviant\" events by doing ##To ERPTier...#, setting ##From time# to -0.11 seconds, "
  68. "##To Time# to 0.39 seconds, and ##Marker bit# to 4. This way, an ERPTier object appears in the list, containing "
  69. "the parts of the EEG signal that lie in a time window of [-0.11, 0.39] seconds around each event on the S4 (deviant) tier. "
  70. "Thus, if S4 contains 150 events, the resulting ERPTier will contain 150 pieces of the original EEG signal (without the extra sensors).")
  71. NORMAL (U"You are typically interested in the part of each ERP in the ERPTier after the event. "
  72. "That is, you are probably interested in how this part compares to the part not influenced by the event, "
  73. "i.e. the part before the event. To make this comparison easier, you can do ##Subtract baseline...#: "
  74. "the waveform of the ERP will be moved up or down in such a way that the average amplitude of the part between the specified times becomes zero; "
  75. "the times you will typically fill in here are the starting time of the ERP (a negative number) and the time of the event (0.0).")
  76. NORMAL (U"After you subtract the baseline, the part after the event contains the interesting part of the ERP: "
  77. "even its sign (positive or negative) is meaningful now. Some ERPs, however, will contain very large positive or negative peaks "
  78. "because of eye movements and other disturbing signals. To remove those ERPs from the ERPTier, "
  79. "do ##Reject artefacts...#, while specifying the amount by which you allow the amplitude of an ERP to go above or below zero.")
  80. NORMAL (U"Once you have an ERPTier, you can extract each of the 150 ERPs from it with ##Extract ERP...#. "
  81. "It is perhaps more interesting to compute the average of all those 150 ERPs with ##To ERP (mean)#. "
  82. "These commands put a new ERP object in the list.")
  83. NORMAL (U"Once you have an ERP object, you can look into it with ##View & Edit#. "
  84. "If you want to see in the ERP window the scalp distribution at the time of the cursor, or the average scalp distribution in the selected time stretch, "
  85. "you have to switch on ##Show selection viewer# in the #Preferences window (available from the #File menu).")
  86. ENTRY (U"See also")
  87. LIST_ITEM (U"\\bu @@Independent Component Analysis on EEG@")
  88. MAN_END
  89. MAN_BEGIN (U"Independent Component Analysis on EEG", U"ppgb", 20180502)
  90. INTRO (U"Independent Component Analysis (ICA) is often used to improve @EEG signals. "
  91. "See @@blind source separation@ for the algorithm.")
  92. ENTRY (U"1. Selecting your channels")
  93. NORMAL (U"You typically will not want to do ICA on all 80 channels of your signal, "
  94. "some of which may not even be EEG channels. To create a smaller EEG with e.g. only the 64 scalp channels, "
  95. "use ##EEG: Extract channels...#. From here on we will assume that your reduced EEG has 64 channels.")
  96. ENTRY (U"2. How to get a MixingMatrix")
  97. NORMAL (U"Once you have your reduced EEG, you can start to do ICA on it. "
  98. "This starts by creating a @MixingMatrix: select your EEG object and choose ##To MixingMatrix...#. "
  99. "The resulting MixingMatrix has one row for each of your 64 EEG channels, and columns called \"ic1\" through \"ic64\".")
  100. ENTRY (U"3. How to see the independent components")
  101. NORMAL (U"Select your EEG and your MixingMatrix together and choose ##Unmix#. "
  102. "The resulting ICA-EEG will have 64 channels called \"ic1\" through \"ic64\".")
  103. ENTRY (U"4. Just checking back")
  104. NORMAL (U"If you select your ICA-EEG together with your MixingMatrix and choose ##Mix#, "
  105. "the resulting EEG should be very similar to your original 64-channel EEG.")
  106. MAN_END
  107. }
  108. /* End of file manual_EEG.cpp */