-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_data.m
51 lines (40 loc) · 880 Bytes
/
view_data.m
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
39
40
41
42
43
44
45
46
47
48
49
50
function view_data(LFP, TD)
Fs = 1250;
smoothing_width = 0.01; % 300 ms
kernel = gaussian(smoothing_width*Fs, ceil(8*smoothing_width*Fs));
hp_pyr = HPFilter(LFP, Fs, 7, 4);
pyr = BPfilter(LFP, 1250, 150, 250);
pyr2 = BPfilter(hp_pyr, 1250, 150, 250);
sq_pyr = pyr .^2;
sm_pyr = smoothvect(sq_pyr, kernel);
baseline = mean(sm_pyr);
thresh = baseline + std(sm_pyr)*6;
figure
for i = 1:50:length(LFP)
subplot(5,1,1)
view(hp_pyr, i)
title('LFP > 7 Hz');
subplot(5,1,2)
view(pyr, i)
title('LFP 150-250 Hz');
subplot(5,1,3)
view(sq_pyr, i)
title('LFP 150-250 Hz ^2');
subplot(5,1,4)
view(sm_pyr, i)
title('LFP 150-250 Hz Smoothed');
hline(thresh,'r--')
hline(baseline,'r:')
subplot(5,1,5)
view(TD, i)
title('TD state');
hline(0.5)
drawnow
pause(0.04)
end
end
function view(signal, i)
plot(signal(i:i+12500),'k')
xlim([0 1250])
%ylim([min([0, min(signal)]), max(signal)])
end