ucdavis / erplab

ERPLAB Toolbox is a free, open-source Matlab package for analyzing ERP data. It is tightly integrated with EEGLAB Toolbox, extending EEGLAB’s capabilities to provide robust, industrial-strength tools for ERP processing, visualization, and analysis. A graphical user interface makes it easy for beginners to learn, and Matlab scripting provides enormous power for intermediate and advanced users.
http://erpinfo.org/erplab
267 stars 73 forks source link

How does ERPlab detect a peak ? #171

Closed MalikaAS closed 1 year ago

MalikaAS commented 1 year ago

Description

Hi all, I am using the ERP measurement tool to measure peak amplitudes (through the GUI as well as through a script with the "peakampbl" function). If no local peak is found, I instruct ERPlab to display "NaN" so that I know that there is no peak. From what I read in the description of the "peakampbl" function, it is supposed to "find the relative-to-baseline peak (or valley) value between two latencies", so I understand that it detects peaks that are above the baseline. However, sometimes, it detects and measures a peak even if it is below the baseline / within the range of the baseline variability (see image below). Image1 Did I misundertsand how this function works ? Which criteria does ERPlab use to determine if a given wave in the signal is considered a peak ? Understanding this would be very helpful.

Thank you for your time !


Versions

OS version [fill in]
Matlab version [2021b]
EEGLAB version [2022.1]
ERPLAB version [9.00]
stevenjluck commented 1 year ago

Thanks for contacting us. You can find the details about how the measurements are obtained in our manual page for the ERP Measurement Tool: https://github.com/ucdavis/erplab/wiki/ERP-Measurement-Tool

If you attempt to measure the peak amplitude, and you indicate that you are searching for a positive peak, it will find the most positive voltage within the specified time window (where the voltage is quantified relative to the mean voltage during the baseline period). If the most positive voltage is negative, you get a negative value.

It also has an option to specify a “local peak”, which means that the voltage must also be more positive than the average of the N points on either side. When there is no peak that meets this criterion, you get a NAN.

I hope this helps!

Steve

From: MalikaAS @.> Date: Monday, June 19, 2023 at 6:56 AM To: ucdavis/erplab @.> Cc: Subscribed @.***> Subject: [ucdavis/erplab] How does ERPlab detect a peak ? (Issue #171) Description

Hi all, I am using the ERP measurement tool to measure peak amplitudes (through the GUI as well as through a script with the "peakampbl" function). If no local peak is found, I instruct ERPlab to display "NaN" so that I know that there is no peak. From what I read in the description of the "peakampbl" function, it is supposed to "find the relative-to-baseline peak (or valley) value between two latencies", so I understand that it detects peaks that are above the baseline. However, sometimes, it detects and measures a peak even if it is below the baseline / within the range of the baseline variability (see image below). [Image1]https://user-images.githubusercontent.com/124046494/246819839-a8e9f92c-4296-4254-8faa-97dcd172e99c.png Did I misundertsand how this function works ? Which criteria does ERPlab use to determine if a given wave in the signal is considered a peak ? Understanding this would be very helpful.

Thank you for your time !

Versions

OS version [fill in] Matlab version [2021b] EEGLAB version [2022.1] ERPLAB version [9.00]

— Reply to this email directly, view it on GitHubhttps://github.com/ucdavis/erplab/issues/171, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC67QFY6JZHAKQYKKHNDOWDXMBLBTANCNFSM6AAAAAAZL7RA4E. You are receiving this because you are subscribed to this thread.Message ID: @.***>

MalikaAS commented 1 year ago

Hi Steve,

Sorry I forgot to reply. Thank you so much for your answer, it is much clearer now.

Best regards,

Malika

Malika AZAROUAL-SENTUCQ _____

PhD Student Integrative, Multisensory, Perception, Action & Cognition (Impact) Team Lyon Neuroscience Research Center (CRNL), Inserm @.***


De : stevenjluck @.***> Envoyé : lundi 19 juin 2023 18:51:37 À : ucdavis/erplab Cc : MALIKA AZAROUAL; Author Objet : Re: [ucdavis/erplab] How does ERPlab detect a peak ? (Issue #171)

Thanks for contacting us. You can find the details about how the measurements are obtained in our manual page for the ERP Measurement Tool: https://github.com/ucdavis/erplab/wiki/ERP-Measurement-Tool

If you attempt to measure the peak amplitude, and you indicate that you are searching for a positive peak, it will find the most positive voltage within the specified time window (where the voltage is quantified relative to the mean voltage during the baseline period). If the most positive voltage is negative, you get a negative value.

It also has an option to specify a “local peak”, which means that the voltage must also be more positive than the average of the N points on either side. When there is no peak that meets this criterion, you get a NAN.

I hope this helps!

Steve

From: MalikaAS @.> Date: Monday, June 19, 2023 at 6:56 AM To: ucdavis/erplab @.> Cc: Subscribed @.***> Subject: [ucdavis/erplab] How does ERPlab detect a peak ? (Issue #171) Description

Hi all, I am using the ERP measurement tool to measure peak amplitudes (through the GUI as well as through a script with the "peakampbl" function). If no local peak is found, I instruct ERPlab to display "NaN" so that I know that there is no peak. From what I read in the description of the "peakampbl" function, it is supposed to "find the relative-to-baseline peak (or valley) value between two latencies", so I understand that it detects peaks that are above the baseline. However, sometimes, it detects and measures a peak even if it is below the baseline / within the range of the baseline variability (see image below). [Image1]https://user-images.githubusercontent.com/124046494/246819839-a8e9f92c-4296-4254-8faa-97dcd172e99c.png Did I misundertsand how this function works ? Which criteria does ERPlab use to determine if a given wave in the signal is considered a peak ? Understanding this would be very helpful.

Thank you for your time !

Versions

OS version [fill in] Matlab version [2021b] EEGLAB version [2022.1] ERPLAB version [9.00]

— Reply to this email directly, view it on GitHubhttps://github.com/ucdavis/erplab/issues/171, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC67QFY6JZHAKQYKKHNDOWDXMBLBTANCNFSM6AAAAAAZL7RA4E. You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/ucdavis/erplab/issues/171#issuecomment-1597485403, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A5SMZHWPR7DTCC3XG6OUZNLXMB7RTANCNFSM6AAAAAAZL7RA4E. You are receiving this because you authored the thread.Message ID: @.***>