“原文 Understanding LTE with MATLAB ,作者Houman Zarrinkoub,本文是對于該書的翻譯,書中的專業(yè)性詞匯給出了英文原文,圖和表的排版都是參考原文,翻譯不準確的地方請讀者多多包涵。
本文僅限于個人學習,研究,交流,不得用于其他商業(yè)用途!”
5.10 資源粒映射
在本節(jié)中,我們將詳細描述將資源網(wǎng)格的組件放置在標準中指定的位置的資源元素映射。映射主要通過創(chuàng)建到資源網(wǎng)格矩陣的索引并在網(wǎng)格中放置各種信息類型來執(zhí)行。圖5.8-5.10中給出的三種不同類型的資源塊的說明有助于可視化這些索引的公式。根據(jù)使用的子幀,我們將BCH、PSS和SSS填充在DC子載波周圍的六個中央資源塊的子幀0或子幀5中。CSR被放置在每個時隙的符號0和5中,具有六個子載波的頻域分離。
下面的MATLAB函數(shù)顯示了資源元素映射。由于MATLAB使用基于1的索引符號,因此我們?yōu)榫仃囍械母鞣N元素生成索引,索引從1開始,而不是0,如標準所指定的。該函數(shù)將用戶數(shù)據(jù)(in)、CSR信號(csr)、子幀索引(nS)和稱為prmLTE的結(jié)構中捕獲的PDSCH的參數(shù)作為輸入。根據(jù)BCH、SSS、PSS和DCI的可用性,該函數(shù)可以承擔額外的輸入。輸出變量y是資源網(wǎng)格矩陣。2D網(wǎng)格矩陣的行數(shù)等于子載波的數(shù)目和列的數(shù)目,總共是14(每個時隙包含7個OFDM符號)。
1function y = REmapper_1Tx(in, csr, nS, prmLTE, varargin)
2%#codegen
3switch nargin
4 case 4, pdcch=[];pss=[];sss=[];bch=[];
5 case 5, pdcch=varargin{1};pss=[];sss=[];bch=[];
6 case 6, pdcch=varargin{1};pss=varargin{2};sss=[];bch=[];
7 case 7, pdcch=varargin{1};pss=varargin{2};sss=varargin{3};bch=[];
8 case 8, pdcch=varargin{1};pss=varargin{2};sss=varargin{3};bch=varargin{4};
9 otherwise
10 error('REMapper has 4 to 8 arguments!');
11end
12% NcellID = 0; % One of possible 504 values
13% numTx = 1; % prmLTE.numTx;
14% Get input params
15Nrb = prmLTE.Nrb; % either of {6, }
16Nrb_sc = prmLTE.Nrb_sc; % 12 for normal mode
17Ndl_symb = prmLTE.Ndl_symb; % 7 for normal mode
18numContSymb = prmLTE.contReg; % either {1, 2, 3}
19% Initialize output buffer
20y = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2));
21%% Specify resource grid location indices for CSR, PDCCH, PDSCH, PBCH, PSS, SSS
22%% 1st: Indices for CSR pilot symbols
23lenOFDM = Nrb*Nrb_sc;
24idx = 1:lenOFDM;
25idx_csr0 = 1:6:lenOFDM; % More general starting point = 1+mod(NcellID, 6);
26idx_csr4 = 4:6:lenOFDM; % More general starting point = 1+mod(3+NcellID, 6);
27idx_csr =[idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM+idx_csr4];
28%% 2nd: Indices for PDCCH control data symbols
29ContREs=numContSymb*lenOFDM;
30idx_dci=1:ContREs;
31idx_pdcch = ExpungeFrom(idx_dci,idx_csr0);
32%% 3rd: Indices for PDSCH and PDSCH data in OFDM symbols whee pilots are present
33idx_data0= ExpungeFrom(idx,idx_csr0);
34idx_data4 = ExpungeFrom(idx,idx_csr4);
35%% Handle 3 types of subframes differently
36switch nS
37 %% 4th: Indices for BCH, PSS, SSS are only found in specific subframes 0 and 5
38 % Thsese symbols share the same 6 center sub-carrier locations (idx_ctr)
39 % and differ in OFDM symbol number.
40 case 0 % Subframe 0
41 % PBCH, PSS, SSS are available + CSR, PDCCH, PDSCH
42 idx_6rbs = (1:72);
43 idx_ctr = 0.5* lenOFDM - 36 + idx_6rbs ;
44 idx_SSS = 5* lenOFDM + idx_ctr;
45 idx_PSS = 6* lenOFDM + idx_ctr;
46 idx_ctr0 = ExpungeFrom(idx_ctr,idx_csr0);
47 idx_bch=[7*lenOFDM + idx_ctr0, 8*lenOFDM + idx_ctr, 9*lenOFDM + idx_ctr, 10*lenOFDM + idx_ctr];
48 idx_data5 = ExpungeFrom(idx,idx_ctr);
49 idx_data7 = ExpungeFrom(idx_data0,idx_ctr);
50 idx_data = [ContREs+1:4*lenOFDM, 4*lenOFDM+idx_data4, ...
51 5*lenOFDM+idx_data5, 6*lenOFDM+idx_data5, 7*lenOFDM+idx_data7, 8*lenOFDM+idx_data5, ...
52 9*lenOFDM+idx_data5, 10*lenOFDM+idx_data5, 11*lenOFDM+idx_data4, ...
53 12*lenOFDM+1:14*lenOFDM];
54 y(idx_csr)=csr(:); % Insert Cell-Specific Reference signal (CSR) = pilots
55 y(idx_data)=in; % Insert Physical Downlink Shared Channel (PDSCH) = user data
56 if ~isempty(pdcch), y(idx_pdcch)=pdcch;end % Insert Physical Downlink Control Channel (PDCCH)
57 if ~isempty(pss), y(idx_PSS)=pss;end % Insert Primary Synchronization Signal (PSS)
58 if ~isempty(sss), y(idx_SSS)=sss;end % Insert Secondary Synchronization Signal (SSS)
59 if ~isempty(bch), y(idx_bch)=bch;end % Insert Broadcast Cahnnel data (BCH)
60
61 case 10 % Subframe 5
62 % PSS, SSS are available + CSR, PDCCH, PDSCH
63 % Primary ans Secondary synchronization signals in OFDM symbols 5 and 6
64 idx_6rbs = (1:72);
65 idx_ctr = 0.5* lenOFDM - 36 + idx_6rbs ;
66 idx_SSS = 5* lenOFDM + idx_ctr;
67 idx_PSS = 6* lenOFDM + idx_ctr;
68 idx_data5 = ExpungeFrom(idx,idx_ctr);
69 idx_data = [ContREs+1:4*lenOFDM, 4*lenOFDM+idx_data4, 5*lenOFDM+idx_data5, 6*lenOFDM+idx_data5, ...
70 7*lenOFDM+idx_data0, 8*lenOFDM+1:11*lenOFDM, 11*lenOFDM+idx_data4, ...
71 12*lenOFDM+1:14*lenOFDM];
72 y(idx_csr)=csr(:); % Insert Cell-Specific Reference signal (CSR) = pilots
73 y(idx_data)=in; % Insert Physical Downlink Shared Channel (PDSCH) = user data
74 if ~isempty(pdcch), y(idx_pdcch)=pdcch;end % Insert Physical Downlink Control Channel (PDCCH)
75 if ~isempty(pss), y(idx_PSS)=pss;end % Insert Primary Synchronization Signal (PSS)
76 if ~isempty(sss), y(idx_SSS)=sss;end % Insert Secondary Synchronization Signal (SSS)
77
78 otherwise % other subframes
79 % Only CSR, PDCCH, PDSCH
80 idx_data = [ContREs+1:4*lenOFDM, 4*lenOFDM+idx_data4, ...
81 5*lenOFDM+1:7*lenOFDM, ...
82 7*lenOFDM+idx_data0, ...
83 8*lenOFDM+1:11*lenOFDM, ...
84 11*lenOFDM+idx_data4, ...
85 12*lenOFDM+1:14*lenOFDM];
86 y(idx_csr)=csr(:); % Insert Cell-Specific Reference signal (CSR) = pilots
87 y(idx_data)=in; % Insert Physical Downlink Shared Channel (PDSCH) = user data
88 if ~isempty(pdcch), y(idx_pdcch)=pdcch;end % Insert Physical Downlink Control Channel (PDCCH)
89end
90end
5.11 OFDM符號生成
OFDM信號生成操作在資源網(wǎng)格上。它逐個接收OFDM符號(資源網(wǎng)格矩陣中的數(shù)據(jù)列),并執(zhí)行IFFT操作,然后進行CP加法以生成OFDM調(diào)制信號。下面的MATLAB函數(shù)顯示如何在IFFT操作之前,將數(shù)據(jù)打包到FFT緩沖區(qū)中并重新排序以排除DC子載波。在IFFT操作之后,我們調(diào)整輸出。CP加法將IFFT輸出的最后N個樣本加到緩沖區(qū)的開頭。第一OFDM符號中的N值與所有其他OFDM符號中的N值不同。函數(shù)的輸入是資源網(wǎng)格(in)和包含PDSCH(prmLTE)參數(shù)的結(jié)構。CP在插槽中的符號之間具有不同的長度。每個時隙(cpLen0)的第一OFDM符號中的CP的長度略大于時隙(cpLenR)的其余六個符號中的CP值。在for循環(huán)中,當輸出信號序列化并將每個OFDM調(diào)制信號的長度附加到每個子幀的輸出向量時,計算輸出信號時考慮這種差異[3]。
函數(shù)的輸出是2D矩陣:第一維的大小是每個子幀的輸出,第二維是天線端口的數(shù)量。在本章中,我們主要討論接觸式天線,其輸出為二維等于一的列向量。在下一章介紹MIMO技術時,我們不必修改這個函數(shù),因為它同樣適用于單信道和多信道OFDM信號生成情況。
1function y = OFDMTx(in, prmLTE)
2%#codegen
3persistent hIFFT;
4if isempty(hIFFT)
5 hIFFT = dsp.IFFT;
6end
7[len, numSymb, numLayers] = size(in);
8% N assumes 15KHz subcarrier spacing
9N = prmLTE.N;
10cpLen0 = prmLTE.cpLen0;
11cpLenR = prmLTE.cpLenR;
12slotLen = (N*7 + cpLen0 + cpLenR*6);
13subframeLen = slotLen*2;
14tmp = complex(zeros(N, numSymb, numLayers));
15% Pack data, add DC, and reorder
16tmp(N/2-len/2+1:N/2, :, :) = in(1:len/2, :, :);
17tmp(N/2+2:N/2+1+len/2, :, :) = in(len/2+1:len, :, :);
18tmp = [tmp(N/2+1:N, :, :); tmp(1:N/2, :, :)];
19% IFFT processing
20x = step(hIFFT, tmp);
21x = x.*(N/sqrt(len));
22% Add cyclic prefix per OFDM symbol per antenna port
23% and serialize over the subframe (equal to 2 slots)
24% For a subframe of data
25y = complex(zeros(subframeLen, numLayers));
26for j = 1:2 % Over the two slots
27 % First OFDM symbol
28 y((j-1)*slotLen+(1:cpLen0), :) = x((N-cpLen0+1):N, (j-1)*7+1, :);
29 y((j-1)*slotLen+cpLen0+(1:N), :) = x(1:N, (j-1)*7+1, :);
30
31 % Next 6 OFDM symbols
32 for k = 1:6
33 y((j-1)*slotLen+cpLen0+k*N+(k-1)*cpLenR+(1:cpLenR), :) = x(N-cpLenR+1:N, (j-1)*7+k+1, :);
34 y((j-1)*slotLen+cpLen0+k*N+k*cpLenR+(1:N), :) = x(1:N, (j-1)*7+k+1, :);
35 end
36end
37
未完待續(xù)
2018/12/18