求瑞利信道的MATLAB仿真代码!最好是完整的程序!有的给小弟发一个,小弟在此先谢谢啦!
2个回答
展开全部
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)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询