我在交流课上做了作业。我将在 AWGN、Rayleigh 和 Rician 通道上查看 BPSK 和 QPSK 调制的 BER-EbN0 图。我使用 mathwork.com 和其他网站中的资源写了一些东西。它适用于 AWGN,但不适用于其他两个。我认为缺少的部分是均衡。但我找不到解决方案。等待您的帮助,谢谢。
clc; clear; close all;
bit = 100000;
bpskmod = comm.BPSKModulator;
bpskdemod = comm.BPSKDemodulator;
qpskmod = comm.QPSKModulator;
qpskdemod = comm.QPSKDemodulator;
rician_ch = comm.RicianChannel;
rayleigh_ch = comm.RayleighChannel;
equl = comm.MLSEEqualizer;
r = randi([0 1],bit,1);
out = zeros(size(r), 'like', r);
EbNo = 1:1:10;
for n = 1:1:10
bpskmod_r = bpskmod(r);
qpskmod_r = qpskmod(r);
awgn_ch = comm.AWGNChannel('EbNo',n);
bpsk_ch_out = awgn_ch(bpskmod_r);
qpsk_ch_out = awgn_ch(qpskmod_r);
bpsk_rician = rician_ch(bpsk_ch_out);
qpsk_rician = rician_ch(qpsk_ch_out);
bpsk_rayleigh = rayleigh_ch(bpsk_ch_out);
qpsk_rayleigh = rayleigh_ch(qpsk_ch_out);
bpsk_rayleigh_eq = equl(bpsk_rayleigh);
qpsk_rayleigh_eq = equl(qpsk_rayleigh);
bpskdemod_r = bpskdemod(bpsk_ch_out);
qpskdemod_r = qpskdemod(qpsk_ch_out);
bpskdemod_rician = bpskdemod(bpsk_rician);
qpskdemod_rician = qpskdemod(qpsk_rician);
bpskdemod_rayleigh = bpskdemod(bpsk_rayleigh_eq);
qpskdemod_rayleigh = qpskdemod(qpsk_rayleigh_eq);
bpsk_ber(n) = biterr(bpskdemod_r, r)/bit;
qpsk_ber(n) = biterr(qpskdemod_r, r)/bit;
bpsk_rician_ber(n) = biterr(bpskdemod_rician, r)/bit;
qpsk_rician_ber(n) = biterr(qpskdemod_rician, r)/bit;
bpsk_rayleigh_ber(n) = biterr(bpskdemod_rayleigh, r)/bit;
qpsk_rayleigh_ber(n) = biterr(qpskdemod_rayleigh, r)/bit;
end
figure;
title('AWGN Kanalda BPSK ve QPSK modülasyonları grafiği')
semilogy(EbNo, bpsk_ber, 'o-');
hold on;
semilogy(EbNo, qpsk_ber, 'o-');
semilogy(EbNo, bpsk_rician_ber, 'o-');
semilogy(EbNo, qpsk_rician_ber, 'o-');
semilogy(EbNo, bpsk_rayleigh_ber, 'o-');
semilogy(EbNo, qpsk_rayleigh_ber, 'o-');
legend('BPSK', 'QPSK', 'BPSK on Rician', 'QPSK on Rician', 'BPSK on Rayleigh', 'QPSK on Rayleigh');
grid on;
xlabel('EbN0(dB)');
ylabel('BER');