Contradicting definitions of time-correlation functions The correlation of two quantities $A(t)$ and $B(t)$ is usually given as
$$\left\langle A(t)B(t')\right\rangle,$$
not specifying what one is supposed to integrate over. My first guess would be to integrate over time like so:
$$\left\langle A(t)B(t')\right\rangle = \frac{1}{T}\int_0^T dt_0 \, A(t_0+t)B(t_0+t')dt,$$
like it is defined in in Wikipedia for a cross-correlation function. However, I also found sources, like this script from MIT Open courseware, where they are defining the cross-correlation between $A$ and $B$ as the integral over all variables except time (eq. 5.20 in the link). 
So, what is the correct definition of the time-correlation function between two variables?
 A: Depending on the context, the angle brackets could mean an ensemble average or a time average. The two are equivalent if the ensemble is an equilibrium ensemble, and if the system is ergodic. This would mean that the time correlation function is stationary, i.e. dependent only on the time difference between the two measurements, not on the time origin. This is mentioned on pages 5-6 and 5-7 of the notes you referenced.
The context might be that you are analyzing a single signal, in which case the time average is the only option (there is no ensemble). But even then, one might consider repeating the experiment, and averaging over an "ensemble" of experiments, and then the ensemble average comes into consideration.
If the process you are analyzing is non-stationary, then the time average makes less sense, and the angle brackets will refer to an ensemble average (perhaps a set of starting conditions). In that case, $\langle A(t) B(t')\rangle$ will, in general, depend on both times $t$ and $t'$, not simply on $t-t'$. And also, in that case, it is highly likely that the simple averages $\langle A(t)\rangle$ and $\langle B(t)\rangle$ will be nontrivial functions of $t$, and need taking into account when calculating the correlation function.
The full definition of correlation function should have $A(t)$ replaced by $A(t)-\langle A\rangle$, and similarly for $B$, in your first equation. Often this is assumed to have been done already, i.e. it is assumed that $\langle A\rangle=0$, $\langle B\rangle=0$, and your first formula is correct.
As before, if the system is stationary, it doesn't matter whether we think of $\langle A\rangle$ as a time average or an ensemble average; if it is nonstationary, it does matter, and we would have to evaluate it at the correct value of $t$.
Finally, to be pedantic, a correlation function should be normalized by $\sqrt{\langle A^2\rangle\langle B^2\rangle}$, otherwise it should really be called a covariance function. I have to say, though, that it is quite common to ignore this distinction, and to refer to $\langle A(t) B(t')\rangle$ as a correlation function.
