Menu

Reading data into Matlab from jAER data files

matlab (1)
Tobi Delbruck Luca Longinotti

This page describes how to read data recorded from jAER to .aedat files into matlab.

These matlab scripts are in the working copy folder https://svn.code.sf.net/p/jaer/code/scripts/matlab .

Reading raw events into matlab

Use the function loadaerdat.m

Writing a .dat file from matlab that can be sequenced or viewed

Use the function saveaerdat.m

Extracting raw events to x,y,type

You need to bitand and bitshift if you want to do this in matlab, or you can use the EventExtractor that goes with each chip class. Using the java class is faster but may fragment matlab memory.
* For matlab example, see the function
http://svn.code.sf.net/p/jaer/code/scripts/matlab/retina/extractRetina128EventsFromAddr.m
* For java class usage, examine the following example

chip=ch.unizh.ini.caviar.chip.retina.Tmpdiff128;
extractor=chip.getEventExtractor; % get the extractor object from this chip.
% now you can use the extractor to extract a packet of events or you can use the methods directly
x=extractor.getXFromAddress(raw); % raw is a raw AE address
y=extractor.getYFromAddress(raw)
type=extractor.getTypeFromAddress(raw)

Translating x,y,type to raw address to filter specific cells in matlab

You can use a function like this one, which is correct for tmpdiff128. Note how the x address is flipped because that is how it is rendered in java to make it rightside up (Java puts the origin at UL corner and increases x rightwards and y downwards.)

function raw=getraw(x,y,pol)
raw=(y)*256+(127-x)*2+pol; %extractor.getAddressFromCell(x,y,pol);

Controlling biases from matlab

Using a UDP connection to a running AEViewer or to control the chip or system configuration (i.e. biases)

This is the best way to control biases and the AEViewer now from an external process. See [Interfacing to jAER].


Related

Wiki: Home
Wiki: Interfacing to jAER