# Signal Detection for Ambient Backscatter Communication with OFDM Carriers
## 3 Optimal Detector Design  
Let \(\pi_{0}=P(H_{0})\) and \(\pi_{1}=P(H_{1})\), then \(\pi_{0}+\pi_{1}=1\). Regarding to [16], a decision function \(\delta(\mathbf{x})\) partitions the observation domain \(R\) into two disjoint sets \(R_{0}\) and \(R_{1}\), where  
\[R_{0}=\{\mathbf{x}:\delta(\mathbf{x})=0\},\ \ \ R_{1}=\{\mathbf{x}:\delta( \mathbf{x})=1\}. \tag{7}\]  
We also observe that we have two possible incorrect decisions: (i) probability of false alarm, \(P_{f}\) (type-I error) and (ii) probability of miss detection, \(P_{m}(\delta)=1-P_{d}(\delta)\) (type-II error), where \(P_{d}(\delta)\) is the probability of correct detection. Mathematically, we express  
\[P_{f} =P(H_{1}\text{ was chosen when }H_{0}\text{ true}),\] \[P_{d} =P(H_{1}\text{ was chosen when }H_{1}\text{ true}).\]  
In [16], [PERSON] and [PERSON] formulated the binary hypothesis testing problem pragmatically by selecting the test \(\delta\) that maximizes \(P_{d}(\delta)\) or equivalently that minimizes \(P_{m}(\delta)\), while ensuring that \(P_{f}(\delta)\) is less than or equal to a number \(\alpha\). The energy detector is derived by using the generated likelihood ratio test approach [16], where \(u(n)\sim\mathcal{CN}(0,\sigma_{u}^{2})\) and \(v(n)\sim\mathcal{CN}(0,\sigma_{v}^{2})\). \[L(\mathbf{x})=\frac{f_{1}(\mathbf{z})}{f_{0}(\mathbf{z})}\overset{H_{1}}{ \underset{H_{0}}{\gtrgtr}}\tau, \tag{8}\]  
where \(\tau\) is chosen such that \(P_{f}=\int_{L(\mathbf{z})>\tau}f(\mathbf{z}|H_{0})d\mathbf{z}=\alpha\). We define \(\mathbf{z}=\{z(n)\},\mathbf{u}=\{u(n)\}\), \(\mathbf{v}=\{v(n)\}\)\((n=L-1,\cdots,N_{cp}-1)\), and \(D=N_{cp}-L+1\). For our hypotheses \(H_{0}\) and \(H_{1}\), the PDFs of the samples can be derived as  
\[f_{0}(\mathbf{z}) =\frac{1}{(2\pi\sigma_{v}^{2})^{D/2}}\exp\left\{-\frac{\sum_{n=L- 1}^{N_{cp}-1}|z(n)|^{2}}{2\sigma_{v}^{2}}\right\}, \tag{9}\] \[f_{1}(\mathbf{z}) =\frac{1}{(2\pi\sigma_{v}^{2})^{D/2}}\exp\left\{-\frac{\sum_{n=L- 1}^{N_{cp}-1}|z(n)-u(n)|^{2}}{2\sigma_{v}^{2}}\right\}. \tag{10}\]  
Considering the same detection problem of (6), we define a new test as the following to improve the detection performance. \[t\triangleq\frac{1}{D}\sum_{n=L-1}^{N_{cp}-1}\frac{|z(n)|^{p}}{\sigma_{v}^{p }}\overset{H_{1}}{\underset{H_{0}}{\gtrgtr}}\tau. \tag{11}\]  
Here, \(p>0\) is an arbitrary constant which is discussed later, and \(\tau\) is the detection threshold to be determined. Then, the test statistic follows the Gamma distribution with shape \(k_{i}\) and scale \(\theta_{i}\), i.e., \(t\sim\Gamma(k_{i},\theta_{i})\) under \(H_{i}\), where \(k_{i}=\frac{[\xi(t|H_{i})]^{2}}{\text{Var}(t|H_{i})},\theta_{i}=\frac{\text{ Var}(t|H_{i})}{\mathbb{E}(t|H_{i})}\)\((i=0\text{ or }1)\). We denote \(F_{0}(\cdot),F_{1}(\cdot)\) are the cumulative distribution functions (CDFs) of the Gamma variable \(t\) under \(H_{0}\) and \(H_{1}\), respectively, thus, \(F_{i}(z;k_{i};\theta_{i})=\int_{0}^{z}\frac{1}{\theta_{i}^{k_{i}}\Gamma(k_{i})}x ^{k_{i}-1}e^{-x/\theta_{i}}dx\;(i=0,1)\). Then, we have  
\[P_{f} =P(t>\tau|H_{0})=1-F_{0}(\tau;k_{0},\theta_{0}), \tag{12}\] \[P_{d} =P(t>\tau|H_{1})=1-F_{1}(\tau;k_{1},\theta_{1}). \tag{13}\]  
To set the threshold, we set \(P_{f}=\alpha\) and thus, \(\tau=F_{0}^{-1}(1-\alpha,k_{0},\theta_{0})\), resulting in \(P_{d}=1-F_{1}(F_{0}^{-1}(1-\alpha,k_{0},\theta_{0});k_{1};\theta_{1})\). According to the central limit theorem (CLT) [16], as \(D\) becomes large we can represent \(t\sim\mathcal{N}\left(\mathbb{E}(t),\mathrm{Var}(t)\right)\).