Bit Error Probability 3.4
Bit Error Probability 3.4
Done By:
NABEEL FARHAN ‘202070232’
Supervisor By:
D. MOHAMMED AL-SARABI
Table of Contents
Table of Contents ......................................................................................1
1. Introduction.........................................................................................2
2. Equations for BPSK Modulation ......................................................2
2.1. AWGN Channel..................................................................................... 2
2.2. Rayleigh Fading Channel ....................................................................... 3
3. Flowchart .............................................................................................3
4. THE MATLAB CODE .......................................................................5
1|Page
1. Introduction
In this project, we will dive into the analysis of Binary Phase Shift
Keying (BPSK) modulation under two typical channel models: Additive
White Gaussian Noise (AWGN) & Rayleigh fading.
Through MATLAB simulations, we aim to illustrate the bit error
probability performance of BPSK modulation, comparing how the signal
withstands the different challenges posed by these channels. This
comparison not only demonstrates the resilience of BPSK modulation
under varying conditions but also showcases the effectiveness of diversity
techniques in managing signal degradation.
FIGURE 3.4: Bit error probability for BPSK modulation over AWGN and Rayleigh fading channels.
𝟏 𝜸𝒃
𝑷𝒃 = (𝟏 − √ )
𝟐 𝟏 + 𝜸𝒃
2|Page
2.2. Rayleigh Fading Channel
𝟏 𝜸𝒃
𝑷𝒃 = (𝟏 − √ )
𝟐 𝟐 + 𝜸𝒃
3. Flowchart
This is the flowchart to guide the MATLAB code for calculating and
plotting the bit error probability for BPSK modulation over AWGN and
Rayleigh fading channels:
1) Start
o Begin the process.
2) Initialize Variables
𝑬𝒃
o Define ( ) range (in dB): This is the range of signal-to-noise
𝑵𝟎
ratio values for which you want to calculate the bit error
probability.
𝑬𝒃
o Convert ( ) from dB to linear scale.
𝑵𝟎
𝟏 𝜸𝒃
𝑷𝒃 = (𝟏 − √ )
𝟐 𝟏 + 𝜸𝒃
3|Page
5) Calculate Bit Error Probability for Rayleigh Fading:
o Use the formula:
𝟏 𝜸𝒃
𝑷𝒃 = (𝟏 − √ )
𝟐 𝟐 + 𝜸𝒃
6) Plot Results
𝑬𝒃
o Plot ( ) versus (𝑷𝒃 ) for both AWGN and Rayleigh fading on a
𝑵𝟎
semilogarithmic scale.
o Label the axes and the graph.
7) End
4|Page
4. THE MATLAB CODE
% Parameters
N = 10^6; % Number of bits or symbols
Eb_N0_dB = 0:25; % Range of Eb/N0 values (in dB)
% Plotting
figure;
semilogy(Eb_N0_dB, BER_AWGN, 'b-', 'LineWidth', 2); hold on;
semilogy(Eb_N0_dB, BER_Rayleigh, 'r--', 'LineWidth', 2);
grid on; % Enable grid
grid minor; % Enhance grid
xlabel('γ_b (dB)', 'FontSize', 12); % X-axis label
ylabel('P_b', 'FontSize', 12); % Y-axis label
legend('AWGN Channel','Rayleigh Fading Channel','Location','northeast');%Add legend
axis([0 25 10^-5 1]); % Set axis limits
hold off; % Release the plot hold
5|Page