Plot the BER for QPSK, DQPSK
Mostrar comentarios más antiguos
Plot the performance in the same figure for the BER for QPSK, DQPSK theoretical and simulation results (BER vs Eb/N0)

Respuestas (1)
Prasanna
el 11 de Sept. de 2024
Hi Ramiz,
To plot the Bit Error Rate (BER) performance for QPSK and DQPSK (both theoretical and simulation results) on the same figure, you can first instantiate the results data and use the ‘grid’ function to plot it on the same graph. A sample MATLAB code for the same is given below:
% Parameters
EbN0_dB = 0:2:16; % Eb/N0 range in dB
numBits = 1e5; % Number of bits for simulation
% Preallocate BER arrays
berQPSK_sim = [0.077833 0.03584 0.0118 0.002307 0.0002 0.000001 0 0 0];
berDQPSK_sim = [0.1652 0.1023 0.0481 0.01726 0.003786 0.000337 0.000013 0 0];
berQPSK_theory = [0.07341 0.03149 0.0107 0.002013 0.00014 0.000001 0 0 0];
berDQPSK_theory = [0.00591 0.0941 0.041 0.01453 0.0034 0.0003 0.000013 0 0];
% Simulation loop
% Plotting
figure;
semilogy(EbN0_dB, berQPSK_sim, 'bo-', 'DisplayName', 'QPSK Simulation');
hold on;
semilogy(EbN0_dB, berQPSK_theory, 'b--', 'DisplayName', 'QPSK Theory');
semilogy(EbN0_dB, berDQPSK_sim, 'ro-', 'DisplayName', 'DQPSK Simulation');
semilogy(EbN0_dB, berDQPSK_theory, 'r--', 'DisplayName', 'DQPSK Theory');
grid on;
xlabel('E_b/N_0 (dB)');
ylabel('Bit Error Rate (BER)');
title('BER vs E_b/N_0 for QPSK and DQPSK');
legend('Location', 'southwest');
The results are plotted on a semilogarithmic scale to obtain the plot. The output for the above script is as follows:
For more references on the functions related to QPSK and DPQSK modulation and the ones used in the script, you can refer the following documentations:
- Pskmod - https://www.mathworks.com/help/comm/ref/pskmod.html
- Dpskmod - https://www.mathworks.com/help/comm/ref/dpskmod.html
- Berawgn - https://www.mathworks.com/help/comm/ref/berawgn.html
- Semiology - https://www.mathworks.com/help/matlab/ref/semilogy.html
Hope this helps!
Categorías
Más información sobre PHY Components en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!