




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、任意發(fā)送天線,任意接收天線的stbc-mimo-ofdm的matlab程序(matlab program of arbitrary transmit antenna and arbitrary receiving antenna stbc-mimo-ofdm)clear all;i = sqrt (- 1);ifft _ bin _ length = 512% 傅立葉變換抽樣點(diǎn)數(shù)目;carrier _ count = 100% 子載波數(shù)目;_ symbols per _ carrier = 66% 符號(hào)數(shù) / 載波;_ cp length = 10;% 循環(huán)前綴長(zhǎng)度_ addprefix le
2、ngth = ifft _ bin _ length + cp _ length;_ psk m = 4;_ _ bits per symbol = log2 (m _ psk / 符號(hào) 位數(shù)%);% 1 - 2 = 2; 1 + j + j;% alamouti scheme x1 x2 - x1; x2 * * 二天線發(fā)送矩陣or - 1 - 2 = j 1 + 2 + 3; 3 + j j 0; 0 + 1 0 - 3 j; j + j + 2% ; for x1 - x2 - x1 x2 x3; * * * * x3 x1 0; 0; 0 - x3 x2 三天線發(fā)送矩陣 * *co _
3、 time = size (o (1);nt = size (or, 2);% 發(fā)射天線數(shù)目nr = 2% 接收天線數(shù)目;num _ x = 1;for cc _ ro = 1: co _ timefor cc _ co = 1: ntnum _ x = max (abs (_ x num, real (or (cc _ ro, cc _ co);endendco _ x = zeros (_ x num, 1);for _ ro = 1: co _ time% 計(jì)算delta, epsilon eta and conj matricesfor _ co = 1: nt% 用于確定矩陣 or
4、中元素的位置, 符號(hào)以及共軛情況if abs (real or _ ro, with _ co) = 0delta (with _ ro, abs (real or _ ro, with _ co sign (=) (real or _ ro, with _ co);epsilon (_ ro, abs (real or _ ro, with _ co) = _ co;co _ (abs (x (real or _ ro, with _ co), x (1) = abs (co _ real (or (_ ro, with _ co) + 1), 1);eta (abs (real or _
5、ro, with _ co), co _ (abs) x (real or _ ro, with _ co), 1) = _ ro;the _ mt (with _ ro, abs (real or _ ro, with _ co) (or = imag (_ ro, with _ co);endendendeta = eta. ;eta = sort (eta);eta = eta. ;carriers = (1: carrier _ count (floor) + (ifft _ bin _ length / 4) - floor (carrier _ count / 2);% 坐標(biāo): (
6、1 to 100) + 14 = (15: 114)conjugate _ carriers = length ifft _ bin _ carriers + 2; 256 (15% 坐標(biāo): 114) + 1 = 257 - (15: 114) = (242: 143)tx_training_symbols = training_symbol(新臺(tái)幣,carrier_count);baseband_out_length = carrier_count * symbols_per_carrier;snr_min = 3;%最小信噪比snr_max = 15;%最大信噪比graph_inf_bit
7、 =零(snr_max-snr_min + 1,2,nr);%繪圖信息存儲(chǔ)矩陣graph_inf_sym =零(snr_max-snr_min + 1,2,nr);對(duì)于信噪比為snr_min:snr_max %開始仿真中圖分類號(hào)disp(等待直到snr = );disp(snr_max);信噪比n_err_sym =零(1,nr);n_err_bit =零(1,nr);perr_sym =零(1,nr);perr_bit =零(1,nr);re_met_sym_buf =零(carrier_count,symbols_per_carrier,nr);re_met_bit =零(baseband
8、_out_length,bits_per_symbol,nr);baseband_out =圓(rand(baseband_out_length,bits_per_symbol);%生成隨機(jī)數(shù)用于仿真de_data =轉(zhuǎn)化(baseband_out);%二進(jìn)制向十進(jìn)制轉(zhuǎn)換data_buf = pskmod(de_data,m_psk,0);% psk調(diào)制carrier_matrix =重塑(data_buf,carrier_count,symbols_per_carrier);tt = 1:nt:symbols_per_carrier %取數(shù)為空時(shí)編碼做準(zhǔn)備,此處每次取每個(gè)子載波上連續(xù)的兩個(gè)數(shù)
9、數(shù)據(jù) ;對(duì)于ii = 1:nttx_buf_buf = carrier_matrix(:,tt + ii-1);數(shù)據(jù)= 數(shù)據(jù);tx_buf_buf ;結(jié)束xx =零(co_time * carrier_count,nt);對(duì)于con_r = 1:co_time %進(jìn)行空時(shí)編碼對(duì)于con_c = 1:nt如果abs(房(o(con_r,con_c) = 0如果圖像(o(con_r,con_c)= = 0xx(con_r-1)* carrier_count + 1:con_r * carrier_count,con_c)=數(shù)據(jù)(abs(房(o(con_r,con_c)- 1)* carrier_c
10、ount + 1:abs(房(o(con_r,con_c)* carrier_count,1)*號(hào)(房(o(con_r,con_c);其他的xx(con_r-1)* carrier_count + 1:con_r * carrier_count,con_c)=連詞(數(shù)據(jù)(abs(房(o(con_r,con_c)- 1)* carrier_count + 1:abs(房(o(con_r,con_c)* carrier_count,1)*號(hào)(房(o(con_r,con_c);結(jié)束結(jié)束結(jié)束空時(shí)編碼結(jié)束結(jié)束%xx = tx_training_symbols;xx ;%添加訓(xùn)練序列rx_buf =零(1
11、,addprefix_length *(co_time + 1),nr);對(duì)于轉(zhuǎn)速= 1:nr對(duì)于ii = 1:nttx_buf =重塑(xx(:,ii),carrier_count,co_time + 1);ifft_tx_buf =零(ifft_bin_length,co_time + 1);ifft_tx_buf(載體,:)= tx_buf(1:carrier_count,:);ifft_tx_buf(conjugate_carriers,:)=連詞(tx_buf(1:carrier_count,:);time_matrix = ifft(ifft_tx_buf);time_matrix
12、 = time_matrix(ifft_bin_length-cp_length + 1):ifft_bin_length,:);time_matrix ;tx = time_matrix(:)”;% -%d = randint(1,4, 1 );% 4多經(jīng)信道模擬% =(1,randint 2,7)/ 10;tx_tmp = tx;a 4,5,6,2;4,5,6,2;4,5,6,2;4,5,6,2 ;a 0.2,0.3,0.4,0.5;0.2,0.3,0.4,0.5;0.2,0.3,0.4,0.5;0.2,0.3,0.4,0.5 ;對(duì)于jj = 1:大?。╠,2)復(fù)制=零(大?。╰x);對(duì)于
13、kk = 1 + d(ii,jj):長(zhǎng)度(德克薩斯州)復(fù)制(kk)= a(ii,jj)* tx(kk - d(ii,jj);結(jié)束tx_tmp = tx_tmp +復(fù)制;結(jié)束% -txch = awgn(tx_tmp,信噪比,測(cè)量不添加高斯白噪聲);%rx_buf(1,:,rev)= rx_buf(1,:,rev)+ txch;結(jié)束rx_spectrum =重塑(rx_buf(1,:,rev),addprefix_length,co_time + 1);rx_spectrum = rx_spectrum(cp_length + 1:addprefix_length,:);fft_tx_buf =
14、零(ifft_bin_length,co_time + 1);fft_tx_buf = fft(rx_spectrum);spectrum_matrix = fft_tx_buf(載體,:);y_buf =(spectrum_matrix(:,2:co_time + 1);y_buf =連詞(y_buf”);spectrum_matrix1 = spectrum_matrix(:,1);周= exp(2/ carrier_count)*我);l10;p = 0(l * nt,1);對(duì)于jj = 1:ntl = 0:l-1kk = 0:carrier_count-1p(l +(jj-1)l +
15、1)= p(l +(jj-1)l + 1)+ spectrum_matrix1(kk + 1)*連詞(tx_training_symbols(kk + 1,jj)*周(-(kk * l);結(jié)束結(jié)束結(jié)束% =零(l *,新);% for ii = 1: nt% jj = 1: nt% of l1 = 0: l - 1% of l2 = 0: l - 1% of kk = 0: carrier _ count - 1% q (l2 + (ii, 1) * l + 1, l1 + (jj - 1) * l + 1) = q (l2 + (ii, 1) * l + 1, l1 + (jj - 1) *
16、 l + 1) + tx _ training _ symbols (kk + 1 (ii) * conj (tx _ training _ symbols (tn + 1, jj) * wk (- (kk * (l1 + l2);% than% than% than% than% than% h = inv (q) * p;h = p / carrier _ count;h _ buf = zeros (carrier _ count, nt);ii = 1: ntct = 0: carrier _ count - 1for l = 0: l - 1h _ buf (tn + 1, (ii)
17、 = h _ buf (tn + 1, (ii) + h (l + (ii, 1) * l + 1,1) * wk (kk * l);thanthanthanh _ buf = conj (h _ buf );rac = ;ct = 1: carrier _ county = y _ buf (kk);h = h _ buf (kk);for co _ ii = 1: num _ xfor co _ tt = 1: size (eta 2)if eta (co _ ii, co _ tt = 0)if confirmed _ mt (eta (co _ ii, co _ tt), co _ i
18、i) = = 0r _ (eta (co _ ii, co _ tt): co _ ii) = y (eta (co _ ii, co _ tt):);a _ (eta (co _ ii, co _ tt): co _ ii) = conj (h (epsilon (eta (co _ ii, co _ tt), co _ ii):);elser _ (eta (co _ ii, co _ tt): co _ ii) = conj (y (eta (co _ ii, co _ tt):);a _ (eta (co _ ii, co _ tt): co _ ii) = h (epsilon (e
19、ta (co _ ii, co _ tt), co _ ii):);thanthanthanthanrr = zeroes (num _ x 1);for iii = 1: num _ x% generate decision statistics of the transmitted signal xifor iii = 1: size (eta 2)if eta (iii, iii) = 0rr (iii, 1) = rr (iii, 1) + r _ (eta (iii, iii) 1, (iii) * (a _ (eta (iii, iii) 1, (iii) * delta (eta
20、 (iii, iii) (iii);thanthanthanrac = rrr; conj (rr);thanr _ symbols = pskdemod (rrr, m _ bank, 0);re _ met _ symbols _ buf (: tt: tt + nt 1 rev) = r _ symbols;thanthanre _ met _ symbols = zeroes (baseband _ out _ length, 1 point);for rev = 1: nore _ met _ symbols _ buf _ buf = u.a. _ met _ symbols _
21、buf (:,:, rev);re _ met _ symbols (:, 1 rev) = re _ met _ symbols _ buf _ buf (:);re _ met _ bits (:,:, rev) = de2bi (re _ met _ symbols (:, 1 rev);for con _ dec _ ro = 1: baseband _ out _ lengthif re _ met _ symbols (con _ dec _ ro, 1 rev) = the _ data (con _ dec _ ro, 1)n _ err _ symbols (1, rev)
22、= n _ err _ symbols (1w + 1);for a _ dec _ co = 1 bit per symbol _ _if a bit is _ _ (_ dec _ ro, _ dec _ co., rev = baseband _ out (_ dec _ ro, _ dec _ co.)i n _ _ bit (1 rev) = n _ in _ bit (1) + 1).endendendendgraph _ inf _ sym (snr snr _ min + 1.1, p = snr.graph _ inf _ bit snr snr _ min + 1.1, p
23、 = snr.perr _ sym (1) = n _ in _ sym (1) / (baseband _ out _ length);% count number of error bits and symbolsgraph _ inf _ sym (snr snr _ min 1.2 rev = sym (perr _, rev.);perr _ bit (1, p) = n _ in _ bit (1) / (baseband _ out _ length * bits per symbol _ _).graph _ inf _ bit snr snr _ min 1.2 rev) p
24、err _ bit (1, 1).endendfor w = 1: 1x x x x x x x _ sym = sym (figure _ inf _: 1, rev.% this plotthere _ sym = graph _ inf _ sym (:, 2 rev.);subplot (nr) 1 rev).semilogy (x _ _ sym sym, k - 1).axis (2, 16 0.0001).xlabel (snr) db.ylabel (symbol error probability.grid onper cent hold onendper cent hold off% for rev = 1: 1x _ bit = graph _ inf _ bit: 1, rev.);% _ bit = graph _ inf _ bit (:, 2 rev.);% subplot (2,1,2).% semilogy (x _ _ bit, bit, k - 1).axis (16) 0.0001 1).) xlabel (snr) db.% ylabel (bit error probability).grid
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度二零二五年度礦山安全生產(chǎn)現(xiàn)場(chǎng)監(jiān)督合同
- 洗衣店裝修保修協(xié)議樣本
- 家庭贍養(yǎng)責(zé)任合同書
- 建筑施工安全監(jiān)理合同范本
- 2024深圳市第二職業(yè)技術(shù)學(xué)校工作人員招聘考試及答案
- 房產(chǎn)租賃委托合同協(xié)議
- 跨行業(yè)資源整合合作協(xié)議書
- 賠償合同標(biāo)準(zhǔn)文本:權(quán)威指南與示例
- 計(jì)算機(jī)一級(jí)模考試題與參考答案
- 民事離婚無債權(quán)債務(wù)正式合同
- 米什金貨幣金融學(xué)英文版習(xí)題答案chapter1英文習(xí)題
- 紅色資本家榮毅仁課件
- 酒店貸款報(bào)告
- 會(huì)計(jì)職業(yè)道德對(duì)職業(yè)發(fā)展的影響研究
- 體育賽事推廣方案
- 子宮肌瘤健康教育指導(dǎo)
- 手術(shù)室專案改善活動(dòng)護(hù)理課件
- 公交駕駛員心理健康輔導(dǎo)培訓(xùn)
- 樁基施工安全培訓(xùn)課件
- 設(shè)立文化傳播服務(wù)公司組建方案
- 管線補(bǔ)焊施工方案
評(píng)論
0/150
提交評(píng)論