## 3 Space Time Block Code (STBC)
### OSTBC System Model  
In this work also, in a MISO System, four antennas will be at the transmitting side and one antenna will be at the receiving side. The code rate used is \(\frac{3}{4}\), meaning that the three symbols will be sent in four different time slots. The transmission is carried out in an orthogonal manner; the following codeword is used in the transmission [40; 46; 47]. The transmission orthogonal symbol matrix \(\mathbf{X}\) is:  
\[\mathbf{X}= \begin{bmatrix}x_{1}&x_{2}&x_{3}&0\\ -x_{2}^{*}&x_{1}^{*}&0&x_{3}\\ x_{3}^{*}&0&-x_{1}^{*}&x_{2}\\ 0&x_{3}^{*}&-x_{2}^{*}&-x_{1}\end{bmatrix} , \tag{14}\]  
To check that this matrix is orthogonal, an identity matrix results from multiplying the matrix \(\mathbf{X}\) by its Hermitian transpose \(\mathbf{X}^{\text{H}}\). The received signal \(\mathbf{Y}\) can be defined as:  
\[\mathbf{Y}=\sqrt{\frac{\mathbf{\hat{z}}_{s}}{2}}\mathbf{H} \begin{bmatrix}x_{1}&x_{2}&x_{3} &0\\ -x_{2}^{*}&x_{1}^{*}&0&x_{3}\\ x_{3}^{*}&0&-x_{1}^{*}&x_{2}\\ 0&x_{3}^{*}&-x_{2}^{*}&-x_{1}\end{bmatrix} +\mathbf{W}, \tag{15}\]  
\[\mathbf{H}=[h_{1}\ h_{2}\ h_{3}\ h_{4}]=\mathbf{H}_{\text{bL}}^{\text{H}}+\mathbf{H}_{ \text{lL}}^{\text{H}}\mathbf{\varphi}\mathbf{H}_{\text{bL}}, \tag{16}\]  
At the receiving side, the four received signals will be combined and then sent to the ML detector. After combining these signals, they are solved simultaneously to get the decision statistics for all the symbols [47]. \[\widetilde{x}_{1} =\frac{1}{\left\|\mathbf{H}\right\|^{2}}(h_{1}^{*}y_{1}+h_{2}y_{2}^{* }-h_{3}y_{3}^{*}-h_{4}^{*}y_{4}) \tag{17}\] \[\widetilde{x}_{2} =\frac{1}{\left\|\mathbf{H}\right\|^{2}}(h_{2}^{*}y_{1}-h_{1}y_{2}^{* }+h_{4}^{*}y_{3}-h_{3}y_{4}^{*})\] (18) \[\widetilde{x}_{3} =\frac{1}{\left\|\mathbf{H}\right\|^{2}}(h_{3}^{*}y_{1}+h_{4}^{*}y_{2 }+h_{1}y_{3}^{*}+h_{2}y_{4}^{*})\] (19) \[\left\|\mathbf{H}\right\|^{2}=\sum_{i=1}^{4}\left\|h_{i}\right\|^{2} \tag{20}\]  
The likelihood received symbols \(\hat{x}_{1},\hat{x}_{2}\), and \(\hat{x}_{3}\). ML detector is used to select the closest symbol to the decision statistics of the symbol \(\widetilde{x}_{i}\), as in Equation (13). The system-performance assessment is summarized by deploying the following Algorithm 1. ``` Inputs: Number of bits (N_bits), number of bits taken each T\({}_{\text{s}}\) (N_mod), Number of IRS reflecting elements (N), Modulation order (M), QAM modulation, Number of transmitting antennas \(\mathbf{N}_{t}\) (\(\mathbf{N}_{t}=2\) \"Alamouti\", \(\mathbf{N}_{t}=4\) \"OSTBC 4 \(\times\) 1\")
1:for each E\({}_{\text{b}}\)/N\({}_{\text{o}}\)do
2: WhileN_bits > N_mod do
3: select N_mod = \(log_{2}M\ x\) K
4: Generate modulated symbols \(x_{1},x_{2},\ldots x_{k}\). 5: Compute \(\mathbf{X}\) using Equation (2) for Alamouti or Equation (14) for OSTBC
6: Generate \(\mathbf{\varphi}=\alpha\ \text{diag}(e^{i\mathbf{\theta}_{1}},e^{i\mathbf{\theta}_{2}},e^{i\mathbf{ \theta}_{3}},\ldots\ldots e^{i\mathbf{\theta}_{N}})\)
7: Compute \(\mathbf{Y}\) using Equation (4) for Alamouti or Equation (15) for OSTBC
8: Compute \(\widetilde{x}_{i}\) using Equations (10) and (11) for Alamouti, or Equations (17)-(19) for OSTBC. 9:for each Symbol in \(\mathbf{S}\)do
10:\(\hat{x}_{i}=\underset{s_{i}\in\mathbb{S}}{\text{argmin}}|s_{i}-\widetilde{x}_{ i}|^{2}\)
11:endfor
12: Map \(\hat{x}_{i}\) to the corresponding symbol
13: Demodulate the likelihood \(\tilde{x}_{i}\) into bits
14: endwhile
15: Calculate BER
16:endfor
17:Output: BER

## 4 Results: Analysis and Discussion

MATLAB R2024 environment was conducted in order to evaluate the system performance for both Alamouti STBC 2 \(\times\) 1 assisted IRS and as well as OSTBC 4 \(\times\) 1 assisted IRS. In order to validate the proposed system models, we illustrate a comparative study for altering the number of reflecting elements, as well as the modulation scheme, and the number of the transmitting antennas. The number of antennas in the transmitting side is varied in order to investigate the system's performance in terms of the diversity gain.