任意发送天线,任意接收天线的stbc-mimo-ofdm的matlab程序(Matlab program of arbitrary transmit antenna and arbitrary receiving antenna stbc-mimo-ofdm)_第1页
任意发送天线,任意接收天线的stbc-mimo-ofdm的matlab程序(Matlab program of arbitrary transmit antenna and arbitrary receiving antenna stbc-mimo-ofdm)_第2页
任意发送天线,任意接收天线的stbc-mimo-ofdm的matlab程序(Matlab program of arbitrary transmit antenna and arbitrary receiving antenna stbc-mimo-ofdm)_第3页
任意发送天线,任意接收天线的stbc-mimo-ofdm的matlab程序(Matlab program of arbitrary transmit antenna and arbitrary receiving antenna stbc-mimo-ofdm)_第4页
任意发送天线,任意接收天线的stbc-mimo-ofdm的matlab程序(Matlab program of arbitrary transmit antenna and arbitrary receiving antenna stbc-mimo-ofdm)_第5页
已阅读5页,还剩13页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、任意发送天线,任意接收天线的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% 傅立叶变换抽样点数目;carrier _ count = 100% 子载波数目;_ symbols per _ carrier = 66% 符号数 / 载波;_ cp length = 10;% 循环前缀长度_ addprefix le

2、ngth = ifft _ bin _ length + cp _ length;_ psk m = 4;_ _ bits per symbol = log2 (m _ psk / 符号 位数%);% 1 - 2 = 2; 1 + j + j;% alamouti scheme x1 x2 - x1; x2 * * 二天线发送矩阵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 三天线发送矩阵 * *co _

3、 time = size (o (1);nt = size (or, 2);% 发射天线数目nr = 2% 接收天线数目;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% 计算delta, epsilon eta and conj matricesfor _ co = 1: nt% 用于确定矩阵 or

4、中元素的位置, 符号以及共轭情况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);% 坐标: (

6、1 to 100) + 14 = (15: 114)conjugate _ carriers = length ifft _ bin _ carriers + 2; 256 (15% 坐标: 114) + 1 = 257 - (15: 114) = (242: 143)tx_training_symbols = training_symbol(新台币,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);%绘图信息存储矩阵graph_inf_sym =零(snr_max-snr_min + 1,2,nr);对于信噪比为snr_min:snr_max %开始仿真中图分类号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);%生成随机数用于仿真de_data =转化(baseband_out);%二进制向十进制转换data_buf = pskmod(de_data,m_psk,0);% psk调制carrier_matrix =重塑(data_buf,carrier_count,symbols_per_carrier);tt = 1:nt:symbols_per_carrier %取数为空时编码做准备,此处每次取每个子载波上连续的两个数

9、数据 ;对于ii = 1:nttx_buf_buf = carrier_matrix(:,tt + ii-1);数据= 数据;tx_buf_buf ;结束xx =零(co_time * carrier_count,nt);对于con_r = 1:co_time %进行空时编码对于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)=数据(abs(房(o(con_r,con_c)- 1)* carrier_c

10、ount + 1:abs(房(o(con_r,con_c)* carrier_count,1)*号(房(o(con_r,con_c);其他的xx(con_r-1)* carrier_count + 1:con_r * carrier_count,con_c)=连词(数据(abs(房(o(con_r,con_c)- 1)* carrier_count + 1:abs(房(o(con_r,con_c)* carrier_count,1)*号(房(o(con_r,con_c);结束结束结束空时编码结束结束%xx = tx_training_symbols;xx ;%添加训练序列rx_buf =零(1

11、,addprefix_length *(co_time + 1),nr);对于转速= 1:nr对于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多经信道模拟% =(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 ;对于jj = 1:大小(d,2)复制=零(大小(tx);对于

13、kk = 1 + d(ii,jj):长度(德克萨斯州)复制(kk)= a(ii,jj)* tx(kk - d(ii,jj);结束tx_tmp = tx_tmp +复制;结束% -txch = awgn(tx_tmp,信噪比,测量不添加高斯白噪声);%rx_buf(1,:,rev)= rx_buf(1,:,rev)+ txch;结束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);对于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);结束结束结束% =零(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等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论