LTE Transmitter Using Analog Devices AD9361/AD9364
This example shows how to use the Xilinx® Zynq-Based Radio Support Package with MATLAB® and LTE Toolbox™ to generate an LTE transmission. The transmitted signal can be received by the companion LTE Receiver Using Analog Devices AD9361/AD9364 example if you have a second SDR platform.
Refer to the Guided Host-Radio Hardware Setup documentation for details on configuring your host computer to work with the Support Package for Xilinx® Zynq-Based Radio.
LTE Toolbox can be used to generate standard-compliant baseband IQ downlink and uplink reference measurement channel (RMC) waveforms and downlink test model (E-TM) waveforms. These baseband waveforms can be modulated for RF transmission using SDR Radio hardware such as Xilinx Zynq-Based Radio.
In this example eight frames of a baseband RMC waveform are generated using the LTE Toolbox. A continuous RF LTE waveform is created by looping transmission of these eight frames with the Zynq® radio hardware for a user-specified time period.
The resultant waveform can be captured and the broadcast channel decoded using the companion example LTE Receiver Using Analog Devices™ AD9361/AD9364, if you have a second SDR platform.
This example requires LTE Toolbox to run. Before running this example ensure you have performed the following steps:
Configure your host computer to work with the Support Package for Xilinx Zynq-Based Radio. See Guided Host-Radio Hardware Setup for help. Some additional steps may be required if you want to run two radios from a single host computer. See Setup for Two Radios Connecting to One Host for help.
Ensure that you have a suitable receiver. This example is designed to work in conjunction with the LTE Receiver Using Analog Devices AD9361/AD9364 example.
You can use this example with an AD936x or an FMCOMMS5 radio hardware. By default, the example is configured to run with AD936x. To configure the example for FMCOMMS5, you must use the comm.SDRTxFMCOMMS5 object instead of the comm.SDRTxAD936x object. To update the example for FMCOMMS5, follow the instructions in the inline comments.
% Check that LTE Toolbox is installed, and that there is a valid license if isempty(ver('lte')) % Check for LST install error('zynqRadioLTETransmitter:NoLST','Please install LTE Toolbox to run this example.'); elseif ~license('test', 'LTE_Toolbox') % Check that a valid license is present error('zynqRadioLTETransmitter:NoLST','A valid license for LTE Toolbox is required to run this example.'); end
Running the Example
The example can be run by executing zynqRadioLTETransmitterAD9361AD9364ML.m. The transmitter is controlled using the values in the txsim structure. In particular, you may wish to increase the txsim.RunTime parameter to ensure the transmission is active long enough for the receive example to execute. In this example the cell identity, and initial frame number can be customized.
txsim.RC = 'R.4'; % Base RMC configuration, 1.4 MHz bandwidth. txsim.NCellID = 17; % Cell identity txsim.NFrame = 700; % Initial frame number txsim.TotFrames = 8; % Number of frames to generate txsim.RunTime = 20; % Time period to loop waveform in seconds txsim.DesiredCenterFrequency = 2.45e9; % Center frequency in Hz
Transmitter Design: System Architecture
The general structure of the LTE transmitter can be described as follows:
Generate a baseband LTE signal using LTE Toolbox
Prepare the baseband signal for transmission using the SDR hardware
Send the baseband data to the SDR hardware for upsampling and transmission at the desired center frequency
Generating the Baseband LTE Signal
The default configuration parameters defined in TS36.101 Annex A.3 [ 1 ] required to generate an RMC are provided by
lteRMCDLTool (LTE Toolbox). The parameters within the configuration structure
rmc can then be customized as required. The baseband waveform,
eNodeBOutput, a fully populated resource grid,
txGrid, and the full configuration of the RMC are created using
lteRMCDLTool (LTE Toolbox).
% Generate RMC configuration and customize parameters rmc = lteRMCDL(txsim.RC); rmc.NCellID = txsim.NCellID; rmc.NFrame = txsim.NFrame; rmc.TotSubframes = txsim.TotFrames*10; % 10 subframes per frame rmc.OCNGPDSCHEnable = 'On'; % Add noise to unallocated PDSCH resource elements % Generate RMC waveform trData = [1;0;0;1]; % Transport data [eNodeBOutput,txGrid,rmc] = lteRMCDLTool(rmc,trData); txsim.SamplingRate = rmc.SamplingRate;
Display the resource grid populated with the highlighted channels. Then display the power spectral density of the LTE baseband signal. You can see 1.4 MHz signal bandwidth at baseband.
transmitResourceGridPlot = sdrzPlotDLResourceGrid(rmc,txGrid); transmitResourceGridPlot.CurrentAxes.Children(1).EdgeColor = 'none'; title('Transmitted Resource Grid'); % Display the power spectral density spectrumScope = spectrumAnalyzer( ... 'SampleRate', txsim.SamplingRate, ... 'SpectrumType', 'Power density', ... 'SpectralAverages', 10, ... 'Title', 'Baseband LTE Signal Spectrum', ... 'YLimits', [-90 -50], ... 'YLabel', 'Power spectral density'); spectrumScope(eNodeBOutput);
Preparing for Transmission
The transmitter plays the LTE signal in a loop. The baseband signal is split into LTE frames of data, and a full LTE frame is transmitted using the SDR Transmitter object. The baseband LTE signal is reshaped into an M-by-N array, where M is the number of samples per LTE frame and N is the number of frames generated.
This example communicates with the radio hardware using the
comm.SDRRxAD936x System object.
txsim.RadioCenterFrequency = txsim.DesiredCenterFrequency; txsim.RadioChannelMapping = 1; txsim.SDRDeviceName = 'AD936x'; % To update the example for FMCOMMS5, set |txsim.SDRDeviceName| to % |'FMCOMMS5'|. radio = sdrdev(txsim.SDRDeviceName); sdrTransmitter = sdrtx( ... txsim.SDRDeviceName, ... 'IPAddress', '192.168.3.2', ... 'CenterFrequency', txsim.RadioCenterFrequency, ... 'ChannelMapping', txsim.RadioChannelMapping, ... 'BasebandSampleRate', txsim.SamplingRate, ... 'ShowAdvancedProperties', true, ... 'BypassUserLogic', true); % Scale the signal for better power output and cast to int16. This is the % native format for the SDR hardware. Since we are transmitting the same % signal in a loop, we can do the cast once to save processing time. powerScaleFactor = 0.7; eNodeBOutput = eNodeBOutput.*(1/max(abs(eNodeBOutput))*powerScaleFactor); eNodeBOutput = int16(eNodeBOutput*2^15); % LTE frames are 10 ms long samplesPerFrame = 10e-3*txsim.SamplingRate; numFrames = length(eNodeBOutput)/samplesPerFrame; % Ensure we are using an integer number of frames if mod(numFrames,1) warning(message('sdrpluginbase:zynqradioExamples:NonIntNumFrames')); numFrames = floor(numFrames); end % Reshape the baseband LTE data into frames and create dummy second % channel data fprintf('Splitting transmission into %i frames\n',numFrames) txFrame = reshape(eNodeBOutput(1:samplesPerFrame*numFrames),samplesPerFrame,numFrames);
Splitting transmission into 8 frames
Transmission using SDR Hardware
The transfer of baseband data to the SDR hardware is enclosed in a try/catch block. This means that if an error occurs during the transmission, the hardware resources used by the SDR System object™ are released. The sdrTransmitter System object transmits a full frame of LTE data.
fprintf('Starting transmission at Fs = %g MHz\n',txsim.SamplingRate/1e6) currentTime = 0; try while currentTime<txsim.RunTime for n = 1:numFrames bufferUnderflow = sdrTransmitter(txFrame(:,n)); if bufferUnderflow~=0 warning(message('sdrpluginbase:zynqradioExamples:DroppedSamples')); end end currentTime = currentTime+numFrames*10e-3; % One frame is 10 ms end catch ME release(sdrTransmitter); rethrow(ME) end fprintf('Transmission finished\n') release(sdrTransmitter);
Starting transmission at Fs = 1.92 MHz ## Establishing connection to hardware. This process can take several seconds. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Warning: Dropped samples. Transmission finished
Things to Try
The companion example LTE Receiver Using Analog Devices AD9361/AD9364 can be used to decode the broadcast channel of the waveform generated by this example. Try changing the cell identity and initial system frame number and observe the detected cell identity and frame number at the receiver.
Troubleshooting the Example
General tips for troubleshooting SDR hardware can be found in Common Problems and Fixes.
List of Example Helper Files
This example uses the following helper files:
sdrzPlotDLResourceGrid.m: plots the transmit resource grid
3GPP TS 36.191. "User Equipment (UE) radio transmission and reception." 3rd Generation Partnership Project; Technical Specification Group Radio Access Network; Evolved Universal Terrestrial Radio Access (E-UTRA).