• 大小: 2KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-06-04
  • 语言: Matlab
  • 标签: 8QAM  QPSK  误码率  

资源简介

8QAM与QPSK的误码率计算,高斯信道,matlab程序可直接替换参数 1.A8QAM.m 2.demodu_8QAM_mat.m 3.QPSK

资源截图

代码片段和文件信息

M=8;
k=log2(M);
n=1.2e6;
samp=1;
coderate=1;

x=randi([01]1n);
xreshape=reshape(xn/kk);
xsym=bi2de(xreshape‘left-msb‘);

h_mod1 = modem.genqammod(‘Constellation‘[1j*(0.75^0.5+0.5)-1j*(0.75^0.5+0.5)...
                                                 0.75^0.5+0.5-(0.75^0.5+0.5)...
                                                        0.5+1j*0.50.5-1j*0.5...
                                                        -0.5+1j*0.5-0.5-1j*0.5]...
                                                        ‘InputType‘‘integer‘);
h_demod1 = modem.genqamdemod(‘Constellation‘[1j*(0.75^0.5+0.5)-1j*(0.75^0.5+0.5)...
                                                 0.75^0.5+0.5-(0.75^0.5+0.5)...
                                                        0.5+1j*0.50.5-1j*0.5...
                                                        -0.5+1j*0.5-0.5-1j*0.5]...
                                                        ‘OutputType‘‘integer‘);                                            

y1 = modulate(h_mod1xsym);
EbNO_in_dB=4:1:13;
num = length(EbNO_in_dB);
num_of_errors=zeros(4num);
bit_error_rate=zeros(4num);
snr = EbNO_in_dB + 10*log10(k)+10*log10(coderate)-10*log10(samp);
% snr= 10.^(snr/10);
for m = 1:num
    yn1 = awgn(y1 snr(m) ‘measured‘);
    zsym1 = demodulate(h_demod1yn1);
    z1 = reshape(de2bi(zsym1 ‘left-msb‘) 1 n);
    [num_of_errors(1m)bit_error_rate(1m)] = biterr(xz1);
end

plot(snr log10(bit_error_rate(11:num))‘-+k‘);
xlabel(‘SNR/dB‘)ylabel(‘BER‘);
title(‘BER曲线‘);axis([0 20 -5 0]);
grid on
% hold on
% plot(snr log10(bit_error_rate(21:num))‘-ob‘);
% hold on
% plot(snr log10(bit_error_rate(31:num))‘-xr‘);
% hold on
% plot(snr log10(bit_error_rate(41:num)) ‘-*m‘);
legend(‘8QAM‘)


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1798  2018-09-16 09:20  误码率计算\A8QAM.m
     文件        1652  2018-09-15 22:04  误码率计算\QPSK.m
     文件         785  2018-09-15 20:35  误码率计算\demodu_8qam_mat.m
     目录           0  2018-09-16 09:55  误码率计算\

评论

共有 条评论