Signal Detection: Matched Filter
Some notes on the topic of matched filtering. An example based on AIS is presented.
This makes a lot of sense. Intuitively, a small value of \(k\) is not ideal, since the frequency shift variation from one sample to the next is going to be drown in the noise. Are then larger values of \(k\) preferred…? After a large number or samples the frequency shift will be more visible, however, since the summation in \(R\) involves \(N-k\) elements, the larger \(k\), the fewer the number of elements we are going to add together (adding a large number of elements is intuitively good, because in the presence of uncorrelated noise, the noise component dampens out whereas the signal component reinforces). So very large values of \(k\) (near \(N\)) are also not ideal. As with many things in life the best is in the balance: values around \({\frac{N}{2}}\) come with the strongest weight.
In practice, the maximum \(k\) we can use is going to be determined by the maximum \(f_n\) we design for, as already stated in \eqref{eq:3}.
The L&R proposition at this point is:
With these premises our maximum-likelihood equation simplifies to:
\[\operatorname{Im} \left\{ \sum_{i=1}^{M} R(k) e^{-j2\pi \hat{f_n} k} \right\} = 0\]The next assumption is key in reaching a viable estimator:
Then, remembering that for small angles \(cos(\theta) \approx 1\) and \(sin(\theta) \approx \theta\), our equation can be approximated by:
\[\operatorname{Im} \left\{ \sum_{i=1}^{M} R(k) (cos(-2\pi \hat{f_n} k) + j sin(-2\pi \hat{f_n} k)) \right\} \approx \operatorname{Im} \left\{ \sum_{i=1}^{M} R(k) (1 - j 2\pi \hat{f_n} k) \right\} = 0\]Minding that our \(R(k)\) are a complex values and that \(\operatorname{Im} \{(a+jb)(1-jc)\} = b-jac\), we get:
\[\sum_{i=1}^{M} \operatorname{Im} \{R(k)\} - \sum_{i=1}^{M} \operatorname{Re} \{R(k)\} 2\pi \hat{f_n} k = 0\]and therefore
\[\hat{f_n} = {\frac{\sum_{i=1}^{M} \operatorname{Im} \{R(k)\}} {2\pi \sum_{i=1}^{M} k \operatorname{Re} \{R(k)\}}}\]So far so good, but at this point we are going to diverge from the original L&R paper. I haven’t been able to find my way around the next step. According to the paper, and without introducing more assumptions, L&R claim that:
\[\sum_{i=1}^{M} \operatorname{Im} \{R(k)\} \approx M \operatorname{arg} \left\{ \sum_{i=1}^{M} R(k) \right\}\] \[\sum_{i=1}^{M} k \operatorname{Re} \{R(k)\} \approx {\frac{M(M+1)}{2}}\]I’m probably making some mistakes because my numerical simulations don’t agree with this. I’d be happy to get a second opinion from anybody…
However, I’m also happy that resorting to geometry, it’s possible to make progress and actually reach the same conclusion as L&R.
Going back to our \(R(k)\) definition, when applied to a pure noiseless carrier we have seen that it simplifies to
\[R(k) = e^{j 2 \pi f_n k}\]Taking \(k \in [1,M]\), we see its representation is a “train” of phasors around the unit circumference separated by an angle \(\theta = 2 \pi f_n\):
If we rotate this train clock-wise by \({\frac{M+1}{2}}\theta\), the figure becomes symmetrical around the \(X\) axis:
regardless of whether \(M\) is even or odd.
It’s now easy to get the intuition that the sum of the \(M\) real components of these rotated \(R(k)\) can be approximated by \(M\), given that the angle \(\theta\) is small, and that the sum of the imaginary components is going to cancel out (that interestingly true even if the angle is not so small).
In other words we are saying that
\[\sum_{i=1}^{M} R(k) e^{-j 2 \pi {\frac{M+1}{2}} f_n} \approx M\]or
\[\sum_{i=1}^{M} R(k) \approx M e^{j 2 \pi {\frac{M+1}{2}} f_n}\]taking the angle of both sides
\[\operatorname{arg} \left\{ \sum_{i=1}^{M} R(k) \right\} \approx 2 \pi {\frac{M+1}{2}} f_n\]so, our \(f_n\) can be approximated by
\[\hat{f_n} = {\frac{1}{\pi(M+1)}} \operatorname{arg} \left\{ \sum_{i=1}^{M} R(k) \right\}\]which is the final form of the L&R estimator.
It’s probably a good idea to let the reader at this point take a deserved rest, leaving some additional thoughts on the L&R frequency estimation method for a later note.
Replacing
\[s_k = e^{j(2\pi f_n k + \theta_0)}\]in
\[R(k) \triangleq {\frac{1}{N-k}}\sum_{i=1}^{N-k} s_{i+k} s^{*}_{i}\]yields
\[R(k) = {\frac{1}{N-k}} \sum_{i=1}^{N-k} e^{j(2 \pi f_{n} (i+k) + \theta_{0})} e^{-j(2 \pi f_{n} i + \theta_{0})}\] \[= {\frac{1}{N-k}} \sum_{i=1}^{N-k} e^{j(2 \pi f_{n} (i+k) + \theta_{0} - 2 \pi f_{n} i - \theta_{0})} = {\frac{1}{N-k}} \sum_{i=1}^{N-k} e^{j 2 \pi f_{n} k}\] \[= {\frac{e^{j 2 \pi f_{n} k}}{N-k}} \sum_{i=1}^{N-k} 1 = {\frac{e^{j 2 \pi f_{n} k}}{N-k}} (N-k)\] \[= e^{j 2 \pi f_{n} k}\]OK, this is a bit involved but not difficult. First of all, a reminder of the maximum-likelihood frequency estimation formula:
\[\begin{equation} \mathit{ML}(x) = \sum_{k=1}^{N} \sum_{m=1}^{N} s_k s_m^* e^{-j 2 \pi x (k-m)} \tag{4}\label{eq:a21} \end{equation}\] \[\DeclareMathOperator*{\argmax}{argmax} \hat{f_n} = \argmax_{x} \mathit{ML}(x)\]In words, our best possible estimate \(\hat{f_n}\) is the one that maximizes the sum of all the possible cross products between our samples, counter-rotated by a factor of the number of samples there are in between. We can see why this makes sense by repeating the same exercise as in appendix 1:
\[\mathit{ML}(f_n) = \sum_{k=1}^{N} \sum_{m=1}^{N} e^{j 2 \pi f_n k} e^{-j 2 \pi f_n m} e^{-j 2 \pi f_n (k-m)} = \sum_{k=1}^{N} \sum_{m=1}^{N} 1 = N^2\]The value of \(\mathit{ML}(x)\) will be lower than \(N^2\) for any other value of \(x\). This is also true in the presence of AWGN.
The maximum of \eqref{eq:a21} happens at an \(x\) such that it makes zero the partial derivative with respect to \(x\), and since \({\frac{d(e^{ax})}{dx}} = a e^{ax}\), we get the equation:
\[\sum_{k=1}^{N} \sum_{m=1}^{N} -j 2 \pi (k-m)s_k s_m^* e^{-j 2 \pi x (k-m)} = 0\]and getting rid of the \(-j 2 \pi\) factor:
\[\sum_{k=1}^{N} \sum_{m=1}^{N} (k-m)s_k s_m^* e^{-j 2 \pi x (k-m)} = 0\]We should note that we are adding together \(N \times N\) elements and that we get zeros whenever \(k = m\), or along the main diagonal if it was a matrix:
\[\begin{equation} \left[ {\begin{array}{cccc} 0 & -s_1 s_2^{*} e^{j 2 \pi x} & \cdots & -(N-1) s_1 s_N^{*} e^{j 2 \pi x (N-1)}\\ s_2 s_1^{*} e^{-j 2 \pi x} & 0 & \cdots & -(N-2) s_2 s_N^{*} e^{j 2 \pi x (N-2)}\\ \vdots & \vdots & \ddots & \vdots\\ (N-1) s_N s_1^{*} e^{-j 2 \pi x (N-1)} & (N-2) s_N s_2^{*} e^{-j 2 \pi x (N-2)} & \cdots & 0\\ \end{array} } \right] \tag{5}\label{eq:a22} \end{equation}\]and the symmetry between the upper and lower triangular sections is now exposed as an opportunity to exploit. Our double summation is then equivalent to:
\[\sum_{k=2}^{N} \sum_{m=1}^{k-1} \left( (k-m)s_k s_m^* e^{-j 2 \pi x (k-m)} - (k-m)s_m s_k^* e^{j 2 \pi x (k-m)} \right) = 0\]and since
\(a b^{*} e^{-jc} - a^{*} b e^{jc} = a b^{*} e^{-jc} - ( a^{*} b e^{jc})^{*}\) and \(d - d^{*} = 2j \operatorname{Im} \left\{ d \right\}\), our equation is simplified to
\[\sum_{k=2}^{N} \sum_{m=1}^{k-1} 2j \operatorname{Im} \left\{ (k-m)s_k s_m^* e^{-j 2 \pi x (k-m)} \right\} = 0\]Now, with the help of paper and pencil, it can be seen that the following summations produce identical terms: instead of iterating over rows and columns, we are iterating here through the diagonals of the lower triangular section of the matrix in \eqref{eq:a22}.
\[\sum_{k=1}^{N-1} \sum_{i=1}^{N-k} 2j \operatorname{Im} \left\{ k s_{i+k} s_i^* e^{-j 2 \pi x k} \right\} = 0\]which equivalent to
\[\operatorname{Im} \left\{ \sum_{k=1}^{N-1} k \sum_{i=1}^{N-k} s_{i+k} s_i^* e^{-j 2 \pi x k} \right\} = 0\]which we can express in terms of our cross-correlation function \(R(k) = {\frac{1}{N-k}}\sum_{i=1}^{N-k} s_{i+k} s^{*}_{i}\), yielding the final form of our equation:
\[\operatorname{Im} \left\{ \sum_{i=1}^{N-k} k(N-k)R(k) e^{j-2\pi f_n k} \right\} = 0\]M. Luise and R. Reggiannini, “Carrier frequency recovery in all-digital modems for burst-mode transmissions,” in IEEE Transactions on Communications, vol. 43, no. 2/3/4, pp. 1169-1178, Feb./March/April 1995, doi: 10.1109/26.380149. ↩
Leave a Comment