adaptive_power.m
资源名称:MIMO-OFDM.rar [点击查看]
上传用户:look542
上传日期:2009-06-04
资源大小:784k
文件大小:1k
源码类别:
传真(Fax)编程
开发平台:
Matlab
- function [Cn,P]=adaptive_power(H,Ber0,N,Noise,R)
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % 函数功能:
- % 自适应调制和功率优化分配
- % 基于功率梯度最小的QAM 算法
- % 输入:
- % Noise:噪声功率
- % N:子载波的个数
- % H:通过信道估计得到信道参数向量
- % Ber0: 为系统需要的误码率
- % R:固定比特速率
- % 输出:
- % Cn:分配给各子载波的比特数 Cn={0,2,4,6}
- % P:分配给各子载波的功率
- % 由QAM调制的误比特率公式得:
- % 信噪比 SNR=In(5*Ber0)*(2^Cn-1)/(-1.6)
- % 信噪比因子para
- % 作者:郭莹,2004.3.
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- para=log(5*Ber0)/(-1.6);
- %初始化比特Cn,和功率P
- Cn=zeros(N,1);
- P=zeros(N,1);
- % delta_P用于存储功率增量
- delta_P=zeros(N,1);
- %步长, 因为是使用QAM调制
- Step=2;
- for yy=1:R/Step
- for i=1:N
- if Cn(i)>6
- delta_P(i)=inf;
- continue;
- end
- %y=H(i)^2;
- y = H(i).*conj(H(i));
- delta_P(i)=3*para*(2^(Cn(i)+Step)-2^Cn(i))*Noise/y;
- end
- dex=find(delta_P==min(delta_P));
- Cn(dex) = Cn(dex) + Step;
- P(dex)=P(dex)+delta_P(dex);
- end
- P(find(P==0))=1;