How to perform Uplink synchronization between two SDR's?
Answers (1)
0 votes
Hi @Fahad,
I went through list of 5G functions listed at https://www.mathworks.com/help/5g/referencelist.html?type=function&listtype=cat&category=index&blocktype=all&capability=&startrelease=&endrelease= to able to answer your question. The key point is synchronization which is essential to ensure that the gNB can accurately receive and decode the signals sent from the UE. Now, you probably aware of synchronization in 5G involves both time and frequency alignment. To achieve timing synchronization, the UE must align its transmission timing with the gNB’s expected timing which is typically achieved through a Random Access Channel (RACH) procedure where a preamble is sent by the UE to initiate communication. In order to achieve frequency synchronization, both SDRs need to operate on the same frequency band by getting them configured in the carrier settings. Also, adding a preamble is crucial for initial synchronization during the RACH procedure. The gNB uses this preamble to identify the UE and synchronize its timing. Here is a simplified example of how to generate an uplink signal using MATLAB's 5G Toolbox:
% Carrier configuration
carrierConfig = nrCarrierConfig('NCellID', 0, 'SubcarrierSpacing', 30,
‘Bandwidth', 'B20');
% Preamble configuration
preambleConfig = nrPRACHConfig('Format', 'Format0', 'NCS', 0, 'NID', 0);
% Generate preamble symbols
[preambleSymbols, preambleIndices] = nrPRACH(preambleConfig, carrierConfig);
% Uplink Signal Generation
% Generate PUSCH configuration
puschConfig = nrPUSCHConfig('Modulation', 'QPSK', 'NumLayers', 1);
data = randi([0 1], puschConfig.NumSymbols*2, 1); % Random data bits
% Generate PUSCH symbols
puschSymbols = nrPUSCH(puschConfig, data);
% Combine preamble and PUSCH symbols into one signal
uplinkSignal = [preambleSymbols; puschSymbols];
% OFDM Modulation
modulatedSignal = nrOFDMModulate(uplinkSignal, carrierConfig);
% Transmit modulated signal from SDR-1 to SDR-2
% Assuming you have setup for SDR hardware transmission
transmitSDR(SDR1, modulatedSignal);
Please let me know if you have any further questions.
Categories
Find more on 5G Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!