## 3 BBC Code Design and Optimization
### BBC Optimization  
The BBC sequence family can be generated through the process described in Section 3.1. To select the best-performing BBC sequences, this paper conducts a comprehensive evaluation based on five indicators: odd/even autocorrelation, maximum spectrum amplitude, odd/even cross-correlation, and others. The definitions and computational complexities of these indicators are shown in Table 2. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Evaluation Indicators** & **Definition** & **Computational Complexity** & **Computational Count** \\ \hline even autocorrelation & \(R_{(a,a)}(\tau)=\sum\limits_{i=0}^{N}a_{i}a_{i+\tau}\) & \(O(N^{2})\) & \(M^{2}\) \\ odd autocorrelation & \(R_{(a,a)}(\tau)=\sum\limits_{i=0}^{N-\tau-1}a_{i}a_{i+\tau}-\sum\limits_{i=N- \tau}^{N-1}a_{i}a_{i+\tau}\) & \(O(N^{2})\) & \(M\) \\ maximum spectrum amplitude & \(Spec=\max\lvert FT(a(n))\rvert\) & \(O(N\log_{2}(N))\) & \(M\) \\ even cross-correlation & \(R_{(a,b)}(\tau)=\sum\limits_{i=0}^{N}a_{i}b_{i+\tau}\)1  & \(O(N^{2})\) & \(M(M-1)/2\) \\ odd cross-correlation & \(R_{(a,b)}(\tau)=\sum\limits_{i=0}^{N-\tau-1}a_{i}b_{i+\tau}-\sum\limits_{i=N- \tau}^{N-1}a_{i}b_{i+\tau}\) & \(O(N^{2})\) & \(M(M-1)/2\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Preferred metrics and computational complexity. Figure 3: BBC design process. When the length of the Weil sequence is 1024, the size of its code family reaches \(1031\times 1031\), indicating a significant computational burden for evaluating each indicator. Therefore, to reduce the computational burden, indicators other than cross-correlation are used for preliminary screening. Different weights are assigned to each indicator, and the average of the weighted sums of all indicators for each sequence in the code family is calculated. Screening is then performed based on \(0.5\delta\) (standard deviation), as shown in Equation (11). Secondly, the odd/even cross-correlation indicator is used in the second step, applying the cross-correlation optimization method based on the maximum clique model, as shown in Equation (12). This method performs secondary screening on the candidate sequences obtained from the first step to derive the target number of BBC sequences with optimal performance. \[\delta=\sqrt{\frac{1}{N}\sum_{i=1}^{N}{(x_{i}-\mu)^{2}}} \tag{11}\]  
In the formula \(x_{i}\) represents the data value, \(\mu\) represents the overall mean. \[R=\left[ \begin{array}{cccccccc}0&d_{1,2}&d_{1,3}&d_{1,4}&\cdots&d_{1,n-1}&d_{ 1,n}\\ d_{1,2}&0&d_{2,3}&d_{2,4}&\cdots&d_{2,n-1}&d_{2,n}\\ d_{1,3}&d_{2,3}&0&d_{3,4}&\cdots&d_{3,n-1}&d_{3,n}\\ d_{1,4}&d_{2,4}&d_{3,4}&\ddots&\cdots&d_{4,n-1}&d_{4,n}\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots&\vdots\\ d_{1,n-1}&d_{2,n-1}&d_{3,n-1}&d_{4,n-1}&\cdots&0&d_{n-1,n}\\ d_{1,n}&d_{2,n}&d_{3,n}&d_{4,n}&\cdots&d_{n-1,n}&0\end{array} \right] \tag{12}\]  
In the formula, \(R\) is the cross-correlation performance matrix, where each PRN code is treated as a node, and the cross-correlation performance value \(d_{a(n),b(n)}\) is considered as the distance between nodes. By setting a threshold to determine whether two nodes are connected, the target number of BBC sequences can be obtained. The specific optimization process is shown in Figure 4.  
Figure 4: BBC optimization process. 1. Input the PRN code family designed with bit balance;
2. Sequentially input the PRN sequences from the code family into the loop to calculate the a, b, and ccc indicators for each sequence (a represents even autocorrelation, b represents odd autocorrelation, and c represents the maximum spectrum amplitude), obtaining the corresponding \(x_{a}^{n}\), \(x_{b}^{n}\) and \(x_{c}^{n}\) values, until the process is complete;
3. Assign weights to the three indicators a, b and c, denoted as \(z_{1}\), \(z_{2}\) and \(z_{3}\) (\(z_{1}+z_{2}+z_{3}=1\)). Calculate the total weighted sum \(y_{n}\) of the three indicators for each sequence, and determine the overall standard deviation \(\sigma\) of the code family.