Commit 9ec1edfe authored by Florent Robinet's avatar Florent Robinet
Browse files

xcorr

parent 0c23652b
......@@ -56,10 +56,10 @@ The signal-to-noise ratio spectrograms $\hat{\rho}_1(\tau,\phi,Q)$ and $\hat{\rh
\section{The cross-correlation of spectrograms}
The spectrograms of detector 1 and detector 2 cross-correlated along the time direction:
\begin{equation}
X[m][l] = \sum_{m^{\prime}=0}^{(N_\tau-1)} \rho_1[m^{\prime}][l] \times \rho_2[N_\tau/2-m+m^{\prime}][l].
\xi[m][l] = \sum_{m^{\prime}=0}^{(N_\tau-1)} \rho_1[m^{\prime}][l] \times \rho_2[N_\tau/2-m+m^{\prime}][l].
\label{eq:xcorr}
\end{equation}
For a given frequency row $l$, the cross-correlation coefficient $X$ measures the sum of $\rho_1\rho_2$ when the $\rho_1$ time bins are shifted by $m-N_\tau/2$ bins with respect to those of $\rho_2$. The coefficient $X$ can be seen as a function of the time shift between detector 1 and detector 2:
For a given frequency row $l$, the cross-correlation coefficient $\xi$ measures the sum of $\rho_1\rho_2$ when the $\rho_1$ time bins are shifted by $m-N_\tau/2$ bins with respect to those of $\rho_2$. The coefficient $\xi$ can be seen as a function of the time shift between detector 1 and detector 2:
\begin{equation}
\delta \tau = \left (m-\frac{N_\tau}{2}\right) \times \frac{\tau_{max}-\tau_{min}}{2}.
\label{eq:timeshift}
......@@ -68,11 +68,11 @@ We note that, in Eq.~\ref{eq:xcorr}, the index $N_\tau/2-m+m^{\prime}$ can be ou
\begin{figure}
\center
\includegraphics[width=16cm]{./figures/xcorr.pdf}
\caption{Representation of three cross-correlation coefficients for a given frquency row $l$: $X[0][l]$ (left), $X[N_\tau/2][l]$ (center), and $X[N_\tau-1][l]$. The detector 1 (blue) time bins are shifted by $\delta t$ with respect to those of detector 2 (green). The resulting cross-correlation coefficient is represented by the red square. The dashed-line squares indicate the circular periodicity used to compute the cross-correlation.}
\caption{Representation of three cross-correlation coefficients for a given frquency row $l$: $\xi[0][l]$ (left), $\xi[N_\tau/2][l]$ (center), and $\xi[N_\tau-1][l]$. The detector 1 (blue) time bins are shifted by $\delta t$ with respect to those of detector 2 (green). The resulting cross-correlation coefficient is represented by the red square. The dashed-line squares indicate the circular periodicity used to compute the cross-correlation.}
\label{fig:xcorr}
\end{figure}
To optimize the computation of $X[m][l]$, the cross-correlation is calculated in the Fourier domain. We define the Fourier transform of a discrete time series $d$ of size $N_\tau$ as:
To optimize the computation of $\xi[m][l]$, the cross-correlation is calculated in the Fourier domain. We define the Fourier transform of a discrete time series $d$ of size $N_\tau$ as:
\begin{equation}
\tilde{d}[k] = \frac{1}{N_\tau} \sum_{m=0}^{(N_\tau-1)} d[m] e^{-2i\pi km / N_\tau}.
\label{eq:dft}
......@@ -84,8 +84,22 @@ The inverse Fourier transform is given by:
\end{equation}
Using the definition of Eq.~\ref{eq:dft}, we write Eq.~\ref{eq:xcorr} in the Fourier domain:
\begin{equation}
\tilde{X}[k][l] = \frac{1}{N_\tau} \sum_{m=0}^{(N_\tau-1)} \sum_{m^{\prime}=0}^{(N_\tau-1)} \rho_1[m^{\prime}][l] \times \rho_2[N_\tau/2-m+m^{\prime}][l] \times e^{+2i\pi km / N_\tau}.
\tilde{\xi}[k][l] = \frac{1}{N_\tau} \sum_{m=0}^{(N_\tau-1)} \sum_{m^{\prime}=0}^{(N_\tau-1)} \rho_1[m^{\prime}][l] \times \rho_2[N_\tau/2-m+m^{\prime}][l] \times e^{-2i\pi km / N_\tau}.
\end{equation}
We substitute $n$ for $N_\tau/2-m+m^{\prime}$ and we get:
\begin{align}
\tilde{\xi}[k][l] &= \frac{1}{N_\tau} \sum_{m^{\prime}=0}^{(N_\tau-1)} \sum_{n=m^{\prime}-N_\tau/2+1}^{(N_\tau/2+m^{\prime})} \rho_1[m^{\prime}][l] \times \rho_2[n][l] \times e^{-2i\pi k(N_\tau/2-n+m^{\prime}) / N_\tau}, \nonumber \\
&= \frac{(-1)^k}{N_\tau} \sum_{m^{\prime}=0}^{(N_\tau-1)} \rho_1[m^{\prime}][l] \times e^{-2i\pi km^{\prime} / N_\tau}
\sum_{n=m^{\prime}-N_\tau/2+1}^{(N_\tau/2+m^{\prime})} \rho_2[n][l] \times e^{+2i\pi kn / N_\tau}.
\label{eq:xcorr_theorem}
\end{align}
In Eq.~\ref{eq:xcorr_theorem}, the first sum is the Fourier transform of $\rho_1$. For the second sum, $\rho_2$ and the exponential are $N_\tau$-periodic functions of so that we can apply a shift of $m^{\prime}-N_\tau/2+1$ without changing the result of the sum:
\begin{align}
\tilde{\xi}[k][l] &= (-1)^k \times \tilde{\rho}_1[k][l] \times \sum_{n=0}^{(N_\tau-1)} \rho_2[n][l] \times e^{+2i\pi kn / N_\tau} \nonumber \\
&= (-1)^k \times N_\tau \times \tilde{\rho}_1[k][l] \times \tilde{\rho}_2^*[k][l],
\label{eq:xcorr_ft}
\end{align}
where $\rho_2^*$ is the complex conjugate of $\rho_2$. Equation~\ref{eq:xcorr_ft} is a variant of the well-known cross-correlation theorem: there is an extra phase of $\pi$ due to the fact that we chose a $N_\tau/2$ shift in Eq.~\ref{eq:xcorr}.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment