vector_phase.py
This commit is contained in:
parent
c3c95e8c98
commit
74b523eba1
@ -52,5 +52,9 @@ for i, idx in enumerate(eod_idx):
|
||||
#embed()
|
||||
#exit()
|
||||
plt.plot(time[int(idx):int(eod_idx[i+1])], eod[int(idx):int(eod_idx[i+1])])
|
||||
|
||||
|
||||
|
||||
|
||||
plt.show()
|
||||
|
||||
|
@ -5,4 +5,14 @@ def zero_crossing(eod,time):
|
||||
threshold = 0;
|
||||
shift_eod = np.roll(eod, 1)
|
||||
eod_times = time[(eod >= threshold) & (shift_eod < threshold)]
|
||||
return eod_times
|
||||
sampling_rate = 40000.0
|
||||
eod_idx = eod_times*sampling_rate
|
||||
return eod_idx
|
||||
|
||||
|
||||
def vector_strength(spike_times, eod_durations)
|
||||
alphas = spike_times/ eod_durations
|
||||
cs = (1/len(spike_times))*np.sum(np.cos(alphas))^2
|
||||
sn = (1/len(spike_times))*np.sum(np.sin(alphas))^2
|
||||
vs = np.sprt(cs+sn)
|
||||
return vs
|
||||
|
Loading…
Reference in New Issue
Block a user