main content

simulate propagation channels -凯发k8网页登录

this example shows how to simulate propagation channels. it demonstrates how to generate cell-specific reference signals, map them onto a resource grid, perform ofdm modulation, and pass the result through a fading channel.

specify the cell-wide settings as fields in the structure enb. many of the functions used in this example require a subset of these fields.

enb.ndlrb = 9;
enb.cyclicprefix = 'normal';
enb.phichduration = 'normal';
enb.cfi = 3;
enb.ng = 'sixth';
enb.cellrefp = 1;
enb.ncellid = 10;
enb.nsubframe = 0;
enb.duplexmode = 'fdd';
antennaport = 0;

resource grid and transmission waveform

generate a subframe resource grid. to create the resource grid, call the function. this function creates an empty resource grid for one subframe.

subframe = ltedlresourcegrid(enb);

generate cell-specific reference symbols (cellrs) and map them onto the resource elements (res) of a resource grid using linear indices.

cellrssymbols = ltecellrs(enb,antennaport);
cellrsindices = ltecellrsindices(enb,antennaport,{'1based'});
subframe(cellrsindices) = cellrssymbols;

perform ofdm modulation of the complex symbols in a subframe, subframe, using cell-wide settings structure enb.

[txwaveform,info] = lteofdmmodulate(enb,subframe);

the first output argument, txwaveform, contains the transmitted ofdm modulated symbols. the second output argument, info, is a structure that contains details about the modulation process. the field info.samplingrate provides the sampling rate, rsampling, of the time domain waveform:

rsampling=30.72mhz2048×nfft,

where nfft is the size of the ofdm inverse fourier transform (ift).

propagation channel

construct the lte multipath fading channel. first, set up the channel parameters by creating a structure, channel.

channel.seed = 1;
channel.nrxants = 1;
channel.delayprofile = 'eva';
channel.dopplerfreq = 5;
channel.mimocorrelation = 'low';
channel.samplingrate = info.samplingrate;
channel.inittime = 0;

the sampling rate in the channel model, channel.samplingrate, must be set to the info field of the samplingrate returned by the function.

pass data through the lte fading channel by calling the ltefadingchannel function. this function generates an lte multipath fading channel, as specified in ts 36.101 (see reference [1]). the first input argument, txwaveform, is an array of lte transmitted samples. each row contains the waveform samples for each of the transmit antennas. these waveforms are filtered with the delay profiles as specified in the parameter structure, channel.

rxwaveform = ltefadingchannel(channel,txwaveform);

received waveform

the output argument, rxwaveform, is the channel output signal matrix. each row corresponds to the waveform at each of the receive antennas. since you have defined one receive antenna, the number of rows in the rxwaveform matrix is one.

size(rxwaveform)
ans = 1×2
        1920           1

plot signal before and after fading channel

display a spectrum analyzer with before-channel and after-channel waveforms, using welch's spectrum estimation method.

title = 'waveform before and after fading channel';
sascope = spectrumanalyzer(samplerate=info.samplingrate, method='welch', showlegend=true,...
     title = title,channelnames={'before','after'});
sascope([txwaveform,rxwaveform]);

references

  1. 3gpp ts 36.101 "user equipment (ue) radio transmission and reception".

see also

| |

related examples

    more about

    网站地图