diff --git a/lab_4/parfor_waitbar.m b/lab_4/parfor_waitbar.m new file mode 100644 index 0000000..5fa352c --- /dev/null +++ b/lab_4/parfor_waitbar.m @@ -0,0 +1,29 @@ +function parfor_waitbar(f, totalJobs, detail, reset) + persistent done + + if reset + done = 0; + if ishandle(f) + if isempty(detail) + waitbar(0, f, "Starting"); + else + waitbar(0, f, detail); + end + end + return + end + + if isempty(done) + done = 0; + end + + done = done + 1; + + if ishandle(f) + progressText = sprintf("Done %d/%d", done, totalJobs); + if ~isempty(detail) + progressText = sprintf("%s | %s", progressText, char(detail)); + end + waitbar(min(done / totalJobs, 1), f, progressText); + end +end diff --git a/lab_4/per_snr_mcs.svg b/lab_4/per_snr_mcs.svg new file mode 100644 index 0000000..aa7341d --- /dev/null +++ b/lab_4/per_snr_mcs.svg @@ -0,0 +1,956 @@ + + +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 + + + +-3 + + + +10 + + + +-2 + + + +10 + + + +-1 + + + +10 + + + +0 + + + +PER + + + +PER (EHT MU), CBW20, NTN-TDL-C, 1-by-1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +MCS 0 + + + +MCS 2 + + + +MCS 4 + + + +MCS 8 + + + +MCS 10 + + + +MCS 12 + + + +MCS 13 + + + + + + + diff --git a/lab_4/task1.m b/lab_4/task1.m index f85d55d..5770947 100644 --- a/lab_4/task1.m +++ b/lab_4/task1.m @@ -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>