Designing Time Histograms
Learn how to choose the right time-histogram measurement type, bin width and number of bins for your experiment.
Designing a time-histogram measurement involves two decisions: which measurement class fits your start/stop scenario, and what bin width and number of bins to use. This article covers both.
Choosing a Measurement Type
A measurement is of single-start/single-stop type when only the time difference between each stop click and the preceding start click is considered and accumulated into the histogram. A multiple-start/multiple-stop measurement instead considers the time differences between every start click and every stop click, provided the difference falls within the measurement’s time span.
Separately, unidirectional measurements only accumulate the time difference from a start click to a later stop click (always zero or positive), while bidirectional measurements (Correlation, CorrelationPairs) treat every click as both a start and a stop, computing both positive and negative time differences. This is the standard approach for a full auto- or cross-correlation measurement.
| Time Histograms | Unidirectional (stop after start) | Bidirectional |
| Single start / single stop | StartStop, Histogram2D, HistogramND | |
| Multiple start / multiple stop | Histogram, HistogramLogBins, HistogramCustomBins, TimeDifferences, TimeDifferencesND | Correlation, CorrelationPairs |
| Single start / multiple stop | Hist2D_single_start_multiple_stop.py |
With this distinction in mind, here is how the available classes relate to each other, roughly from simplest to most specialized.
StartStop is the simplest case: a single-start/single-stop histogram with an unlimited range that grows to fit the largest time difference observed, reporting only non-empty bins.
Histogram2D and HistogramND extend that same single-start/single-stop idea to two, or arbitrarily many, dimensions, correlating one start click against stop clicks on two or more separate channels, useful for measurements like 2D correlation spectroscopy.
Histogram is the standard multiple-start/multiple-stop measurement, accumulating a single histogram between a start and a click channel. Its more general form, TimeDifferences, can instead record a whole array of histograms in sequence, for example one per pixel of a scanned image, by stepping to the next histogram on a marker channel; TimeDifferencesND extends this further to multiple stop channels. This array-of-histograms pattern is also what powers the dedicated Flim and FlimBase classes for fluorescence-lifetime imaging, which wrap the same underlying mechanism behind a purpose-built, high-level interface for line-scan imaging.
Correlation and CorrelationPairs switch to the bidirectional case described above. CorrelationPairs is the multi-channel generalization of Correlation: instead of correlating a single pair of channels, it accumulates pairwise correlations across every pair within a list of channels, with better performance than running one Correlation instance per pair.
HistogramLogBins and HistogramCustomBins address the opposite extreme: measurements spanning many decades, or needing arbitrary, manually chosen bin edges. Because their evaluation cost scales with both the event rate and the number of bins, they only perform well with a moderate bin count, up to a few hundred, so log-spaced or custom bin edges let you cover a huge dynamic range without needing millions of tiny bins.
Finally, for a single-start/multiple-stop histogram, a case not covered by any built-in class, the example script Hist2D_single_start_multiple_stop.py in our Time Tagger Custom Measurements repository is a good starting point.
Choosing an Appropriate Bin Width
With our Time Tagger you can choose any bin width in the range from 1 ps to more than a day. The entire range is adjustable with one picosecond resolution. In addition to the number of bins, this setting determines the maximum time difference that you measure. This flexibility allows you to choose a proper bin width purely based on the requirements of your experiment.
The following questions may help you identify and decide on the optimal bin width value for your measurement:
1. What is the maximum time difference you want to measure?
histogram_span = binwidth × n_bins
Large values of n_bins require more memory, so you may want to trade off bin width for fewer bins if you are measuring very long time differences. As a general guideline, n_bins < 1e7 is usually acceptable for measurements created in Time Tagger Lab/Python/MATLAB/LabVIEW/C++/C# etc.
Bin edges are internally represented as 64-bit integer timestamps in picoseconds (the same representation used for time tags themselves). If you convert these to 32-bit single-precision floats at any point in your analysis or plotting pipeline, for instance through an unintended cast, note that a single-precision float can only represent integers exactly up to about 1.7×10⁷. Since bin edges are in picoseconds, this range is exceeded by any histogram spanning more than about 17 microseconds, which is a very common case, and the returned bin positions will start to show visible rounding errors. To avoid this, keep bin edges and other timestamp values in 64-bit integer or double-precision form throughout your analysis.
2. What time resolution do you expect from your measurement?
Smaller bin widths will give you finer digital resolution of a histogram, however, the actual resolution is limited by the inherent time measurement uncertainty (timing jitter). The minimum timing jitter values are:
- 34 ps RMS for Time Tagger 20
- 3-8 ps RMS for Time Tagger Ultra
- 1.5-2 ps RMS for Time Tagger X
Additionally, any other component in your setup, such as detectors or other electronics, introduces further timing uncertainty into your measurement. To account for this, you may choose a bin width slightly smaller than the total timing uncertainty in your experiment. For example, with the Time Tagger 20, a bin width of ≥ 10 ps is a good choice.
3. What signal-to-noise ratio (SNR) do you want to achieve, and in what time?
Smaller bin widths require more time to accumulate enough counts to achieve the desired noise level compared to larger bin widths. This is due to shot noise, which is proportional to 1/√N, where N is the number of counts in a single bin. This concept is similar to how SNR improves through averaging. Larger bin widths naturally result in higher counts per bin in a shorter time for the same signal rate.
In short: choose a bin width comfortably smaller than your total timing uncertainty so it does not add its own significant broadening, but not so small that you both run into the memory/precision limits above and need impractically long acquisition times to reach adequate statistics.