17  Smoothing (smooth)

import pynapple as nap
import numpy as np
times = np.arange(0, 10, 0.01)
signal = np.sin(2 * np.pi * times) 
signal += 0.2 * np.random.randn(len(times))
tsd = nap.Tsd(t=times, d=signal)
smoothed = tsd.smooth(std=0.1)
smoothed
Time (s)
-----------------  ---------
0.0                 0.225263
0.01                0.251728
0.02                0.279672
0.03                0.308966
0.04                0.339457
0.05                0.370967
0.06                0.4033
...
9.93               -0.402031
9.94               -0.369129
9.950000000000001  -0.337196
9.96               -0.306439
9.97               -0.277036
9.98               -0.24913
9.99               -0.222836
dtype: float64, shape: (1000,)