帮忙翻译一下matlab的cdma通信系统仿真函数

帮忙翻译一下matlab的cdma通信系统仿真函数,第1张

函数[误码率,ErrorRun] = cdmasim(氮,科幻,EbNo,NumInterferers,...

MPathDelay,Kfactor)

兰特('国家',总和(100 * 24小时))randn('国家',总和(100 * 24小时))

%定义变量及其关系

NIterate = 1e3

NumberOfIterations =塞尔(不适用/ NIterate)

ErrorState = 0ErrorRun = []RunCount = 1

Kfactor = 10 ^(Kfactor/10)

EbNolinear ^ = 10(EbNo/10)

MPathComponents =长度(MPathDelay)

MPathAmp(2:MPathComponents)=兰特(MPathComponents - 1,1)

ScatPower = MPathAmp * MPathAmp。'

MPathAmp(1)=的sqrt(ScatPower * Kfactor)

[费MaxComponent] =最大值稿亩(MPathAmp)MPathAmp = MPathAmp /费

FilterOrder = 4波纹= 0.5体重= 0.01

并[b,1] = cheby1(FilterOrder,波纹,体重)

错误验证

如果NumInterferers>(港协- 1)

错误(['错误:干扰器数量过多',int2str(港协- 1 ),'.'])

结束

如果长度(MPathDelay)〜=长度(MPathAmp)

错误乱纯('错误:长度不等。')

结束

如果分(MPathDelay)<0

错误('错误:MPathDelay必须为非负整数。')

结束

费=差异(MPathDelay)

如果分(收费)<= 0

错误('错误:MPathDelay必须单调递增。')

结束

清除费

DesiredSequence = MSequence(港协+1)

偏移=固定(长(DesiredSequence)/(NumInterferers +1))

M二长度(DesiredSequence)

当k = 1:NumInterferers

InterfererSequence(十一,:)=[ DesiredSequence(间(的K - 1)*失调:男)...

DesiredSequence(1:的M - 1 -(k - 1个)*抵消)]

结束

采埃孚= 0(FilterOrder,MPathComponents)

对碳纳米管= 1:NumberOfIterations

DesiredSymbols =符号(兰特(1,NIterate)-0.5)

InterferingSymbols =符号(兰特(NumInterferers,NIterate)-0.5)

DesiredChips =重塑(DesiredSequence.'* DesiredSymbols,1,...

M *族NIterate)

当k = 1:哗敬咐NumInterferers

InterferingChips(钾,:)=重塑(InterfererSequence(十一,:).'*...

InterferingSymbols(钾,:),1,男* NIterate)

结束

NoiseAmplitude =的sqrt(科幻/(2 * EbNolinear))

MaxDelay =最大值(MPathDelay)

DesiredNoise = NoiseAmplitude * randn(1,男* NIterate + MaxDelay)

MPathLinAmp = MPathAmp

MPathComponents =长度(MPathDelay)

DesiredMPathSignal = 0(1,男* NIterate + MaxDelay)

如果NumInterferers>0,

InterferingMPathSignal =...

零(NumInterferers,男* NIterate + MaxDelay)

当k = 1:MPathComponents

指数= 1 + MPathDelay(十一):NIterate * M +的MPathDelay(k)段

InterferingMPathSignal(:,指数)+...

MPathLinAmp(十一)* InterferingChips

结束

结束

当k = 1:MPathComponents

如果k == 1,衰落的=(1,男* NIterate)

其他

衰落= randn(大小(DesiredSymbols ))+...

j * randn(大小(DesiredSymbols))

[褪色采埃孚(:,k)的] =过滤器(二,一,衰落,采埃孚(:,k)段)

= interp的衰落(褪色,科幻)

褪色=绝对值(褪色/的sqrt(平均(fading. *连词(褪色))))

结束

hrollfcoef这个函数不是matlab自带的

function [xh] = hrollfcoef(irfn,ipoint,sr,alfs,ncc)

%****************** variables *************************

% irfn : Number of symbols to use filtering

% ipoint : Number of samples in one symbol

% sr : symbol rate

% alfs : rolloff coeficiense

% ncc: 1 -- transmitting filter 0 -- receiving filter

% *****************************************************

xi=zeros(1,irfn*ipoint+1)

xq=zeros(1,irfn*ipoint+1)

point = ipoint

tr = sr

tstp = 1.0 ./ tr ./ ipoint

n = ipoint .* irfn

mid = ( n ./ 2 ) + 1

sub1 = 4.0 .* alfs .* tr % 4*alpha*R_s

for i = 1 : n

icon = i - mid

ym = icon

if icon == 0.0

xt = (1.0-alfs+4.0.*alfs./pi).* tr % h(0)

else

sub2 =16.0.*alfs.*alfs.*ym.*ym./ipoint./ipoint

if sub2 ~= 1.0

x1=sin(pi*(1.0-alfs)/ipoint*ym)./pi./(1.0-sub2)./ym./tstp

x2=cos(pi*(1.0+alfs)/清绝ipoint*ym)./pi.*sub1./(1.0-sub2)

xt = x1 + x2 % h(t) plot((1:length(xh)),xh)

else % (4alphaRst)^2 = 1plot((1:length(xh)),xh)

xt = alfs.*tr.*((1.0-2.0/pi).*cos(pi/4.0/答宏姿alfs)+(1.0+2.0./pi).*sin(pi/4.0/alfs))./sqrt(2.0)

end % if sub2 ~= 1.0

end % if icon == 0.0

if ncc == 0 % in the case of receiver

xh( i ) = xt ./ ipoint ./ tr% normalization

elseif ncc == 1 % in the case of transmitter

xh( i ) = xt ./ tr % normalization

else

error('ncc error')

end% if ncc == 0

end % for i = 1 : n

%******************** end of file ***************************

网上找的,你看看能不能拼绝清到你那个程序里去

MU应该是指mobile unit吧,其实v就接收机相对发射点的移动速度。而最后一幅图像是画出中断概率理论与仿真(御闭燃simulation)曲线,中断概率的意义可镇虚以这样理解,信态神号电平低于要求的门限值,或者CDMA系统中的SINR低于要求的门限,在该门限之下,信号不能正常解码,相当于通信中断。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12309071.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-24
下一篇 2023-05-24

发表评论

登录后才能评论

评论列表(0条)

保存