Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
technical:sliding_window [2019/09/25 14:58] chunchungtechnical:sliding_window [2021/10/12 15:15] (current) chunchung
Line 7: Line 7:
     Parameters     Parameters
     ----------     ----------
-    ts:  array time points +    ts:  Array of time points 
-    wsz: window size+    wsz: Window size 
 +     
 +    Returns 
 +    ------- 
 +    tss:    Array of time points 
 +    rates:  Firing rates at the time points
     '''     '''
-    tw = ts[0]-wsz+    tw = ts[0]-wsz # initialized with the time when the first event hits the window
     i0 = 0     i0 = 0
     i1 = 0     i1 = 0
Line 37: Line 42:
     tts.append(tw)     tts.append(tw)
     rrs.append(0)     rrs.append(0)
-    return np.array(tts)+wsz/2,np.array(rrs)/bsize+    return np.array(tts)+wsz/2,np.array(rrs)/wsz
 </code> </code>
 ====Example==== ====Example====