0
$\begingroup$

Suppose I have a list of times corresponding to event onset over the course of about an hour (in my case, skin conductance responses from electrodermal activity measurements). The amplitude of the spikes is arbitrary.

I would like to see when these events are most frequent as a measure of spikes per minute. I am thinking I'd like to do this using a moving average of the sum of spikes per minute.

I am thinking I can assign a value of 1 at each time point of event onset and then sum them up over the preceding minute, but don't know how to do this with a moving average.

edit: I suppose I can also calculate the frequency of points via Fourier, but not sure how to plot the change in frequency as a function of time.

$\endgroup$
2
  • 1
    $\begingroup$ What have you tried up to the point of plotting the change in frequency as a function of time? $\endgroup$
    – JimB
    Commented Apr 14, 2019 at 5:42
  • $\begingroup$ I haven't actually plotting change in frequency as a function of time yet. Do you know where I could start with this? $\endgroup$
    – user63997
    Commented Apr 18, 2019 at 5:20

1 Answer 1

1
$\begingroup$

If you have the time of the events in a list "data" then

clusters=Gather[data,Abs[#1-#2]<60&]
Mean/@Select[clusters,Length[#]>counts&]

will give you all occurrences where the rate exceeds counts/minute.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.