diff --git a/lab_4/cfr_mag_rep_p_25db_snr.svg b/lab_4/cfr_mag_rep_p_25db_snr.svg
new file mode 100644
index 0000000..a82236d
--- /dev/null
+++ b/lab_4/cfr_mag_rep_p_25db_snr.svg
@@ -0,0 +1,209 @@
+
+
diff --git a/lab_4/complete_packet_cfr_magnitudes_by_first_mcs.svg b/lab_4/complete_packet_cfr_magnitudes_by_first_mcs.svg
new file mode 100644
index 0000000..a18d86f
--- /dev/null
+++ b/lab_4/complete_packet_cfr_magnitudes_by_first_mcs.svg
@@ -0,0 +1,24 @@
+
+
diff --git a/lab_4/lab_4.m b/lab_4/lab_4.m
index 7577ba6..25af44b 100644
--- a/lab_4/lab_4.m
+++ b/lab_4/lab_4.m
@@ -8,7 +8,7 @@ tx_antenna_count = 1;
rx_antenna_count = 1;
snrs = (0:1:40);
-packets_per_snr = 250;
+packets_per_snr = 1024;
maxNumErrors = 50;
% elevation_angle = 50;
@@ -35,7 +35,6 @@ ntn_tdl_delay_profiles = ["A" "B" "C" "D"];
meanSlantRange = mean(slantRanges);
meanSatelliteDopplerShift = mean(dopplerShifts);
-
meanNormalizedCFO = meanSatelliteDopplerShift / wifi_be_subcarrier_spacing;
disp("Mean Elevation Angle: " + meanElevationAngle + "°")
@@ -43,17 +42,31 @@ disp("Mean Slant Range: " + meanSlantRange + "m")
disp("Mean Satellite Doppler Shift: " + meanSatelliteDopplerShift + "Hz")
disp("Normalized CFO: " + meanNormalizedCFO)
+errorCounts = zeros(numel(mcs_values), numel(snrs));
+packetCounts = zeros(numel(mcs_values), numel(snrs));
errorRates = zeros(numel(mcs_values), numel(snrs));
+cfrMagnitudesBySnr = cell(numel(mcs_values), numel(snrs));
for imcs = 1 : numel(mcs_values)
cfgEHT.User{1}.MCS = mcs_values(imcs);
+
+ errorCountsForMcs = zeros(1, numel(snrs));
+ packetCountsForMcs = zeros(1, numel(snrs));
+ errorRatesForMcs = zeros(1, numel(snrs));
+ cfrMagnitudesForMcs = cell(1, numel(snrs));
+
parfor snr_idx = 1 : length(snrs)
- local_channel = clone(channel)
- [errorCount, packetCount] = simulateTransmission(cfgEHT, local_channel, maxChDelay, snrs(snr_idx), packets_per_snr, maxNumErrors, simParameters, chanBW, snr_idx, elevationAngles);
-
- errorCounts(snr_idx) = errorCount;
- packetCounts(snr_idx) = packetCount;
- errorRates(imcs, snr_idx) = errorCount / packetCount;
+ local_channel = clone(channel);
+ [errorCount, packetCount, cfrMagnitudes] = simulateTransmission(cfgEHT, local_channel, maxChDelay, snrs(snr_idx), packets_per_snr, maxNumErrors, simParameters, chanBW, snr_idx, elevationAngles);
+ errorCountsForMcs(snr_idx) = errorCount;
+ packetCountsForMcs(snr_idx) = packetCount;
+ errorRatesForMcs(snr_idx) = errorCount / packetCount;
+ cfrMagnitudesForMcs{snr_idx} = cfrMagnitudes;
end
+
+ errorCounts(imcs, :) = errorCountsForMcs;
+ packetCounts(imcs, :) = packetCountsForMcs;
+ errorRates(imcs, :) = errorRatesForMcs;
+ cfrMagnitudesBySnr(imcs, :) = cfrMagnitudesForMcs;
end
markers = 'ox*sd^v> This PDF will be a bit more 'well defined'
-## Reproducability
-|reproducability factor | value |
-|:---|---:|
-| MATLAB Version | 26.1.0.3251617 (R2026a) Update 2 |
-| Toolboxes/Version | 5G/26.1 |
-|| WLAN/26.1 |
-|| Communication/26.1 |
-|| Parallel Computing/26.1 |
-| random seed | 666 |
-| SNR vector | 0:1:40dB |
-| packet budget | 250 |
-| maxNumErrors | 50 |
+## Reproducibility
+| Reproducibility factor | Task 1 value | Task 2 value | Task 3 value | Task 4.1 value | Task 4.2 value |
+|:---|:---:|:---:|:---:|:---:|:---:|
+| MATLAB Version | 26.1.0.3251617 (R2026a) Update 2 | - | - | - | - |
+| 5G Toolbox Version | 26.1 | - | - | - | - |
+| WLAN Toolbox Version | 26.1 | - | - | - | - |
+| Communications Toolbox Version | 26.1 | - | - | - | - |
+| Parallel Computing Toolbox Version | 26.1 | - | - | - | - |
+| Random stream | mt19937ar with seed | - | - | - | - |
+| Random seed | 666 | - | - | - | - |
+| SNR vector | 0:1:40 dB | - | - | - | - |
+| Packet budget | 1024 packets per SNR point | - | - | - | - |
+| maxNumErrors | 50 | - | - | - | - |
+| NTN profile | NTN-TDL-C | - | - | - | - |
+| Carrier frequency | 2.4 GHz | - | Task 3.2: [1 2.4 5 5.8 6 12 24 60] GHz | - | - |
+| LEO altitude | 600 km | - | - | - | - |
+| Elevation sequence | 10° to 90° to 10° over the packet sequence | - | - | - | - |
+| Mean elevation angle | 50° | - | - | - | - |
+| Mean slant range | 906.32 km | - | - | - | - |
+| Mean satellite Doppler shift | 32.73 kHz | - | changes with carrier frequency | - | - |
+| Normalized CFO | 0.419 | - | changes with carrier frequency | - | - |
+| Channel bandwidth | 20 MHz | - | - | - | [20 40 80 160 320] MHz |
+| MCS | 2 | - | - | [0 2 4 8 10 12 13] | 3 |
+| APEP length | 1000 B | [250 1000 4000 8000 12000] B | Task 3.1: [250 1000 4000 8000 12000] B; Task 3.2: 8000 B | - | - |
+| TX/RX antennas | 1-by-1 SISO | - | - | - | - |
+| Pilot tracking | disabled | - | enabled | - | - |
+| Parallelization | parfor over SNR points | - | - | - | - |
>
## Task1
-For the baseline configuration with f_c = 2.4GHz, LEO altitude 600km, elevation angle 50° (like example), and static receiver, the computed satellite Doppler shift is approximately 35.56kHz. With the IEEE 802.11be subcarrier spacing of 78.125kHz, this corresponds to a normalized CFO of \epsilon \approx 0.455. Therefore, the Doppler shift is below one subcarrier spacing but still represents a significant fraction of the OFDM subcarrier spacing.
+
+#### 1.1
+See code `lab_4.m`, `create_baseline_configuration.m` and `simulateTransmission.m`.
+
+#### 1.2
+
+
+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
+
+For the baseline configuration with $f_c = 2.4GHz$, LEO altitude $600km$, orbital shifted elevation angle (Elevation sequence: 10° to 90° to 10° over the packet sequence, mean: $50°$), and static receiver. The mean slant range is $906.32km$, the computed mean satellite Doppler shift is approximately $32.73kHz$. With the IEEE $802.11be$ subcarrier spacing of $78.125kHz$, this corresponds to a normalized CFO of $\epsilon \approx 0.419$. Therefore, the Doppler shift is below one subcarrier spacing but still represents $41.9%$ of the OFDM subcarrier spacing.
+
+#### 1.4
+
+##### CFR Magnitude single representative Packet:
+
+
+
+The CFR magnitude of the representative packet is relatively flat over the active subcarriers. Only moderate variations are visible, without deep frequency-selective fades. Therefore, for the baseline 20 MHz NTN-TDL-C configuration, the channel appears mostly frequency-flat to mildly frequency-selective.
+
+##### Complete CFR Magnitude over all representative Packets by first MCS:
+
+
+The complete CFR collection is included as a consistency check. The collected packet CFRs show similar magnitude variations over the active subcarriers, indicating that the selected representative packet is typical for this baseline run. No strong deep fades are visible across most packets, so the 20 MHz NTN-TDL-C baseline appears mostly frequency-flat to mildly frequency-selective.
diff --git a/lab_4/per_snr_sweep.svg b/lab_4/per_snr_sweep.svg
new file mode 100644
index 0000000..b5f5838
--- /dev/null
+++ b/lab_4/per_snr_sweep.svg
@@ -0,0 +1,384 @@
+
+
diff --git a/lab_4/simulateTransmission.m b/lab_4/simulateTransmission.m
index a018f15..1e927ac 100644
--- a/lab_4/simulateTransmission.m
+++ b/lab_4/simulateTransmission.m
@@ -1,13 +1,17 @@
-function [numPacketErrors, numPacketsSimulated ]= 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)
numPacketErrors = 0;
numPacketsSimulated = 0;
+ cfrMagnitudes = [];
ofdmInfo = wlanEHTOFDMInfo('EHT-Data', cfgEHT);
ind = wlanFieldIndices(cfgEHT);
- if nargin < 8
+ if nargin < 9
substreamIndex = 1;
end
+ if nargin < 10
+ elevationAngles = simParameters.ElevationAngle * ones(1, maxNumPackets);
+ end
stream = RandStream('combRecursive', Seed=simParameters.Seed);
stream.Substream = substreamIndex;
@@ -57,6 +61,8 @@ function [numPacketErrors, numPacketsSimulated ]= simulateTransmission(cfgEHT, c
heltfDemod = wlanEHTDemodulate(rxHELTF, "EHT-LTF", cfgEHT);
[chanEstimate, pilotEstimate] = wlanEHTLTFChannelEstimate(heltfDemod, cfgEHT);
+ cfrMagnitudes(:, end + 1) = abs(chanEstimate(:, 1, 1));
+
rxData = rx(packetOffset + (ind.EHTData(1) : ind.EHTData(2)), :);
demodSym = wlanEHTDemodulate(rxData, "EHT-Data", cfgEHT);