-
Notifications
You must be signed in to change notification settings - Fork 2
/
fanogram.m
42 lines (34 loc) · 904 Bytes
/
fanogram.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
function [ff,cv,af,time,position]=fanogram(cell,window,shift,wrapped,position)
%window=window*10;
%shift=shift*10;
if ~exist('position','var') || isempty(position)
position = 3; %measure time as end of window
end
if wrapped==1
maxtime=(cell.maxtime/cell.nummods)/10;
else
maxtime=cell.maxtime/10;
end
halfwindow = floor(window/2);
maxtime = maxtime - window;
shifts=floor(maxtime/shift)-1;
mint=0;
maxt=window;
time=zeros(shifts,1);
ff=zeros(shifts,1);
cv=zeros(shifts,1);
af=zeros(shifts,1);
for i=1:shifts
if position == 3
time(i)=maxt;
elseif position == 2
time(i)=mint+halfwindow;
else
time(i) = mint;
end
ff(i)=finderror(cell,'Fano Factor',mint,maxt,wrapped,0);
cv(i)=finderror(cell,'Coefficient of Variation',mint,maxt,wrapped,0);
af(i)=finderror(cell,'Allan Factor',mint,maxt,wrapped,0);
mint=mint+shift;
maxt=maxt+shift;
end