# A Non-WSSUS Channel Simulator for V2X Communication Systems
## 5 The Proposed Vehicular Channel Simulator

Table 3: Pseudocode of the proposed channel simulator. Table 4 shows the pseudocode to simulate a V2X communication system to evaluate its performance in terms of the BER. The implementation should consider a set of specifications (e.g., IEEE 802.11p or LTE-V2X) to set the frequency and time parameters. The first step is to set the amount of data symbols \(F\) on each frame. Next, the total number of symbols is specified according to the standard. For the IEEE 802.11p, two training symbols are added at the beginning of each frame to obtain the initial channel estimation [11]. Therefore, each frame contains \(K=F+2\) OFDM symbols. On the other hand, the number of symbols is fixed in the LTE-V2X specifications. There are 14 symbols in total, from which nine are used for data [14]. The next step is to establish the desired range of the energy per bit-to-noise spectral density ratio (Eb/No) to simulate data transmission over different noise levels. The parameters of the multicarrier scheme (number of data and total subcarriers, number of pilots) are then configured according to the specifications for the desired bandwidth. For instance, we can follow the parameters in Table 1 for a 10 MHz bandwidth. Moreover, the specifications for DSRC and C-V2X communications differ in the type of pilots. In the case of IEEE 802.11p, it defines four subcarriers as pilots, whereas the LTE-V2X specifications consider four complete symbols. After defining those values, the parameters for the propagation scenario are established, and a matrix that represents the transmitted symbols (including data and pilots) is generated randomly for each noise level. Since the simulator is based on the Monte Carlo principle, \(n\) realizations of the transmission process are necessary to obtain an average performance metric. For each iteration, a channel transfer function is calculated by calling the function _GenerateChannel_, which depends on the deterministic parameters described above. Subsequently, the data transmission is simulated following Equation (1). This simulator can be employed to evaluate different schemes, such as channel estimation. Therefore, we perform such transmission tasks and assess their performance over the generated channel. Finally, the BER is averaged for all iterations. \begin{table}
\begin{tabular}{l} \hline \hline
**function generateSystem** \\ \hline Set simulation and system parameters: \\ Number of data symbols \(F\) \\ Total number of transmitted symbols \(K\) \\ Total number of subcarriers \(N_{p}\) \\ Number of pilots and data subcarriers \(N_{pp},\ N_{pd}\) \\ Number of iterations \(n\) \\ Vector for the Eb/No values \(P\) \\ Set parameters for the propagation scenario: \\ Number of IOs \(\mathcal{L}\) \\ MSs initial speeds, acceleration components, and direction parameters \\ \(v_{T},v_{R},a_{T},a_{R},\gamma_{T},\gamma_{R},\rho_{T}\), and \(\rho_{R}\) \\ Scattering parameters \(\mu_{R},\kappa\) \\ Initial distance \(D\) (between \(T_{X}\) and \(R_{X}\)) \\ Ring radius \(d\) (between \(R_{X}\) and the \(\ell\)-th IO) \\ Generate training and data symbols randomly \\ Modulate training and data symbols \\ Organize training and data symbols in matrix \(\mathbf{X}\) \\ Initialize accumulated number of errors \(B=0\) \\ for \(i\)=0 to \(n-1\) \\ Call **GenerateChannel(\(v_{T}\), \(v_{R}\), \(a_{T}\), \(a_{R}\), \(\gamma_{T}\), \(\gamma_{R}\), \(\rho_{T}\), \(\rho_{R}\), \(\mathcal{L}\), \(\mu_{R},\kappa,K\))** \\ to compute channel transfer function matrix \(\mathbf{\tilde{H}}\) \\ Simulate data transmission over \(\mathbf{\tilde{H}}\) \\ Add AWGN \\ Perform transmission scheme to be evaluated \\ Conduct channel equalization \\ Demodulate data \\ Compute and accumulate number of errors on \(B\) \\ end for \\ Average \(B\) over \(n\) iterations to obtain the BER \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Pseudocode for the simulation of V2X communications systems.