# Directly Matching an MMIC Amplifier Integrated with MIMO Antenna through DNNs for Future Networks
## 2 Proposed Optimization Method
### LSTM-Based DNN for Modeling Antenna (Phase-1)
\[\text{IMD}_{3}=[(\text{IMD}_{3(\text{low})})+(\text{IMD}_{3(\text{high})})]/2 \tag{3}\]  
\[\text{IMD}_{5}=[(\text{IMD}_{5(\text{low})})+(\text{IMD}_{5(\text{high})})]/2 \tag{4}\]  
\[\text{IMD}_{7}=[(\text{IMD}_{7(\text{low})})+(\text{IMD}_{7(\text{high})})]/2 \tag{5}\]  
[PERSON]'s method is optimizing \(\text{F}(\text{x}_{1},\text{x}_{2},\dots,\text{x}_{n})\) in \(n\) variables, \(\text{x}=(\text{x}_{1},\text{x}_{2},\dots,\text{x}_{n})\) to find the optimal points in the domain of \(F\) with determined initial guess values. This method firstly extracts the derivative of \(\text{F}(\text{x})\) by using Jacobian matrix as presented in (6). \[\partial\overline{\text{F}}= \begin{bmatrix}\frac{\partial\overline{\text{F}}_{ 1}}{\partial\overline{\text{x}}_{1}}&\dots&\frac{\partial\overline{\text{F}}_{ 1}}{\partial\overline{\text{x}}_{n}}\\ \dots&\dots&\dots\\ \frac{\partial\overline{\text{F}}_{m}}{\partial\overline{\text{x}}_{1}}& \dots&\frac{\partial\overline{\text{F}}_{m}}{\partial\overline{\text{x}}_{n}} \end{bmatrix}  \tag{6}\]  
By doing IMD simulation in ADS for each of the frequency points, various IMDs can appear. Table 1 describes the 3 rd, 5 th, and 7 th order IMD levels in dBc (i.e., \(\text{IMD}_{3}\), \(\text{IMD}_{5}\), and \(\text{IMD}_{7}\)) for each frequency point. [PERSON]'s method is employed to our problem starting from Equations (3)-(5). Herein, initial IMD values with suitable function representation for each IMD must be prepared. Firstly, the initial values are achieved using the _Standard Deviations_ for values in each column of \(\text{IMD}_{3}\), \(\text{IMD}_{5}\), and \(\text{IMD}_{7}\). To obtain a clear idea on how to construct the function, Equation (7) presents the immediate instance of constructing \(\text{IMD}_{3}\) representation. For the presented IMD value at each frequency point, (i.e., \(\text{a}_{1}+\text{a}_{2}+\dots+\text{a}_{n}\)), and average mean (M) with variance (\(\sigma^{2}\)) values are calculated, and then the square root of Variance as Standard Deviation (\(\sigma\)) is obtained. \[ \begin{split}\text{M}_{\text{IMD}3}=(\text{a}_{1}+\text{a}_{2}+ \dots+\text{a}_{n})/\text{n}\\ \sigma^{2}_{\text{IMD}3}=(\text{a}_{1}^{2}+\text{a}_{2}^{2}+\dots+ \text{a}_{n}^{2})/\text{n}\\ \sigma_{\text{IMD}3}=\sqrt{\sigma^{2}_{\text{IMD}3}}\end{split}  \tag{7}\]  
Secondly, a function representing each IMD behavior must be constructed by determining the suitable coefficient at each frequency point. For this purpose, _fit_ function in MATLAB [44] is applied to the data points of each frequency presented in Table 1 and three functions representing third, fifth, and seventh IMDs are constructed. For example, third order IMD can be represented by: \(\text{f}_{\text{IMD}3}=\text{A}\text{a}_{1}+\text{B}\text{a}_{2}+\dots+\text {Na}_{n}\) where \(\text{A}\), \(\text{B}\), \(\dots\), and \(\text{N}\) are the coefficients achieved from 'fit' function. After achieving initial values for IMDs (i.e., \(\sigma_{\text{IMD}3}\), \(\sigma_{\text{IMD}5}\), and \(\sigma_{\text{IMD}7}\)) and constructing IMD equations such as \(\text{f}_{\text{IMD}3}\), \(\text{f}_{\text{IMD}5}\), and \(\text{f}_{\text{IMD}7}\), [PERSON]'s Method [45] is applied (here implemented in MATLAB). This method results in computing three optimized critical points as: \(\text{IMD}_{\text{3 opt}}\), \(\text{IMD}_{\text{5 opt}}\), and \(\text{IMD}_{\text{7 opt}}\). By using these data and applying [44] curve, an accurate optimized function (8) representing linearity is constructed where \(\text{L}_{1}\), \(\text{L}_{2}\), and \(\text{L}_{3}\) are the constant values (Step-10).