# Variance-Triggered Two-Step GPS Acquisition
## 4 Memory Usage  
This section presents a memory usage analysis for both conventional SA and VTTS acquisition. The memory usage of the SA depends primarily on the number of frequency bins and the number of code phase shifts to be stored in the search matrix. The number of frequency bins is defined by two main receiver design requirements: the maximum Doppler shift, which defines the frequency range (\(R_{\rm{S}A}\)) that should be covered by the acquisition; and frequency resolution (\(\delta_{SA}\)), that is a requirement of the tracking, the next stage of GNSS reception. Given \(R_{SA}\) and \(\delta_{SA}\), the number of frequency bins in SA can be roughly defined by  
\[N_{b}^{\rm{SA}}=\frac{R_{\rm{SA}}}{\delta_{\rm{SA}}}, \tag{9}\]  
which value should be rounded to the higher odd integer in order to include the central frequency as the middle bin. The number of code phase shifts depends on another receiver design requirement: the sampling frequency. Together the number of code chips, the sampling frequency will define the number of samples per chip (\(P\)). Hence, the memory usage for GPS detection using SA is approximated by  
\[M_{\rm{SA}}=1023 PN_{b}^{\rm{SA}}. \tag{10}\]  
For VTTS, the memory usage is composed of the memory used in the two steps of the algorithm,  
\[M_{\rm{VTTS}} = M_{\rm{CS}}+M_{\rm{FS}}, \tag{11}\] \[= 1023N_{b}^{\rm{CS}}+2 PN_{b}^{\rm{FS}}, \tag{12}\]  
with \(M_{\rm{CS}}\) and \(M_{\rm{FS}}\) denoting the memory usage of the CS and FS steps, respectively. For a fair comparison between the memory usage of SA versus VTTS acquisition, we devise the memory usage of the VTTS method in terms of the same design requirements used for SA. For that, we should guarantee that VTTS delivers the same frequency resolution to the tracking stage, i.e., the resolution of the VTTS's FS step should be the same as the resolution delivered by SA,  
\[\delta_{\rm{SA}}=\delta_{\rm{FS}}. \tag{13}\]Yet, the same frequency range covered by SA should be covered by VTTS. So, as the range of the SA is defined by the number intervals between bins multiplied by the resolution, we have  
\[(N_{b}^{CS}-1)\delta_{CS}=(N_{b}^{SA}-1)\delta_{SA}, \tag{14}\]  
i.e., the range covered by the CS step should be the same covered by the SA. Moreover, we should write Equation (12) in terms of \(N_{b}^{\text{SA}}\) and \(P\), as in Equation (10), to facilitate the memory usage comparison. However, with more unknown variables than equations, we are obliged to make one assumption to define the number of frequency bins in the FS step. Consider the fact that the resolution of the FS step is always finer than that of the CS step,  
\[\delta_{\text{CS}}>\delta_{\text{FS}}, \tag{15}\]  
and that the frequency range in the FS step is equal to the range between the two bins around the estimated frequency (\(\hat{f}\)), that is  
\[(N_{b}^{\text{FS}}-1)\delta_{\text{FS}}=2\delta_{\text{CS}}. \tag{16}\]  
If we assume that Equation (15) must be minimally satisfied, the number of FS bins must be \(N_{b}^{\text{FS}}=5\), because a lower odd integer would not satisfy Equation (15), i.e., \(N_{b}^{\text{FS}}=3\) means \(\delta_{\text{CS}}=\delta_{\text{FS}}\). So, from Equations (13), (14) and (16), and \(N_{b}^{\text{FS}}=5\), we have  
\[N_{b}^{\text{CS}}=\frac{N_{b}^{\text{SA}}+1}{2}. \tag{17}\]  
With Equation (17), assuming \(N_{b}^{\text{FS}}=5\), we can rewrite Equation (12) in terms of \(N_{b}^{\text{SA}}\) and \(P\),  
\[M_{VTTS}=1023\frac{\left(N_{b}^{\text{SA}}+1\right)}{2}+10P. \tag{18}\]  
Finally, we can now compare the memory usage of SA and VTTS with the same receiver design requirements. Figure 7 presents the ratio between \(M_{\text{SA}}\) (Equation (10)) and \(M_{\text{VTTS}}\) (Equation (18)), i.e., the depicted values represent how many times more memory is used by SA regarding VTTS. Values higher than one mean VTTS uses less memory. From the figure, it is clear to see that the memory saving of VTTS regarding SA varies very closely with a linear function of \(P\).