matlab简单的瑞利衰落AWGN信道仿真,求人帮忙看下哪里写错了,仿真误码率很高 15
chipLength=1000;Snr=-6:1:6;errornum(1:length(Snr))=0;foriSnr=1:length(Snr)signal=rand...
chipLength = 1000;
Snr = -6:1:6;
errornum(1:length(Snr)) = 0;
for iSnr = 1:length(Snr)
signal = randi([0 1],1,chipLength);
rayl = 1/sqrt(1000)*(randn(1,chipLength) + j*randn(1,chipLength)); %生成瑞利信道
psksignal = pskmod(signal,2); %BPSK调制
rxsignal = awgn(psksignal.*rayl,Snr(iSnr)); %通过信道
depsksignal = pskdemod(rxsignal,2); %BPSK解调
errornum(iSnr) = errornum(iSnr) + sum(abs(depsksignal-signal));
ber(iSnr) = errornum(iSnr)/100;
end;
semilogy(Snr,ber) 展开
Snr = -6:1:6;
errornum(1:length(Snr)) = 0;
for iSnr = 1:length(Snr)
signal = randi([0 1],1,chipLength);
rayl = 1/sqrt(1000)*(randn(1,chipLength) + j*randn(1,chipLength)); %生成瑞利信道
psksignal = pskmod(signal,2); %BPSK调制
rxsignal = awgn(psksignal.*rayl,Snr(iSnr)); %通过信道
depsksignal = pskdemod(rxsignal,2); %BPSK解调
errornum(iSnr) = errornum(iSnr) + sum(abs(depsksignal-signal));
ber(iSnr) = errornum(iSnr)/100;
end;
semilogy(Snr,ber) 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询