> For the complete documentation index, see [llms.txt](https://nigelrogasch.gitbook.io/tesa-user-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nigelrogasch.gitbook.io/tesa-user-manual/find_and_mark_tms_pulse.md).

# Find and mark TMS pulses

To generate TMS-evoked potentials from EEG recordings, an accurate record of precisely when the TMS pulse was given is required. However, recording TMS triggers in EEG may not always be available due to the experimental arrangement or simply human error. TESA has several functions which use the large TMS pulse recording artifact to detect and mark when TMS pulses occur.

## Finding TMS pulses in continuous data

The [tesa\_findpulse](/tesa-user-manual/find_and_mark_tms_pulse/find_tms_pulse.md) function is useful when no trigger events have been recorded and searches for large rate changes in EEG amplitude during continuous EEG recordings.

&#x20;

![](/files/-LmJDGnfZZry9zh9OvHL)

**Example of TMS pulses found using tesa\_findpulse.** TMS events are now stored in the EEGLAB data structure.

## Correcting TMS event latencies

If TMS trigger events were recorded, however these triggers did not accurately mark the TMS pulse onset, the [tesa\_fixevent](/tesa-user-manual/find_and_mark_tms_pulse/fix_tms_pulse.md) function corrects TMS trigger event latency on epoched EEG data.

&#x20;

![](/files/-LmJDGnheLBlbL2M5w-q)

**Example of TMS event latencies corrected using tesa\_fixevent.** Original event latencies on the left were approximately 7 ms earlier than the actual TMS pulse. This latency was corrected by tesa\_fixevent on right.
