The phase difference between the object (O) and reference (R) channels is determined here using the discrete Fourier transform (DFT) -an approach that benefits from good noise rejection and low computational demands. In brief, for each channel, we use the amplitude spectrum of the DFT to estimate the fundamental frequency 𝑓 * of the signal, and interpolate the phase spectrum to 𝑓 * to determine the absolute phases 𝜙 𝐨 and 𝜙 𝐫 . The phase difference 𝜙 between the two channels is given by 𝜙 = 𝜙 𝐨 -𝜙 𝐫 . The phase calculations are carried out in real-time on a low-cost microcontroller, using a version of the DFT known as the sliding DFT (sDFT). Unlike the more common fast Fourier transform (FFT), which calculates the full DFT in a single shot once data acquisition has been completed, the sDFT spreads the computational effort over the full data acquisition cycle, with the sDFT being updated every time a new data point is acquired. The low computational demands of the sDFT-based algorithm allow the phase calculations to be carried out within the microcontroller, avoiding the need for an external computer. Full details of the calculation procedure may be found in Ref. 5.