added progress bars

This commit is contained in:
ti_mo
2026-06-12 12:51:24 +02:00
parent 1918447edc
commit 021617fe50
5 changed files with 1034 additions and 6 deletions
+19 -2
View File
@@ -24,8 +24,18 @@ errorCounts = zeros(numel(mcs_values_t1), numel(snrs));
packetCounts = zeros(numel(mcs_values_t1), numel(snrs));
errorRates = zeros(numel(mcs_values_t1), numel(snrs));
cfrMagnitudesBySnr = cell(numel(mcs_values_t1), numel(snrs));
f = waitbar(0, "Starting");
progressTotal = numel(mcs_values_t1) * numel(snrs);
progressQueue = parallel.pool.DataQueue;
parfor_waitbar(f, progressTotal, "Starting MCS sweep", true);
progressListener = afterEach(progressQueue, @(info) parfor_waitbar(f, progressTotal, info, false));
for imcs = 1 : numel(mcs_values_t1)
cfgEHT.User{1}.MCS = mcs_values_t1(imcs);
currentMcs = mcs_values_t1(imcs);
cfgEHT.User{1}.MCS = currentMcs;
errorCountsForMcs = zeros(1, numel(snrs));
packetCountsForMcs = zeros(1, numel(snrs));
@@ -39,6 +49,8 @@ for imcs = 1 : numel(mcs_values_t1)
packetCountsForMcs(snr_idx) = packetCount;
errorRatesForMcs(snr_idx) = errorCount / packetCount;
cfrMagnitudesForMcs{snr_idx} = cfrMagnitudes;
send(progressQueue, sprintf("MCS %d | SNR %.1f dB", currentMcs, snrs(snr_idx)));
end
errorCounts(imcs, :) = errorCountsForMcs;
@@ -47,6 +59,11 @@ for imcs = 1 : numel(mcs_values_t1)
cfrMagnitudesBySnr(imcs, :) = cfrMagnitudesForMcs;
end
delete(progressListener);
if ishandle(f)
close(f);
end
markers = 'ox*sd^v><ph+ox*sd^v><ph+';
figure;
for imcs = 1 : numel(mcs_values_t1)
@@ -95,4 +112,4 @@ plot(representativeCfr);
grid on;
xlabel("Subcarrier index");
ylabel("|H[k]|");
title("CFR magnitude for representative packet at 25 dB SNR");
title("CFR magnitude for representative packet at 25 dB SNR");