Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Spike Extraction parameters #415

Open
myagmur01 opened this issue Apr 13, 2021 · 1 comment · May be fixed by #641
Open

[Doc] Spike Extraction parameters #415

myagmur01 opened this issue Apr 13, 2021 · 1 comment · May be fixed by #641
Assignees
Labels
documentation Indicates a need for improvements or additions to documentation question

Comments

@myagmur01
Copy link

myagmur01 commented Apr 13, 2021

Hi @mdenker

I am using elephant.spike_train_generation.spike_extraction function for my MEA 96-channel signal.
I have following questions:

  1. Why default values are selected as [-2ms, 4ms]

  2. What is exactly the time_interval here?
    When I set it to [-10 ms,10 ms] or [0 ms, 10 ms] or [5 ms,15 ms] I get the same results of spike times as below. Could you explain me if I am doing something wrong?

spikes for [-10 ms,10 ms] =  [0.4288     5.9382     6.91823333 6.91963333 6.9386     7.71603333
 7.73576667 8.18213333 8.29553333 8.3024     8.30493333 8.31963333] s 

spikes for [0 ms, 10 ms] = [0.4288     5.9382     6.91823333 6.91963333 6.9386     7.71603333
 7.73576667 8.18213333 8.29553333 8.3024     8.30493333 8.31963333] s 

spikes for [5 ms,15 ms] = [0.4288     5.9382     6.91823333 6.91963333 6.9386     7.71603333
 7.73576667 8.18213333 8.29553333 8.3024     8.30493333 8.31963333] s 

Thank you

@mdenker
Copy link
Member

mdenker commented Apr 14, 2021

Hi @mytrjp ,

both questions relate to the spike waveforms which are extracted from the signal, i,e., the cutout of the signal around each spike.

The time_interval specifies the cut-out interval around each spike. -2 and 4 is of course somewhat arbitrary, however, many spike sorting tools choose values in this range: the spike is about 1-2 ms in length, and then you take a bit before the spike peak, and a bit more after the spike peak (to catch the dynamics after the spike).

If you set the time_stamps to None, peaks are extracted using numpy's peak finder. Therefore, the spike times will always be the same. However, the waveforms stored in the spike train (in spikes.waveforms, an NxM matrix for the N spikes, each row containing a waveform) should be different: In the first example, they should range from -10ms to 10ms, in the last example they should be from 5 to 15 ms. Thus, as an example, if the sampling frequency is 10KHz, and 123 spikes where detected, then spikes.waveforms should be size 123x200 for the first example.

I hope this helps. Thanks for asking this, I will keep this issue open as a reminder to augment the documentation to better explain this.

@mdenker mdenker added question documentation Indicates a need for improvements or additions to documentation labels Apr 14, 2021
@Moritz-Alexander-Kern Moritz-Alexander-Kern added this to the v0.11.0 milestone Nov 22, 2021
@Moritz-Alexander-Kern Moritz-Alexander-Kern modified the milestones: v0.11.0, v0.12.0 Feb 4, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern changed the title Spike Extraction parameters [Doc] Spike Extraction parameters Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Indicates a need for improvements or additions to documentation question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants