jAER project on SourceForge

net.sf.jaer.eventprocessing.filter
Class RepetitiousFilter

java.lang.Object
  extended by net.sf.jaer.eventprocessing.EventFilter
      extended by net.sf.jaer.eventprocessing.EventFilter2D
          extended by net.sf.jaer.eventprocessing.filter.RepetitiousFilter
All Implemented Interfaces:
java.util.Observer

public class RepetitiousFilter
extends EventFilter2D
implements java.util.Observer

An AE filter that filters out boring repetitive events. It does this by maintaining an internal map of boring cells (x,y,type). These are boring because they are repetitive. An event is passed through if its interspike interval (the time since the last event for this cell) is different by a factor of more than ratioShorter to the previous interspike interval. This average dt has a smoothing 'time constant' averagingSamples.

The switch passRepetitiousEvents passes only repetitious events in case those are the interesting ones.

Fires PropertyChangeEvent for the following

Author:
tobi

Field Summary
protected  int averagingSamples
          the number of packets processed to average over
protected  int minDtToStore
          the minimum dt to record, to help reject multiple events from much slower stimulus variation (e.g.
protected  int ratioLonger
          factor different than previous dt for this cell to pass through filter
protected  int ratioShorter
          factor different than previous dt for this cell to pass through filter
 
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter2D
enclosedFilter, out
 
Fields inherited from class net.sf.jaer.eventprocessing.EventFilter
annotationEnabled, chip, enclosedFilterChain, filterEnabled, log, perf, propertyTooltipMap, support
 
Constructor Summary
RepetitiousFilter(AEChip chip)
           
 
Method Summary
 EventPacket filterPacket(EventPacket in)
          Subclasses implement this method to define custom processing.
 int getAveragingSamples()
           
static java.lang.String getDescription()
           
 int[][][][] getFilterState()
          returns array of last event times, x,y,type,[t0,t1], where t0/t1 are the last two event times, t0 first.
 int getMinDtToStore()
           
 boolean getPassRepetitiousEvents()
           
 int getRatioLonger()
           
 int getRatioShorter()
           
 void initFilter()
          this should allocate and initialize memory: it may be called when the chip e.g.
 boolean isGeneratingFilter()
           
 void resetFilter()
          should reset the filter to initial state
 void setAveragingSamples(int averagingSamples)
          sets the number of packets to smooth dt for a pixel over
 void setMinDtToStore(int minDtToStore)
           
 void setPassRepetitiousEvents(boolean passRepetitiousEvents)
           
 void setRatioLonger(int ratioLonger)
           
 void setRatioShorter(int ratioShorter)
           
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter2D
checkOutputPacketEventType, checkOutputPacketEventType, getEnclosedFilter, resetOut, setEnclosedFilter, setFilterEnabled
 
Methods inherited from class net.sf.jaer.eventprocessing.EventFilter
getChip, getEnclosedFilterChain, getEnclosingFilter, getPrefs, getPropertyChangeSupport, getPropertyTooltip, isAnnotationEnabled, isEnclosed, isFilterEnabled, prefsEnabledKey, setAnnotationEnabled, setChip, setEnclosed, setEnclosedFilter, setEnclosedFilterChain, setEnclosingFilter, setPreferredEnabledState, setPrefs, setPropertyTooltip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ratioShorter

protected int ratioShorter
factor different than previous dt for this cell to pass through filter


ratioLonger

protected int ratioLonger
factor different than previous dt for this cell to pass through filter


minDtToStore

protected int minDtToStore
the minimum dt to record, to help reject multiple events from much slower stimulus variation (e.g. 50/100 Hz)


averagingSamples

protected int averagingSamples
the number of packets processed to average over

Constructor Detail

RepetitiousFilter

public RepetitiousFilter(AEChip chip)
Method Detail

getDescription

public static java.lang.String getDescription()

isGeneratingFilter

public boolean isGeneratingFilter()

getFilterState

public int[][][][] getFilterState()
returns array of last event times, x,y,type,[t0,t1], where t0/t1 are the last two event times, t0 first.

Specified by:
getFilterState in class EventFilter

resetFilter

public void resetFilter()
Description copied from class: EventFilter
should reset the filter to initial state

Specified by:
resetFilter in class EventFilter

getAveragingSamples

public int getAveragingSamples()

setAveragingSamples

public void setAveragingSamples(int averagingSamples)
sets the number of packets to smooth dt for a pixel over


getMinDtToStore

public int getMinDtToStore()

setMinDtToStore

public void setMinDtToStore(int minDtToStore)

getRatioShorter

public int getRatioShorter()

setRatioShorter

public void setRatioShorter(int ratioShorter)

getRatioLonger

public int getRatioLonger()

setRatioLonger

public void setRatioLonger(int ratioLonger)

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

initFilter

public void initFilter()
Description copied from class: EventFilter
this should allocate and initialize memory: it may be called when the chip e.g. size parameters are changed after creation of the filter

Specified by:
initFilter in class EventFilter

filterPacket

public EventPacket filterPacket(EventPacket in)
Description copied from class: EventFilter2D
Subclasses implement this method to define custom processing.

Specified by:
filterPacket in class EventFilter2D
Parameters:
in - the input packet
Returns:
the output packet

getPassRepetitiousEvents

public boolean getPassRepetitiousEvents()

setPassRepetitiousEvents

public void setPassRepetitiousEvents(boolean passRepetitiousEvents)

jAER project on SourceForge