Matlab code for experiments

%%
loadaerdat; % loads retina data from a recorded .dat file. Raw addreses are allAddr, timestamps in us are allTs%%
x=64;
y=64;
p=1;
ra=p+bitshift(x,1)+bitshift(y,8); % compute the raw address of pixel x,y=64,64 with polarity=1 (on)%%
ind=find(ra==allAddr); % find the indices of all the spikes from this pixel
allTs(ind)% print the timestamps%% iterate of a block of pixels and store the number of spikes from each pixel in a vector c, then histogram these counts
c=[];
fori=0:1for t=48:96
x=t;
y=t;
p=i;
ra=p+bitshift(x,1)+bitshift(y,8);
ind=find(ra==allAddr);
res=allTs(ind);
c=[c length(ind)];
endend