# Co-Efficient Vector Based Differential Distributed Quasi-Orthogonal Space Time Frequency Coding
## 2 Distributed Space-Time-Frequency Coding
### Space Time Frequency Coding at the Relay Nodes  
If the data vector generated by the source node is of the form \(\sqrt{E_{S}P\Gamma}\mathbf{x}_{k}\), where \(E_{S}\) denotes average transmit-power, the signal received at the \(p_{th}\) relay node in the \(k_{th}\) block after cyclic prefix (CP) removal and fast Fourier transform (FFT) demodulation is given in vector form by:  
\[\boldsymbol{r}_{k,p}=\sqrt{E_{S}P\Gamma}\boldsymbol{x}_{k}\odot\boldsymbol{f} _{k,p}+\boldsymbol{n}_{k,p} \tag{2}\]  
where \(\boldsymbol{r}_{-}(k,p)=[r_{-}(k,p)(1),\ldots,r_{-}(k,p)(\Gamma),\ldots,r_{-}(k,P)(1),\ldots,r_{-}(k,P)(\Gamma)]T\in\mathbb{C}(P\Gamma\times 1)\), \(\boldsymbol{f}_{-}(k,p)=[\boldsymbol{f}_{-}(k,p,t,n)(1),\ldots,\boldsymbol{f}_ {-}(k,p,t,n)(P\Gamma)]T\), \(\boldsymbol{f}_{k,p,t,n}(i)\) is the channel gain at the \(n\)th sub-carrier of the \(p\)th relay node during the \(t\)th time slot, and \(\boldsymbol{n}_{k,p}=[n_{k,p}(1),\ldots,n_{k,p}(\Gamma),\ldots,\)\(n_{k,P}(1),\ldots,\)\(n_{k,P}(\Gamma)]^{T}\) is the zero-mean complex Gaussian noise vector with covariance \(N_{0}I_{P\Gamma}\). The multipath fading channel \(\boldsymbol{f}_{p,t,n}(i)\) between the source node and the \(p_{th}\) relay node is modelled as \(\boldsymbol{f}_{p,k,t,n}(i)=\sum_{l=0}^{L_{SR}-1}\boldsymbol{f}_{p,t}(t)e^{- \beta\pi ln/N}=\boldsymbol{f}_{p,t}^{\phantom{p,t}T}\boldsymbol{\omega}, \boldsymbol{\omega}=\left[1,e^{-\beta\pi n/N},\ldots,e^{-\beta\pi Ln/N}\right] ^{T}\). The average signal-to-noise ratio (SNR) of the channel between the source node and the \(p\)th relay node is given by \(\Upsilon_{SR}=E_{S}P\Gamma/N_{0}\). The procedures through which the STF codes are constructed at the relay nodes are described below. Given that the \(p\)th relay node receives \(\boldsymbol{r}_{k,p}\in\mathbb{C}^{P\Gamma\times 1}\) in (2), it differentially decodes the received signal and obtains \(\widetilde{\boldsymbol{x}}_{k}=\left[\widetilde{\boldsymbol{x}}_{k,t,n}(1), \ldots,\widetilde{\boldsymbol{x}}_{k,t,n}(P\Gamma)\right]^{T}\), where \(\widetilde{\boldsymbol{x}}_{k}\) is the differentially decoded version of the source node signal \(\boldsymbol{x}_{k}\). The differential procedure is explained in the next section. In our STF coding scheme, we configure the \(p\)th relay node to forward a subset of the decoded signal \(\widetilde{\boldsymbol{x}}_{k}\), which we define as \(\widetilde{\boldsymbol{x}}_{k}=\left[\widetilde{\boldsymbol{x}}_{k,p,t,n}(1),\ldots,\widetilde{\boldsymbol{x}}_{k,p,t,n}(\Gamma)\right]^{T}\in\mathbb{C} ^{\Gamma\times 1}\), while the remaining \((P\Gamma-\Gamma)\) symbols are discarded. Note that \(\widetilde{\boldsymbol{x}}_{k,p,t,n}(i)\) denotes the \(i\)th symbol transmitted by the \(p\)th relay node on the \(n\)th sub-carrier of the \(t\)th OFDM time slot in the \(k\)th block. Based on this, the received signal at the \(p\)th relay node can be rewritten as follows:  
\[\widetilde{\boldsymbol{r}}_{k,p}=\sqrt{E_{S}P\Gamma}\widetilde{\boldsymbol{x} }_{k}\odot\widetilde{\boldsymbol{f}}_{k,p}+\overline{\boldsymbol{n}}_{k,p} \tag{3}\]  
where \(\widetilde{\boldsymbol{x}}_{k}=[x_{k}(1),\ldots,x_{k}(\Gamma)]^{T},\widetilde {\boldsymbol{f}}_{k,p}=[\boldsymbol{f}_{k,p,t,n}(1),\ldots,\boldsymbol{f}_{k, p,t,n}(\Gamma)]^{T}\) and \(\overline{\boldsymbol{n}}_{k,p}=[\boldsymbol{n}_{k,p}(1),\ldots,\)\(n_{k,p}(\Gamma)]^{T}\). In our DQSTFC scheme, the \(P\) relay nodes are designed to construct \(\Gamma\times P\) quasi-orthogonal signal matrices at the destination. In order to achieve this, each \(p\)th relay node is equipped with a \(\Gamma\times\Gamma\) unitary matrix \(\boldsymbol{M}_{p}\), which we refer to as the'relay matrix'. The relay matrix is a matrix of \(1\) s and \(0\) s, which enable the relay nodes to generate codewords with a quasi-orthogonal structure at the destination. The structure of the relay matrix is given in Sections 3 and 4 of [27] for cooperative networks with different number of relay nodes.