## 3 Proposed Signal Processing Algorithm
### Matched Filtering  
A matched filter is the optimum filter to maximize the _SNR_ of signal out of the matched filter in the presence of additive stochastic noise at input signal [18]. Consider the case where the input signal is \(s(t)\) and \(n(t)\) is the white noise with zero mean, variance \(\sigma_{N}^{2}\) related to \(s(t)\). In this case, matched filter theory states that the maximum _SNR_ at the output will occur when the matched filter has an impulse response \(h(t)\)=\(s(t_{o}t)\) that is equal to the time-reversed version of the signal waveform \(s(t)\) to which matched filter is matched and time-delayed by certain \(t_{0}\) [second]. When input signal \(s(t)\) is time-limited signal existing only when \(0<t<T\) then the matched filter is defined by [18] :  
\[h(t)=s(T-t)\] (11a) Note that the output \[s_{0}(t)\] of the matched filter, which is the convolution of \[s(t)\] and \[h(t)\)=\(s(T\)-\(t)\], is given by: \[s_{o}(t)=h(t)*s(t)\!=\!\!\int_{0}^{\infty}h(\lambda)\,s(t-\lambda)d\lambda=\!\! \!\int_{0}^{\infty}s(T-\lambda)s(t-\lambda)d\lambda \tag{11b}\]  
In Equation 11b \(s_{0}\)_(t)_ is the cross-correlation of the time-reversed version of input signal \(s(t)\) (i.e. \(s(\)-\(t)\()\)) with \(h(t)\)=\(s(T\)-\(t)\), which is denoted as \(R_{s(\)-\(t)h(t)}(t)\). But \(s(\)-\(t)\) and \(h(t)\) are identical two waveforms with time distance \(T\) separated and \(s_{0}(t)\)=\(R_{s(\)-\(t)h(t)}(t)\) becomes \(R_{ss}(\)-\(T)\) when \(R_{ss}(t)\) denotes the autocorrelation \(R_{ss}(t)\) of input signal \(s(t)\). Then \(s_{0}(t)\) has its maximum value when \(t\)=\(T\) and this maximum value is same as the \(R_{ss}(0)\) of autocorrelation \(R_{ss}(t)\) of input signal \(s(t)\). Thus if we process a signal-plus-noise with a matched filter, the largest peak outputs due to the signal will correspond to \(R_{ss}(0)\) and the _SNR_[18] of the largest peak output of matched filter is given  
Figure 6: Matched filtering. \[SNR_{output\ of\ matched\ filter}=\frac{\sqrt{R_{SS}\left(0\right)}}{\sigma_{N}} \tag{12}\]  
If we define the \(SNR\) of input signal \(s(t)\) as the ratio between the largest value \(\hat{a}\) of input signal \(s(t)\) and \(\sigma_{N_{s}}\) then \(SNR\) improvement due to the matched filtering is given as:  
\[SNR_{imp,matched}=\frac{\sqrt{R_{SS}\left(0\right)}}{\sigma_{N}}/\frac{\hat{a} }{\sigma_{N}}=\frac{\sqrt{R_{SS}\left(0\right)}}{\hat{a}} \tag{13}\]  
At this stage, following the concept of matched filter, only one fringe of cross-correlation signal \(i\) (\(n\)) (i.e. signal between \(i(p_{i})\) and \(i(p_{i+1})\) of \(i\left(n\right)\)) is considered as the signal to be matched and one period of cosine function, \(\cos\!\left(\frac{2\pi n}{\hat{f}_{S}}\right)\)is considered as the matched filter, \(i_{M}(n)\). \[i_{M}(n)=\cos\!\left(\frac{2\pi n}{\hat{f}_{S}}\right)\ n=0,1,...\hat{f}_{S} \tag{14}\]  
Then, for a given one fringe of cross-correlation signal \(i(n)\), signal out of the matched filter is maximized when the time delay between two signals is \(\hat{f}_{S}\) and maximum value is calculated as in Equation 15.  
\[s_{0}(t)\]0  
for given \(J_{i}\)'s (\(i\)=0, \(\pm\)1, \(\pm\)2,...). The envelope function of \(i(n)\) is slowly changing in the vicinity of the zero order fringe peak of \(i\left(n\right)\) and Equation 15 can be rewritten as:  
\[s_{0}(t)\]1 (16a) where \[s_{0}(t)\]2 in Equation 16 is the average value of exponential envelope function between \[s_{0}(t)\]3 and \[s_{0}(t)\]4 as shown in Equation 16b. \[s_{0}(t)\]5  
For the case of a zero order fringe peak \(i(p_{0})\) of \(i(n)\), average value \(h_{0}\) of envelope between \(p_{0}\) and \(p_{1}\) is approximately \"1\" because \(i\) (\(p_{0}\)) =1 and \(i\) (\(p_{0}\)) \(\approx\)\(i\) (\(p_{1}\)).