lte downlink channel estimation and equalization -凯发k8网页登录
this example shows how to use the lte toolbox™ to create a frame worth of data, pass it through a fading channel and perform channel estimation and equalization. two figures are created illustrating the received and equalized frame.
introduction
this example shows how a simple transmitter-channel-receiver simulation may be created using functions from the lte toolbox. the example generates a frame worth of data on one antenna port. as no transport channel is created in this example the data is random bits, qpsk modulated and mapped to every symbol in a subframe. a cell specific reference signal and primary and secondary synchronization signals are created and mapped to the subframe. 10 subframes are individually generated to create a frame. the frame is ofdm modulated, passed through an extended vehicular a model (eva5) fading channel, additive white gaussian noise added and demodulated. mmse equalization using channel and noise estimation is applied and finally the received and equalized resource grids are plotted.
cell-wide settings
the cell-wide settings are specified in a structure enb
. a number of the functions used in this example require a subset of the settings specified below. in this example only one transmit antenna is used.
enb.ndlrb = 15; % number of resource blocks enb.cellrefp = 1; % one transmit antenna port enb.ncellid = 10; % cell id enb.cyclicprefix = 'normal'; % normal cyclic prefix enb.duplexmode = 'fdd'; % fdd
snr configuration
the operating snr is configured in decibels by the value snrdb
which is also converted into a linear snr.
snrdb = 22; % desired snr in db snr = 10^(snrdb/20); % linear snr rng('default'); % configure random number generators
channel model configuration
the channel model is configured using a structure. in this example a fading channel with an extended vehicular a (eva) delay profile and 120hz doppler frequency is used. these parameters along with mimo correlation and other channel model specific parameters are set.
cfg.seed = 1; % channel seed cfg.nrxants = 1; % 1 receive antenna cfg.delayprofile = 'eva'; % eva delay spread cfg.dopplerfreq = 120; % 120hz doppler frequency cfg.mimocorrelation = 'low'; % low (no) mimo correlation cfg.inittime = 0; % initialize at time zero cfg.nterms = 16; % oscillators used in fading model cfg.modeltype = 'gmeds'; % rayleigh fading model type cfg.initphase = 'random'; % random initial phases cfg.normalizepathgains = 'on'; % normalize delay profile power cfg.normalizetxants = 'on'; % normalize for transmit antennas
channel estimator configuration
a user defined window is used to average pilot symbols to reduce the effect of noise. the averaging window size is configured in terms of resource elements (res), in time and frequency. a conservative 9-by-9 window is used in this example as an eva delay profile and 120hz doppler frequency cause the channel changes quickly over time and frequency. a 9-by-9 window includes the 4 pilots immediately surrounding the pilot of interest when averaging. selecting an averaging window is discussed in .
cec.pilotaverage = 'userdefined'; % pilot averaging method cec.freqwindow = 9; % frequency averaging window in res cec.timewindow = 9; % time averaging window in res
interpolation is performed by the channel estimator between pilot estimates to create a channel estimate for all res. to improve the estimate multiple subframes can be used when interpolating. an interpolation window of 3 subframes with a centered interpolation window uses pilot estimates from 3 consecutive subframes to estimate the center subframe.
cec.interptype = 'cubic'; % cubic interpolation cec.interpwinsize = 3; % interpolate up to 3 subframes % simultaneously cec.interpwindow = 'centred'; % interpolation windowing method
subframe resource grid size
in this example it is useful to have access to the subframe resource grid dimensions. these are determined using . this function returns an array containing the number of subcarriers, number of ofdm symbols and number of transmit antenna ports in that order.
gridsize = ltedlresourcegridsize(enb); k = gridsize(1); % number of subcarriers l = gridsize(2); % number of ofdm symbols in one subframe p = gridsize(3); % number of transmit antenna ports
transmit resource grid
an empty resource grid txgrid
is created which will be populated with subframes.
txgrid = [];
payload data generation
as no transport channel is used in this example the data sent over the channel will be random qpsk modulated symbols. a subframe worth of symbols is created so a symbol can be mapped to every resource element. other signals required for transmission and reception will overwrite these symbols in the resource grid.
% number of bits needed is size of resource grid (k*l*p) * number of bits % per symbol (2 for qpsk) numberofbits = k*l*p*2; % create random bit stream inputbits = randi([0 1], numberofbits, 1); % modulate input bits inputsym = ltesymbolmodulate(inputbits,'qpsk');
frame generation
the frame will be created by generating individual subframes within a loop and appending each created subframe to the previous subframes. the collection of appended subframes are contained within txgrid
. this appending is repeated ten times to create a frame. when the ofdm modulated time domain waveform is passed through a channel the waveform will experience a delay. to avoid any samples being missed due to this delay an extra subframe is generated, therefore 11 subframes are generated in total. for each subframe the cell-specific reference signal (cell rs) is added. the primary synchronization signal (pss) and secondary synchronization signal (sss) are also added. note that these synchronization signals only occur in subframes 0 and 5, but the lte toolbox takes care of generating empty signals and indices in the other subframes so that the calling syntax here can be completely uniform across the subframes.
% for all subframes within the frame for sf = 0:10 % set subframe number enb.nsubframe = mod(sf,10); % generate empty subframe subframe = ltedlresourcegrid(enb); % map input symbols to grid subframe(:) = inputsym; % generate synchronizing signals psssym = ltepss(enb); ssssym = ltesss(enb); pssind = ltepssindices(enb); sssind = ltesssindices(enb); % map synchronizing signals to the grid subframe(pssind) = psssym; subframe(sssind) = ssssym; % generate cell specific reference signal symbols and indices cellrssym = ltecellrs(enb); cellrsind = ltecellrsindices(enb); % map cell specific reference signal to grid subframe(cellrsind) = cellrssym; % append subframe to grid to be transmitted txgrid = [txgrid subframe]; %#ok end
ofdm modulation
in order to transform the frequency domain ofdm symbols into the time domain, ofdm modulation is required. this is achieved using . the function returns two values; a matrix txwaveform
and a structure info
containing the sampling rate. txwaveform
is the resulting time domain waveform. each column contains the time domain signal for each antenna port. in this example, as only one antenna port is used, only one column is returned. info.samplingrate
is the sampling rate at which the time domain waveform was created. this value is required by the channel model.
[txwaveform,info] = lteofdmmodulate(enb,txgrid); txgrid = txgrid(:,1:140);
fading channel
the time domain waveform is passed through the channel model (ltefadingchannel
) configured by the structure cfg
. the channel model requires the sampling rate of the time domain waveform so the parameter cfg.samplingrate
is set to the value returned by lteofdmmodulate
. the waveform generated by the channel model function contains one column per receive antenna. in this example one receive antenna is used, therefore the returned waveform has one column.
cfg.samplingrate = info.samplingrate;
% pass data through the fading channel model
rxwaveform = ltefadingchannel(cfg,txwaveform);
additive noise
the snr is given by where is the energy of the signal of interest and is the noise power. the noise added before ofdm demodulation will be amplified by the fft. therefore to normalize the snr at the receiver (after ofdm demodulation) the noise must be scaled. the amplification is the square root of the size of the fft. the size of the fft can be determined from the sampling rate of the time domain waveform (info.samplingrate
) and the subcarrier spacing (15 khz). the power of the noise to be added can be scaled so that and are normalized after the ofdm demodulation to achieve the desired snr (snrdb
).
% calculate noise gain n0 = 1/(sqrt(2.0*enb.cellrefp*double(info.nfft))*snr); % create additive white gaussian noise noise = n0*complex(randn(size(rxwaveform)),randn(size(rxwaveform))); % add noise to the received time domain waveform rxwaveform = rxwaveform noise;
synchronization
the offset caused by the channel in the received time domain signal is obtained using . this function returns a value offset
which indicates how many samples the waveform has been delayed. the offset is considered identical for waveforms received on all antennas. the received time domain waveform can then be manipulated to remove the delay using offset
.
offset = ltedlframeoffset(enb,rxwaveform); rxwaveform = rxwaveform(1 offset:end,:);
ofdm demodulation
the time domain waveform undergoes ofdm demodulation to transform it to the frequency domain and recreate a resource grid. this is accomplished using . the resulting grid is a 3-dimensional matrix. the number of rows represents the number of subcarriers. the number of columns equals the number of ofdm symbols in a subframe. the number of subcarriers and symbols is the same for the returned grid from ofdm demodulation as the grid passed into lteofdmmodulate
. the number of planes (3rd dimension) in the grid corresponds to the number of receive antennas.
rxgrid = lteofdmdemodulate(enb,rxwaveform);
channel estimation
to create an estimation of the channel over the duration of the transmitted resource grid is used. the channel estimation function is configured by the structure cec
. ltedlchannelestimate
assumes the first subframe within the resource grid is subframe number enb.nsubframe
and therefore the subframe number must be set prior to calling the function. in this example the whole received frame will be estimated in one call and the first subframe within the frame is subframe number 0. the function returns a 4-d array of complex weights which the channel applies to each resource element in the transmitted grid for each possible transmit and receive antenna combination. the possible combinations are based upon the enodeb configuration enb
and the number of receive antennas (determined by the size of the received resource grid). the 1st dimension is the subcarrier, the 2nd dimension is the ofdm symbol, the 3rd dimension is the receive antenna and the 4th dimension is the transmit antenna. in this example one transmit and one receive antenna is used therefore the size of estchannel
is 180-by-140-by-1-by-1.
enb.nsubframe = 0; [estchannel, noiseest] = ltedlchannelestimate(enb,cec,rxgrid);
mmse equalization
the effects of the channel on the received resource grid are equalized using . this function uses the estimate of the channel estchannel
and noise noiseest
to equalize the received resource grid rxgrid
. the function returns eqgrid
which is the equalized grid. the dimensions of the equalized grid are the same as the original transmitted grid (txgrid
) before ofdm modulation.
eqgrid = lteequalizemmse(rxgrid, estchannel, noiseest);
analysis
the received resource grid is compared with the equalized resource grid. the error between the transmitted and equalized grid and transmitted and received grids are calculated. this creates two matrices (the same size as the resource arrays) which contain the error for each symbol. to allow easy inspection the received and equalized grids are plotted on a logarithmic scale using within hdownlinkestimationequalizationresults.m
. these diagrams show that performing channel equalization drastically reduces the error in the received resource grid.
% calculate error between transmitted and equalized grid eqerror = txgrid - eqgrid; rxerror = txgrid - rxgrid; % compute evm across all input values % evm of pre-equalized receive signal evm = comm.evm; evm.averagingdimensions = [1 2]; preequalisedevm = evm(txgrid,rxgrid); fprintf('percentage rms evm of pre-equalized signal: %0.3f%%\n', ... preequalisedevm);
percentage rms evm of pre-equalized signal: 124.133%
% evm of post-equalized receive signal postequalisedevm = evm(txgrid,eqgrid); fprintf('percentage rms evm of post-equalized signal: %0.3f%%\n', ... postequalisedevm);
percentage rms evm of post-equalized signal: 15.598%
% plot the received and equalized resource grids
hdownlinkestimationequalizationresults(rxgrid, eqgrid);
appendix
this example uses the helper function: