ImageVerifierCode 换一换
格式:DOC , 页数:8 ,大小:53KB ,
资源ID:4591102      下载积分:5 金币
快捷注册下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

开通VIP
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.zixin.com.cn/docdown/4591102.html】到电脑端继续下载(重复下载【60天内】不扣币)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

开通VIP折扣优惠下载文档

            查看会员权益                  [ 下载后找不到文档?]

填表反馈(24小时):  下载求助     关注领币    退款申请

开具发票请登录PC端进行申请

   平台协调中心        【在线客服】        免费申请共赢上传

权利声明

1、咨信平台为文档C2C交易模式,即用户上传的文档直接被用户下载,收益归上传人(含作者)所有;本站仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。所展示的作品文档包括内容和图片全部来源于网络用户和作者上传投稿,我们不确定上传用户享有完全著作权,根据《信息网络传播权保护条例》,如果侵犯了您的版权、权益或隐私,请联系我们,核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
2、文档的总页数、文档格式和文档大小以系统显示为准(内容中显示的页数不一定正确),网站客服只以系统显示的页数、文件格式、文档大小作为仲裁依据,个别因单元格分列造成显示页码不一将协商解决,平台无法对文档的真实性、完整性、权威性、准确性、专业性及其观点立场做任何保证或承诺,下载前须认真查看,确认无误后再购买,务必慎重购买;若有违法违纪将进行移交司法处理,若涉侵权平台将进行基本处罚并下架。
3、本站所有内容均由用户上传,付费前请自行鉴别,如您付费,意味着您已接受本站规则且自行承担风险,本站不进行额外附加服务,虚拟产品一经售出概不退款(未进行购买下载可退充值款),文档一经付费(服务费)、不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
4、如你看到网页展示的文档有www.zixin.com.cn水印,是因预览和防盗链等技术需要对页面进行转换压缩成图而已,我们并不对上传的文档进行任何编辑或修改,文档下载后都不会有水印标识(原文档上传前个别存留的除外),下载后原文更清晰;试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓;PPT和DOC文档可被视为“模板”,允许上传人保留章节、目录结构的情况下删减部份的内容;PDF文档不管是原文档转换或图片扫描而得,本站不作要求视为允许,下载前可先查看【教您几个在下载文档中可以更好的避免被坑】。
5、本文档所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用;网站提供的党政主题相关内容(国旗、国徽、党徽--等)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
6、文档遇到问题,请及时联系平台进行协调解决,联系【微信客服】、【QQ客服】,若有其他问题请点击或扫码反馈【服务填表】;文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“【版权申诉】”,意见反馈和侵权处理邮箱:1219186828@qq.com;也可以拔打客服电话:0574-28810668;投诉电话:18658249818。

注意事项

本文(OFDM-MATLAB仿真程序.doc)为本站上传会员【二***】主动上传,咨信网仅是提供信息存储空间和展示预览,仅对用户上传内容的表现方式做保护处理,对上载内容不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知咨信网(发送邮件至1219186828@qq.com、拔打电话4009-655-100或【 微信客服】、【 QQ客服】),核实后会尽快下架及时删除,并可随时和客服了解处理情况,尊重保护知识产权我们共同努力。
温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载【60天内】不扣币。 服务填表

OFDM-MATLAB仿真程序.doc

1、word完整版)OFDM MATLAB仿真程序 OFDM。m: OFDM Simulator (outer function) clear all; A = [1 1/exp(1) 1/exp(2)]; % power delay profile N = 64; % number of symbols in a single OFDM symbol GI = 16; % guard interval Mt = 1; % number of Tx antennas Mr = 1; % number of Rx antennas sig2 = 1e—3; % n

2、oise variance M = 8; % max constellation bit number Mgap = 10.^(1:(1.7/10):2。7); % gap Btot = 100*Mt; % total # bits per OFDM symbol TransmitIter = 50; % # iterations of symbol transmissions for each channel instance ChannelIter = 100; % # iterations of independent identically distributed ch

3、annel instances GapIter = length(Mgap); load ENC2.mat load ENC4.mat load ENC16.mat load ENC64.mat load ENC256.mat TotEbNo = []; Errors =[]; EbNo = []; for lGap = 1:GapIter lGap gap = Mgap(lGap); totalErrors = 0; for lChan = 1:ChannelIter % create channel [H h_f]=create_ch

4、annel(Mt, Mr, A, N+GI); % decompose each subchannel in the frequency domain [U S V] = svd_decompose_channel(Mt, Mr, h_f, N); % bitloading [bits_alloc,energy_alloc] = BitLoad(S,Btot,Mt*N,gap,sig2,M); %energy_alloc=energy_alloc/(mean(energy_alloc)); %energy_alloc=ones(1,128); for lTran

5、s = 1:TransmitIter % bits to transmit x = (randn(1,Btot)>0); % modulate x_mod = modulate(x,bits_alloc,energy_alloc, s2,s4,s16,s64,s256); % precode modulated signal x_pre = precode(Mt, x_mod, V, N); % ifft, with cyclic prefix for each antenna ofdm_symbol =[]; for i=1:Mt ofdm

6、symbol = [ofdm_symbol; ifft_cp_tx_blk(x_pre(i:Mt:Mt*(N-1)+i),N,GI)]; end ofdm_symbol2 = reshape(ofdm_symbol,Mt*(N+GI),1); % channel y = transpose(channel(sig2, Mt, Mr, ofdm_symbol2, H, N+GI)); % fft rec_symbol =[]; for i=1:Mt rec_symbol = [rec_symbol; fft_cp_rx_blk(y(i:Mt:Mt*(N+GI

7、—1)+i),N,GI)]; end rec_symbol2 = reshape(rec_symbol,1,Mt*N); % shape received signal shaped_vals = shape(rec_symbol2, Mr, U, N); % demodulate y_demod = demodulate(shaped_vals, bits_alloc, energy_alloc, S, s2,s4,s16,s64,s256, c2,c4,c16,c64,c256); % comparison totalErrors = totalEr

