-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_simulation.py
More file actions
38 lines (27 loc) · 1.1 KB
/
Copy pathtest_simulation.py
File metadata and controls
38 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import numpy as np
import matplotlib.pyplot as plt
from utils import read_mat_file, read_binary_file, spike_data_from_channels, avg_spikes_channels, avg_multiple_spikes
num_spikes = 10000
spike_binary_file = read_binary_file('Spikes')
ch1_data, ch2_data, ch3_data, ch4_data,spike_data_4_channel = spike_data_from_channels(spike_binary_file ,
num_spikes,
'Spikes')
spike_time_binary_file = read_binary_file('SpikeTimes')
mat_data = read_mat_file('dataset_params')
ground_truth = np.array(mat_data['sp_u'][0][0][0][:num_spikes])
#print((spike_data_4_channel[1]))
unit_data = spike_data_4_channel[ground_truth==1]
avg_unit = np.sum(unit_data, axis=0)/num_spikes
plt.subplot(2,2,1)
plt.title('Channel 1')
plt.plot(avg_unit[:64])
plt.subplot(2,2,2)
plt.title('Channel 2')
plt.plot(avg_unit[64:128])
plt.subplot(2,2,3)
plt.title('Channel 3')
plt.plot(avg_unit[128:192])
plt.subplot(2,2,4)
plt.title('Channel 4')
plt.plot(avg_unit[192:256])
plt.show()