and then aggregate the result to have `nbins` total values.
f, x = np.histogram(t, bins=conv_oversample * nbins)
g = np.convolve(f, f[::-1])[len(f) - 1:] // Discard negative domain
g[0] -= len(t) // First bin is double-counted because of i=j terms
hist = g.reshape((-1, conv_oversample)).sum(axis=1) // Combine bins
return hist
def normalize_hist(hist, total_time):
Normalize histogram such that integral from t_min to t_max equals 1.