8、rors + sum(xor(y_demod,x)); end EbNo = [EbNo sum(energy_alloc)/Btot/sig2]; end Errors = [Errors totalErrors/Btot/ChannelIter/TransmitIter] TotEbNo = [TotEbNo mean(EbNo)] EbNo = []; end semilogx(TotEbNo, Errors); xlabel(’Eb/No'); ylabel('BER’); title(’SISO link, adaptive rate and pow

9、er') save SISO_adaptive2。mat Errors EbNo create_channel。m: Generates a Rayleigh fading frequency—selective channel, parametrized by the antenna configuration, the OFDM configuration, and the power-delay profile. function [H, H_f]=create_channel(Mt, Mr, A, N); % function [H, H_f]=create_ch

10、annel(Mt, Mr, A, N); % % A - vector containing the power-delay profile (real values) % Mt - number of Tx antennas % Mr — number of Rx antennas % N - number of vector symbols to be sent in a single OFDM symbol Tx % ie: N MIMO transmissions in one OFDM symbol % This is for Rayl

11、eigh frequency—selective fading, which assumes complex % Gaussian matrix elements with in-phase and quadrature components independent。 % Assume iid matrix channel elements, and further, independent channel taps % define the channel taps H_int = 1/sqrt(2)*(randn(Mr*length(A),Mt) + j*randn(Mr*l

12、ength(A),Mt)); H_int2=[]; for i = 1:length(A) H_int2 = [H_int2;sqrt(A(i))*H_int((i-1)*Mr+1:i*Mr,:)]; end %h_f = fft(H_int2',64); %%H = H_int2'; H_int2 = [H_int2;zeros((N-length(A))*Mr,Mt)]; H_f = zeros(Mr,Mt*(N—16)); for i = 1:Mt for j = 1:Mr h_f = fft(H_int

13、2(j:Mr:(N—16—1)*Mr+j,i)); for k = 1:(N—16) H_f(j,i+(k—1)*Mt) = h_f(k); end end end H=[H_int2]; for i = 1:N—1 H=[H,[zeros(Mr*i,Mt);H_int2(1:(N-i)*Mr,:)]]; end svd_decompose_channel。m: Since full channel knowledge is assumed, transmission is across para

14、llel singular value modes。 This function decomposes the channel into these modes. function [U, S, V] = svd_decompose_channel(Mt, Mr, h_f, N); % [U S V] = svd_decompose_channel(Mt, Mr, h_f, N); % % Function decomposes the channel at each subcarrier into its SVD components % % Mt — # Tx ante

15、nnas % Mr - # Rx antennas % h_f — MIMO impulse response - Mr rows, Mt*L columns, where L is the number of % channel taps % N — # subcarriers U = []; S = []; V = []; for i = 1:N [Utmp Stmp Vtmp] = svd(h_f(:,(i—1)*Mt+1:i*Mt)); U=[U Utmp]; V=[V Vtmp]; S=[S S

16、tmp]; end S = sum(S,1); BitLoad.m: Apply the bit-loading algorithm to achieve the desired bit and energy allocation for the current channel instance. function [bits_alloc,energy_alloc] = BitLoad(subchan_gains,total_bits,num_subc,gap,noise,M) % Bit Loading Algorithm % —-—----————-----—

17、———- % % Inputs : % subchan_gains : SubCarrier Gains % total_bits : Total Number of bits % num_subc : Number of Subcarriers % gap : Gap of the system % noise : Noise Power % M : Max Cons

18、tellation Size % Outputs: % bits_alloc : Bits allocation for each subchannel % power_alloc : Total Power allocation % -----—-—-——————-----—--—-—-——-————---——----—-—---———-————--—--— % Compute SNR's for each channel SNR = ComputeSNR(subchan_gains,noise,gap); %

19、 This function just initializes the system with a particular bit % allocation and energy allocation using Chow's Algorithm。 This is % further efficientize using Campello’s Algorithm [bits_alloc, energy_alloc] = chow_algo(SNR,num_subc,M); % Form the Energy Increment Table based on the pre

20、sent channel % gains for all the subchannels in order to be used by Campello % Algorithm energytable = EnergyTableInit(SNR,M); % Efficientize the algorithm using the Campello's algorithm [bits_alloc,energy_alloc] = campello_algo(bits_alloc,energy_alloc,energytable,total_bits,num_subc,M);

21、 ComputeSNR.m: Given the subcarrier gains, this simple function generates the SNR values of each channel (each singular value on each tone is a separate channel)。 function SNR = ComputeSNR(subcar_gains,noise,gap) SNR = abs((subcar_gains.^2)。/(noise*gap)); chow_algo.m: Apply Chow's alg

22、orithm to generate a particular bit and energy allocation. % Chow's Algorithm % -——--—-—-——-—-—- % This is based on the paper by Chow et al titled % % A Practical Discrete Multitone Transceiver Loading Algorithm % for Data Transmission over Spectrally Shaped Channels。IEEE Trans % on Commun

23、ications. Vol。 43, No 2/3/4, pp。 773—775, Feb/Mar/Apr 1995 function [bits_alloc, energy_alloc] = chow_algo(SNR,num_subc,M) for i = 1:num_subc % Assuming each of the subchannels has a flat fading, we get initial estimate % of the bits for each subchannel tempbits = log2(1 + abs(SN

24、R(i))); % bits per two dimension. roundtempbits = round(tempbits); % round the bits if (roundtempbits 〉 8) % Limit them between 2 and 15 roundtempbits = 8; end if (mod(roundtempbits,2)== 1 & roundtempbits ~= 1) roundtempbi

25、ts = roundtempbits —1; end if roundtempbits 〉 0 % Calculate the Energy required for the subchannel energy_alloc(i) = (2^roundtempbits—1)/SNR(i) ; else energy_alloc(i) = 0; end bits_alloc(i) = roundtempbits; % Update the

26、BitSubChan end % end of function EnergyTableInit。m: Given the SNR values, form a table of energy increments for each channel。 function energytable = EnergyTableInit(SNR,M); % Inputs: % subcar_gains : Subcarrier Gains % M : max Constellation Size % Gap : G

27、ap of the system % Noise : Noise Power % Outputs: % energytable : Energytable % % Based on the Subcarrier Gains, we calculate the energy % increment required by each subcarrier for transmitting % 1,2 ,4 ,6,8 bits。 % Energy = 2^(i-1)/subcar_gains; % —----——-—-——-—-—-——-

28、——-—-———-------—-——--—---—-—-——-—- %subcar_gains = (subcar_gains。^2)/(Gap*Noise); energytable = abs((1./SNR)’*(2.^([1:M+1]-1))); % Increase the energy value for constellation size of more than M to % a very high value so that it is not assigned. energytable(:,M+1) = Inf*ones(size(e

29、nergytable(:,M+1))); for i = 3:2:M energytable(:,i) = (energytable(:,i) +energytable(:,i+1))/2; energytable(:,i+1) = energytable(:,i); end %energytable = [ones(1,size(energytable,1))’ energytable]; campello_algo。m: Apply Campello’s algorithm to converge to the optimal bit and ene

30、rgy allocation for the given channel conditions. % campello_algo.m % ---——---—-———- % This function is used by Campello's algorithm to allocate bits and energy for % each subchannel optimally。 function [bits_alloc, energy_alloc] = campello_algo(bits_alloc,energy_alloc,energytable,total_bits

31、num_subc,M) bt = sum(bits_alloc); % We can't transmit more than M*(Number of subchannel) bits if total_bits > M*num_subc total_bits = M*num_subc; end while (bt ~= total_bits) if (bt > total_bits) max_val = 0; max_ind = ceil(rand(1)*num_subc);

