# Precoder and Decoder Co-Designs for Radar and Communication Spectrum Sharing +
## 3 Max-SINR Joint Precoder-Decoder Design
### Distributed Max-SINR Precoder-Decoder Design
```
1:Estimate radar channel \(\mathbf{H}_{[R]}\) and radar's interference channel \(\mathbf{H}_{[iR]}\)
2:Initialize \(\mathbf{P}_{[i]}\mathbf{Q}_{[i]}\) with independent row vectors, \(\forall i\in\mathcal{A}\cup\mathcal{B}\)
3:repeat
4:repeat
5: Identify location and type of \(i\)th node, \(\forall i\in\mathcal{A}\cup\mathcal{B}\)
6: Choose \(Z_{[i]}\) according to its location and type
7: Calculate transmitted signal power according to Equation (14)
8: Calculate interference pulse noise covariance matrix \(\mathbf{D}_{[i]}\) according to Equation (15)
9: Find \(N_{\text{sc}}\times d_{[i]}\) matrix \(\mathbf{Q}_{[i]}\) on each receiver according to (16)
10:until All \(\mathbf{Q}_{[i]}\) are found
11:repeat
12: Use channel reciprocity
13: Identify location and type of \(i\)th node, \(\forall i\in\mathcal{A}\cup\mathcal{B}\)
14: Choose \(Z_{[i]}\) according to its location and type
15: Calculate power of reciprocal transmitted signal according to Equation (14)
16: Calculate interference pulse noise covariance matrix \(\mathbf{D}_{[i]}\) of reciprocal signal according to Equation (15)
17: Calculate \(N_{\text{sc}}\times d_{[i]}\) matrix \(\mathbf{P}_{[i]}\) on each reciprocal receiver according to (16)
18:until All \(\mathbf{P}_{[i]}\) are calculated
19: Check rank of \(\mathbf{Q}_{[i]}^{H}\mathbf{H}_{[i]}\mathbf{P}_{[i]}\) to verify (14b). 20:until (14b) is satisfied and (13) has converged or iteration count is larger than tolerance threshold
```  
**Algorithm 1** Max-SINR design algorithm  
The proposed distributed algorithm operates for finding precoders and decoders in an alternating manner. We start by finding solutions for \(\mathbf{Q}_{[i]}\) at each receiver from (13), with fixed \(\mathbf{P}_{[i]}\), \(\mathbf{P}_{[i]}\), \(\mathbf{Q}_{[j]}\),\(\forall i\
eq j\); \(\forall i,j\in\mathcal{A}\cup\mathcal{B}\). Precoders \(\mathbf{P}_{[i]}\) are found using fixed decoders \(\mathbf{Q}_{[i]}\), \(\mathbf{Q}_{[j]}\), \(\forall i\
eq j\); \(\forall i\in\mathcal{A}\cup\mathcal{B}\), where \(j\) is selected based on its node type and location. In the next stage, we will reverse the signal direction, the original transmitter will be treated as a receiver, and the original receiver will be treated as a transmitter. Consequently, a solution of decoders can be found, actually the original \(\mathbf{P}_{[i]}\)'s solution for each \(i\)th receiver (original transmitter) from (13), while fixing \(\mathbf{Q}_{[i]}\), \(\mathbf{Q}_{[j]}\) and \(\mathbf{P}_{[j]}\), where \(j\) is chosen based on its node type and location. For each precoder and decoder, the rank of signal space is checked after one solution is obtained. This iteration will continue until convergence, which is evaluated by comparing (13a) to a threshold value or until the iteration count reaches its maximum value. The constraint (13b) may also be relaxed by considering matrix dimension \(N\) as \(d_{[i]}\) at the \(i\)th user. This condition guarantees that a trivial and useless solution of all zeros is avoided. Consequently, we design an \(N_{\text{sc}}\times d_{[i]}\) precoder and a \(d_{[i]}\times N_{\text{sc}}\) decoder for the \(i\)th node. Note that the precoder and the decoder for both radar and communication subsystems in a colocated node could be found jointly by the proposed algorithm. The difference is that the precoder of radar and communication subsystems in a colocated node will be designed simultaneously at the first stage and the decoder at the second stage, while precoders and decoders of other nodes are designed in each node in a distributed manner. In cases where radar and communication subsystems are colocated and consequently suffer from the same interference, the interference channel matrix that is estimated by the communication system could easily be used in radar precoder and decoder design. Furthermore, if noise statistics are the same in both the radar and communication subsystems in the colocated node, the interference plus noise covariance matrix is also identical.