Experiment 4 1
Experiment 4 1
Code:
% Transmitter
% Pre-allocate memory
for ii = 1:length(Eb_NO_dB)
% Rayleigh channel
end
% Simulated BER
simBer_AWGN = nErr_AWGN / N;
simBer_Rayleigh = nErr_Rayleigh / N;
% Theoretical BER
figure;
grid on;
xlabel('Eb/No, dB');
figure;
semilogy(Eb_NO_dB, theoryBer_AWGN, 'b.-', 'LineWidth', 1.5); hold on;
grid on;
xlabel('Eb/No, dB');
title('Bit error probability curve for BPSK modulation in AWGN and Rayleigh channels');
Output: