demo code to estimate spike rates