## 4 SNR Estimation
### Time Domain SNR Estimation Using Autocorrelation  
Figure 6 presents the flowchart of the CAZAC-TD SNR estimation algorithm. This algorithm utilizes the autocorrelation function of the STBC decoder output signal, \(Y_{dstbc}\), to estimate the signal and noise power. The autocorrelation of the STBC decoder output signal, \(Y_{dstbc}\), is given as:  
\[R_{YY_{dstbc}}(k)=R_{XX}(k)+R_{NN_{c}}(k) \tag{9}\]  
for \(0\leq k\leq N_{S}-1\) denotes the autocorrelation of the transmitted signal, while \(R_{NN_{c}}(k)\) denotes the autocorrelation of the noise signal for the AWGN channel with the noise variance, \(\sigma^{2}\), given as:  
\[R_{NN_{c}}(k)=\sigma^{2}\delta(k) \tag{10}\]  
where \(\delta(k)\) represents the Dirac delta function. Similarly, the autocorrelation of the OFDM transmitted signal can be expressed as:  
\[R_{XX}(k)=P_{SS}\delta(k) \tag{11}\]  
where \(\delta(k)\) represents the delta function and \(P_{SS}\) is the signal power. Hence, at zero lag, the STBC-decoded signal's autocorrelation consists of both the signal and the noise power. On the other hand, the autocorrelation of the transmitted OFDM signal consists of signal power only. Thus, the difference between the STBC-decoded signal's autocorrelation value at zero lag and the estimated signal power can be used to estimate noise power. Figure 7 compares the autocorrelation of the transmitted OFDM signal and the corresponding received STBC-decoded signal over an SUI-5 channel at an SNR of 12 dB, utilizing the modified CAZAC preamble structure. Specifically, Figure 7a shows the autocorrelation plot of the transmitted OFDM signal \(S\) at SNR = 12 dB, and the autocorrelation plot of the corresponding STBC-decoded signal is shown in Figure 7b. In Figure 7, the X-axis represents the lag between the signal and its shifted version, and the Y-axis represents the autocorrelation values at each lag. It can be seen from Figure 7 that there is one main peak at \(L_{S}\), and there are two side peaks on its right and left sides. The two side peaks on the left side appeared at the specific lags of \(L_{S}-N_{S}\) and \(L_{S}-N_{S}/2\). As a result, the estimation of the signal power can be written as:  
\[P_{SS,est}=2R_{YY_{dstbc}}(L_{S}-N_{S}/2)-R_{YY_{dstbc}}(L_{S}-N_{S}) \tag{12}\]  
where \(L_{S}=N_{S}+N_{C_{P}}\) denotes the total length of the OFDM symbol of length \(N_{S}\) with added \(C_{P}\) and \(N_{C_{P}}=N_{S}/4\) is the \(C_{P}\) length. More specifically, the signal power is estimated  
Figure 4: Proposed modified preamble structure with cyclic prefix. Figure 5: Preamble structure used in Milan SNR estimator in [18]. by using the side peaks that result from the autocorrelation of the received STBC-decoded signal. The side peak at \((L_{S}-N_{S})\) rises when the cyclic prefix \(C_{P}\) overlaps with itself, while the side peak at \((L_{S}-N_{S}/2)\) rises when part of the preamble, along with the \(C_{P}\), overlaps with itself. The subtraction between these two side peaks helps to eliminate the impact of the \(C_{P}\), ensuring that the signal power estimation is not distorted by the cyclic prefix. This allows for a more accurate estimate of the true signal power. Figure 6: Flowchart of CAZAC-TD SNR estimation algorithm. As seen from Figure 7b, the main peak of the STBC-decoded signal's autocorrelation includes the noise power. Hence, the noise power can be estimated by computing the difference between the STBC-decoded signal's autocorrelation and the estimated signal power, \(P_{SS,est}\). The estimation of noise power is given as:  
\[\sigma_{N.est}^{2}=R_{YY_{dstk}}(L_{S})-(P_{SS,est}) \tag{13}\]  
where \(R_{YY_{dstk}}(L_{S})\) is the maximum peak indicating the STBC-decoded signal's autocorrelation value at zero lag.