diff --git a/lab_4/lab_4.m b/lab_4/lab_4.m index 69d2858..e37a83b 100644 --- a/lab_4/lab_4.m +++ b/lab_4/lab_4.m @@ -27,5 +27,29 @@ seed = 666; ntn_tdl_delay_profiles = ["A" "B" "C" "D"]; use_t1_as_t4 = false; -task1; +% task1; + +use_pilot_tracking = false; task2; +results_apep4000_npt = results(apep_values == 4000, :); + +use_pilot_tracking = true; +task2; + +results_apep4000_pt = results(apep_values == 4000, :); + +figure; +semilogy(snrs, results_apep4000_npt, ['-' 'o']); +hold on; +semilogy(snrs, results_apep4000_pt, ['-' 'x']); +hold on; + +grid on; +xlabel('SNR (dB)'); +ylabel('PER'); + +dataStr = ["no pilot tracking" "pilot tracking"] +legend(dataStr, 'Location', 'NorthEastOutside'); +title('PER over SNR for APEP 4000, usage of pilot tracking comparision, CBW20, NTN-TDL-C'); + + diff --git a/lab_4/link_level_measurements.md b/lab_4/link_level_measurements.md index d6fab0c..dbcfd24 100644 --- a/lab_4/link_level_measurements.md +++ b/lab_4/link_level_measurements.md @@ -10,7 +10,7 @@ | Parallel Computing Toolbox Version | 26.1 | - | - | - | - | | Random stream | mt19937ar with seed | - | - | - | - | | Random seed | 666 | - | - | - | - | -| SNR vector | 0:1:40 dB | - | - | - | - | +| SNR vector | $0:1:40\,dB$ | - | - | - | - | | Packet budget | 1024 packets per SNR point | - | - | - | - | | maxNumErrors | 50 | - | - | - | - | | NTN profile | NTN-TDL-C | - | - | - | - | @@ -37,7 +37,7 @@ See code `lab_4.m`, `create_baseline_configuration.m` and `simulateTransmission. #### 1.2 ![PER over SNR](per_snr_sweep.svg) -The plot shows the packet error rate significantly decreasing as the signal to noise ration increases. This behavior can be observed when the snr reaches a value of 25, at that simulation point the signal significantly overweights the noise and the PER also significantly decreases in an negative exponential manner. +The plot shows the packet error rate significantly decreasing as the signal to noise ration increases. This behavior can be observed when the SNR reaches a value of 25, at that simulation point the signal significantly overweights the noise and the PER also significantly decreases in an negative exponential manner. At link level, PER is the fraction of transmitted PHY-layer packets that are not received correctly for a given channel model and SNR. #### 1.3 @@ -65,11 +65,11 @@ The complete CFR collection is included as a consistency check. The collected pa ###### Visual analysis: -The plots packet error rate to signal to noise ratio curve shifts to higher SNR values for larger APEP values. In contrast to the other graphs APEP = 250 has the highest rate of successful transmitted packets. +The PER-over-SNR curves shift to higher SNR values for larger APEP values. In contrast to the other graphs APEP = 250 B has the highest rate of successful transmitted packets. ###### Analyzing by meaning: -Smaller APEP values perform better than larger APEP values. In particular, APEP = 250 reaches low PER at lower SNR than the larger payload sizes. As the payload size increases, the plot shifts to the right, so larger packets need a higher SNR to achieve the same packet error rate. Using a small APEP results in more successfully transmitted packets, but also increases the needed network usage, more smaller packets mean more packet headers, resulting in more data that needs to be transferred in sum. Increasing APEP increases the number of payload bits and therefore the number of EHT-Data OFDM symbols. Larger APEP increase the packet duration. Since pilot tracking is disabled, residual CFO and common phase error are not continuously corrected during the data field. The longer the packet lasts, the more residual phase error can accumulate, which increases the probability that the packet is decoded incorrectly. The residual CFO is more harmful to longer packets because the phase error accumulates over the packet duration. +Smaller APEP values perform better than larger APEP values. In particular, APEP = 250 B reaches low PER at lower SNR than the larger payload sizes. As the payload size increases, the plot shifts to the right, so larger packets need a higher SNR to achieve the same packet error rate. Using a small APEP results in more successfully transmitted packets, but also increases the needed network usage / protocol overhead, more smaller packets mean more packet headers, resulting in more data that needs to be transferred in sum. Increasing APEP increases the number of payload bits and therefore the number of EHT-Data OFDM symbols. Larger APEP increase the packet duration. Since pilot tracking is disabled, residual CFO and common phase error are not continuously corrected during the data field. The longer the packet lasts, the more residual phase error can accumulate, which increases the probability that the packet is decoded incorrectly. The residual CFO is more harmful to longer packets because the phase error accumulates over the packet duration. ###### Summary: @@ -79,15 +79,27 @@ Increasing APEP increases the number of payload bits and therefore the number of | Target PER | Reasonable SNR | Practical maximum APEP | |:---:|:---:|:---:| -| $10^{-1}$ | $23dB$ | $600$ | +| $10^{-1}$ | $23\,dB$ | $600\,B$ | -The target PER for this task is $10^{-1}$. I use $23dB$ as a practical SNR limit, because it is close to the beginning of the low-PER region while still avoiding the very high-SNR tail of the simulation. From the focused APEP comparison, APEP $= 600B$ reaches PER $\leq 10^{-1}$ at approximately $23dB$. Larger payloads require a higher SNR to reach the same target PER. Therefore, under the chosen practical SNR limit, APEP $= 600$ is selected as the practical maximum payload size. +The target PER for this task is $10^{-1}$. I use $23\,dB$ as a practical SNR limit, because it is close to the beginning of the low-PER region while still avoiding the very high-SNR tail of the simulation. From the focused APEP comparison, APEP $= 600\,B$ reaches PER $\leq 10^{-1}$ at approximately $23\,dB$. Larger payloads require a higher SNR to reach the same target PER. Therefore, under the chosen practical SNR limit, APEP $= 600\,B$ is selected as the practical maximum payload size. ![PER over SNR with focus on 600 and 800 APEP and 250 and 1000 APEP contrast plot](per_snr_apep_t22.svg) -This choice is a compromise between robustness and overhead. Smaller packets such as APEP $= 250B$ are more robust, but require more packets and therefore more protocol overhead to transmit the same amount of user data. Larger packets reduce overhead, but are more sensitive to residual CFO because of their longer packet duration. +This choice is a compromise between robustness and overhead. Smaller packets such as APEP $= 250\,B$ are more robust, but require more packets and therefore more protocol overhead to transmit the same amount of user data. Larger packets reduce overhead, but are more sensitive to residual CFO because of their longer packet duration. -As a practical motivation, this SNR limit can be interpreted as a conservative design choice for difficult deployment scenarios, for example remote or terrain-challenged areas. This was not explicitly simulated in this lab, since the channel model does not include blockage, vegetation, or terrain shadowing. However, such scenarios often involve small battery-powered devices with limited energy availability. Therefore, choosing a payload size that reaches the target PER without relying on the very high-SNR tail is useful, because it leaves more link margin and can reduce the need for retransmissions. In this sense, APEP = 600 is a practical compromise between robustness, packet overhead, and energy-aware operation. +As a practical motivation, this SNR limit can be interpreted as a conservative design choice for difficult deployment scenarios, for example remote or terrain-challenged areas. This was not explicitly simulated in this lab, since the channel model does not include blockage, vegetation, or terrain shadowing. However, such scenarios often involve small battery-powered devices with limited energy availability. Therefore, choosing a payload size that reaches the target PER without relying on the very high-SNR tail is useful, because it leaves more link margin and can reduce the need for retransmissions. In this sense, APEP = 600 B is a practical compromise between robustness, packet overhead, and energy-aware operation. -For applications where higher data rates are more important than robustness, a larger payload such as APEP $= 4000$ may still be attractive because it reduces relative packet overhead. In the simulated range, this requires operating closer to the high-SNR end of the sweep, approximately around $40dB$ for the target PER. +For applications where higher data rates are more important than robustness, a larger payload such as APEP $= 4000\,B$ may still be attractive because it reduces relative packet overhead. In the simulated range, this requires operating closer to the high-SNR end of the sweep, approximately around $40\,dB$ for the target PER. + +## Task 3 + +#### 3.1 + +###### Full Task 2 APEP Plot with pilot tracking enabled: +![PER over SNR with Pilot Tracking enabled](per_snr_apep_pilot_tracked.svg) + +###### Comparision plot with APEP = 4000 B: +![PER over SNR no pilot tracking vs pilot tracking](per_snr_apep_npt_vs_pt.svg) + +Comparing the plots shows a significant improvement when pilot tracking is enabled. Pilot tracking uses the EHT-Data pilots to compensate residual common phase error during the data field. This is especially beneficial for larger packets, because residual CFO has more time to accumulate phase error over the packet duration. For APEP = 4000 B, the target PER of $10^{-1}$ is reached at approximately $5.25\,dB$ with pilot tracking, compared to approximately $40\,dB$ without pilot tracking. This shows that pilot tracking strongly improves CFO tolerance for long packets. diff --git a/lab_4/per_snr_apep_npt_vs_pt.svg b/lab_4/per_snr_apep_npt_vs_pt.svg new file mode 100644 index 0000000..48c877d --- /dev/null +++ b/lab_4/per_snr_apep_npt_vs_pt.svg @@ -0,0 +1,402 @@ + + +Qt SVG Document +MATLAB, The MathWorks, Inc. Version 26.1.0.3251617 R2026a Update 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 + + + +5 + + + +10 + + + +15 + + + +20 + + + +25 + + + +30 + + + +35 + + + +40 + + + +SNR (dB) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +10 + + + +-2 + + + +10 + + + +-1 + + + +10 + + + +0 + + + +PER + + + +PER over SNR for APEP 4000, usage of pilot tracking comparision, CBW20, NTN-TDL-C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +no pilot tracking + + + +pilot tracking + + + + + + + diff --git a/lab_4/per_snr_apep_pilot_tracked.svg b/lab_4/per_snr_apep_pilot_tracked.svg new file mode 100644 index 0000000..ba66ab8 --- /dev/null +++ b/lab_4/per_snr_apep_pilot_tracked.svg @@ -0,0 +1,494 @@ + + +Qt SVG Document +MATLAB, The MathWorks, Inc. Version 26.1.0.3251617 R2026a Update 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0 + + + +1 + + + +2 + + + +3 + + + +4 + + + +5 + + + +6 + + + +SNR (dB) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +10 + + + +-2 + + + +10 + + + +-1 + + + +10 + + + +0 + + + +PER + + + +PER over SNR for APEP sweep, CBW20, NTN-TDL-C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +APEP 250 + + + +APEP 1000 + + + +APEP 4000 + + + +APEP 8000 + + + +APEP 12000 + + + + + + + diff --git a/lab_4/simulateTransmission.m b/lab_4/simulateTransmission.m index 1e927ac..404f765 100644 --- a/lab_4/simulateTransmission.m +++ b/lab_4/simulateTransmission.m @@ -1,4 +1,9 @@ -function [numPacketErrors, numPacketsSimulated, cfrMagnitudes]= simulateTransmission(cfgEHT, channel, maxChDelay, snr, maxNumPackets, maxNumErrors, simParameters, chanBW, substreamIndex, elevationAngles) +function [numPacketErrors, numPacketsSimulated, cfrMagnitudes]= simulateTransmission(cfgEHT, channel, maxChDelay, snr, maxNumPackets, maxNumErrors, simParameters, chanBW, substreamIndex, elevationAngles, enablePilotTracking) + % assure backwards compatibility + if nargin < 11 + enablePilotTracking = false; + end + numPacketErrors = 0; numPacketsSimulated = 0; cfrMagnitudes = []; @@ -66,6 +71,10 @@ function [numPacketErrors, numPacketsSimulated, cfrMagnitudes]= simulateTransmis rxData = rx(packetOffset + (ind.EHTData(1) : ind.EHTData(2)), :); demodSym = wlanEHTDemodulate(rxData, "EHT-Data", cfgEHT); + if enablePilotTracking + demodSym = wlanEHTTrackPilotError(demodSym, chanEstimate, cfgEHT, "EHT-Data"); + end + nVarEst = wlanEHTDataNoiseEstimate(demodSym(ofdmInfo.PilotIndices, :, :),pilotEstimate, cfgEHT); demodDataSym = demodSym(ofdmInfo.DataIndices, :, :); diff --git a/lab_4/task2.m b/lab_4/task2.m index 2d00929..9fa045c 100644 --- a/lab_4/task2.m +++ b/lab_4/task2.m @@ -15,7 +15,11 @@ for apep_idx = 1 : numel(apep_values) parfor snr_idx = 1 : length(snrs) local_channel = clone(channel); - [errorCount, packetCount, cfrMagnitudes] = simulateTransmission(cfgEHT, local_channel, maxChDelay, snrs(snr_idx), packets_per_snr, maxNumErrors, simParameters, chanBW, snr_idx, elevationAngles); + if use_pilot_tracking + [errorCount, packetCount, cfrMagnitudes] = simulateTransmission(cfgEHT, local_channel, maxChDelay, snrs(snr_idx), packets_per_snr, maxNumErrors, simParameters, chanBW, snr_idx, elevationAngles, true); + else + [errorCount, packetCount, cfrMagnitudes] = simulateTransmission(cfgEHT, local_channel, maxChDelay, snrs(snr_idx), packets_per_snr, maxNumErrors, simParameters, chanBW, snr_idx, elevationAngles); + end results(apep_idx, snr_idx) = errorCount / packetCount; end end