Table of contents
1. Algorithm simulation effect
2. Algorithms involve an overview of theoretical knowledge
2.1. Data Generation and Encoding
2.5. Channel transmission and reception
4. Complete algorithm code file
1. Algorithm simulation effect
The matlab2022a simulation results are as follows:
2. Algorithms involve an overview of theoretical knowledge
In-vehicle communication systems refer to technologies that communicate between vehicles or between vehicles and infrastructure. With the development of 5G new radio communication technology (5G-NR) and multiple-input multiple-output (MIMO) technology, the transmission rate and transmission reliability of vehicle communication systems have been significantly improved. This article will introduce in detail the MATLAB performance simulation of the vehicular communication system based on 5G-NR and MIMO, including mathematical principles, implementation process and application fields.
2.1. 5G-NR technology
5G New Radio Communication Technology (5G-NR) is the fifth generation of mobile communication technology, which uses higher frequency and larger bandwidth to achieve higher transmission rate and better communication experience. 5G-NR technology has the following characteristics in the vehicle communication system:
-
Higher frequency: 5G-NR technology adopts higher frequency, which can provide larger bandwidth and achieve higher data transmission rate.
-
Large-scale antenna array: 5G-NR technology supports a large-scale antenna array (Massive MIMO), and data transmission is performed through multiple antennas to improve the transmission performance and anti-interference ability of the system.
-
Multi-user multiple-input multiple-output (MU-MIMO): 5G-NR technology supports multiple-user multiple-input multiple-output technology, which can provide high-speed data transmission for multiple users at the same time.
2.2. MIMO technology
Multiple-input multiple-output (MIMO) technology is a technology that uses multiple antennas for data transmission, which can significantly improve signal transmission rate and anti-interference. In the vehicle communication system, MIMO technology can be applied to the communication between the vehicle and the infrastructure, and can also be applied to the communication between vehicles. The mathematical principles of MIMO technology are as follows:
2.3 Implementation process
The MATLAB performance simulation of the vehicle communication system based on 5G-NR and MIMO mainly includes the steps of coding, signal modulation, OFDM modulation and MIMO technology.
2.1. Data Generation and Encoding
At the sending end of the communication system, an original data sequence x(n)x(n) is generated. According to application requirements, the original data can be encoded, such as error correction encoding or compression encoding, to improve data transmission reliability and save bandwidth.
2.2. Signal Modulation
The coded data sequence x(n)x(n) is subjected to signal modulation. According to the application requirements and the specifications of the communication system, select the appropriate modulation method, such as binary phase shift keying (BPSK), quaternary phase shift keying (QPSK) or hexadecimal phase shift keying (16-QAM), etc.
2.3. OFDM modulation
The modulated signal is modulated by OFDM. According to the specification of the communication system, select the appropriate number of subcarriers NN and the modulation method. For example, in 5G-NR, you can choose 20 MHz, 40 MHz or 80 MHz bandwidth to divide the data into different numbers of subcarriers.
2.4. MIMO technology
After OFDM modulation, the signals are sent to multiple transmitting antennas, and MIMO technology is used for data transmission. According to the antenna configuration and communication distance of the vehicle communication system, select the appropriate MIMO technology, such as massive antenna array (Massive MIMO) or multi-user multiple input multiple output (MU-MIMO).
2.5. Channel transmission and reception
The channel model of the vehicle communication system is established by MATLAB, and the transmission process of signals between vehicles or between vehicles and infrastructure is simulated. At the receiving end, after receiving the signal transmitted through the channel, decoding and OFDM demodulation are performed to restore the original data sequence.
3. MATLAB core program
ofdm_modulated_data = ofdm_mod(reshaped_modulated_data, pilot_data); %% OFDM modulation
[faded_data, channel_path_gain] = mimo_fading_channel(ofdm_modulated_data); %% Adding fading effect on the data symbols
transmitted_data = faded_data;
signal_power = 10*log10(var(transmitted_data)); %% Calculating signal power
noise_variance = (10.^(0.1.*(signal_power - snr_dB))) * noise_factor; %% Calculating noise variance
recevied_data = awgn_channel(transmitted_data, noise_variance); %% Passing the transmitted data symbols through AWGN channel
%%% OFDM Demodulation
ofdm_demodulated_data = ofdm_demod(recevied_data);
[len, ~, ~] = size(ofdm_demodulated_data);
ofdm_demodulated_data = ofdm_demodulated_data((margin + 1):(len - margin), :, :);
%%% OFDM Demodulation
%%% Initializing channel estimation parameter
channel_estimation_parameter.N_r_blk = N_r_blk;
channel_estimation_parameter.N_subc = N_subc;
channel_estimation_parameter.N_sym_sub = N_sym_sub;
channel_estimation_parameter.N_tant = N_tant;
channel_estimation_parameter.N_rant = N_rant;
channel_estimation_parameter.fft_length = fft_length;
channel_estimation_parameter.cyclic_prefix_length = cyclic_prefix_length;
channel_estimation_parameter.path_delay = path_delay;
channel_estimation_parameter.sampling_frequency = sampling_frequency;
channel_estimation_parameter.channel_path_gain = channel_path_gain;
channel_estimation_parameter.number_of_paths = number_of_paths;
channel_estimation_parameter.data_subcarrier_indices = data_subcarrier_indices;
%%% Initializing channel estimation parameter
channel_estimation_matrix = Ideal_Channel_Estimation(channel_estimation_parameter); %% Getting channel estimation matrix
%%% Preparing the ofdm demodulated data symbols for equalization purpose
processed_ofdm_demodulated_data = complex(zeros(N_r_blk * N_subc * N_sym_sub, N_rant));
for i=1:N_rant
tmp = ofdm_demodulated_data(:, :, i);
tmp = reshape(tmp, N_r_blk * N_subc * N_sym_sub, 1);
processed_ofdm_demodulated_data(:, i) = tmp;
end
%%% Preparing the ofdm demodulated data symbols for equalization purpose
if eq_mode == 1
equalized_data = ZF_Equalize(processed_ofdm_demodulated_data, channel_estimation_matrix);
elseif eq_mode == 2
equalized_data = MMSE_Equalize(processed_ofdm_demodulated_data, channel_estimation_matrix, noise_variance);
end
reshaped_equalized_data = equalized_data(:); %% Collapsing OFDM demodulated data symbols
demodulated_data = demodulator_hard(reshaped_equalized_data); %% Demodulating
viterbi_decoded_data = viterbi_decoder(demodulated_data); %% Decoding the data bits using convolutional decoder
viterbi_useful_data = viterbi_decoded_data(1:(N_bits_pframe + crc_bit)); %% Filtering the decoded data bits
[crc_decoded_data, frame_error] = step(crc_24_detector, viterbi_useful_data); %% Detecting frame error using CRC detector
%%% Counting error frames as well as total frames
if frame_error == 1
cnt2 = cnt2 + 1;
end
cnt1 = cnt1 + 1;
%%% Counting error frames as well as total frames
0X_017m
4. Complete algorithm code file
V