Professional Documents
Culture Documents
Lab01 Ca01 Nhom03
Lab01 Ca01 Nhom03
Bước 2: Điều chế số QPSK (mapping symbols trên kênh rời rạc)
function [s] = Modulation(Bits_data, N)
s = [];
sI = 1/sqrt(2); sQ = 1/sqrt(2);
for i = 1:2:N-1
if (Bits_data(i)== 0 && Bits_data(i+1)== 0)
s = [s sI + 1i*sQ];
elseif (Bits_data(i)== 0 && Bits_data(i+1)== 1)
s = [s -sI + 1i*sQ];
elseif (Bits_data(i)== 1 && Bits_data(i+1)== 1)
s = [s -sI - 1i*sQ];
else
s = [s sI - 1i*sQ];
end
end
end
Bước 3: Tạo kênh nhiễu AWGN với công suất nhiễu trung bình N0=10-1
function [n] = AWGN(N0,N)
n = sqrt(N0/2)*(randn(1,N/2) + 1i*randn(1,N/2));
end
N mẫu nhiễu AWGN
BER_theo(i) = BER_8PSK_Theo(SNR(i));
end
figure(1)
semilogy(SNR_dB,BER_theo,'r-','linewidth',1.2);
hold on;
semilogy(SNR_dB,BER,'ko','linewidth',1.2); grid on;
xlabel('SNR (dB)'); ylabel('BER');
legend('Theory-8PSK','Simulation');