32、 for i = 1:num_subc if bits_alloc(i) ~= 0 temp = energytable(i,bits_alloc(i)) ; else temp = 0; end if (temp > max_val) max_val = temp;

33、 max_ind = i; end end if (bits_alloc(max_ind) > 0) bits_alloc(max_ind) = bits_alloc(max_ind) —1; energy_alloc(max_ind) = energy_alloc(max_ind) - max_val; bt = bt-1; end else

34、 min_val = Inf; min_ind = ceil(rand(1)*num_subc); for i = 1:num_subc if bits_alloc(i) ~=0 & bits_alloc(i) 〈9 temp = energytable(i,bits_alloc(i) + 1); else temp = Inf; end if (temp < min_val)

35、 min_val = temp; min_ind = i; end end if (bits_alloc(min_ind) 〈 8) bits_alloc(min_ind) = bits_alloc(min_ind) +1; if (min_val==inf) min_val = energytable(min_ind,bits_alloc(min_ind));

36、 end energy_alloc(min_ind) = energy_alloc(min_ind) +min_val; bt = bt+1; end end end for i = 1:length(bits_alloc) if (mod(bits_alloc(i),2) == 1 & bits_alloc(i) ~=1) [bits_alloc,energy_alloc] = ResolvetheLastB

37、it(bits_alloc,energy_alloc,i,energytable,num_subc); end end ResolvetheLastBit.m: An optimal bit—loading of the last bit requires a unique optimization. function [bits_alloc, energy_alloc] = ResolvetheLastBit(bits_alloc,energy_alloc,index,energytable,num_subc) max_val = 0; for i =

38、1:num_subc if (i ~= index & bits_alloc(i) == 1) if bits_alloc(i) ~= 0 temp = energytable(i,bits_alloc(i)) ; end if (temp > max_val) max_val = temp; max_ind = i; end end end min_val = Inf; for i = 1:num_subc

39、 if (i~= index & bits_alloc(i) == 1) if bits_alloc(i) ~=0 temp = energytable(i,bits_alloc(i) + 1); end if (temp 〈 min_val) min_val = temp; min_ind = i; end end end if (min_val 〈 max_val) bits_alloc(min_ind

40、) = bits_alloc(min_ind) + 1; bits_alloc(index) = bits_alloc(index) - 1; energy_alloc(index) = energy_alloc(index) — min_val; else bits_alloc(max_ind) = bits_alloc(max_ind) - 1; bits_alloc(index) = bits_alloc(index) + 1; energy_alloc(index) = energy_alloc(index) + max_val; end

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服