new plots for Diss. Mostly AI gen. Few changes in actual codebase

This commit is contained in:
Silas Oettinghaus
2026-07-30 08:35:45 +02:00
parent 125d8508ca
commit 7a9deaeb0c
62 changed files with 6171 additions and 630 deletions

View File

@@ -29,15 +29,21 @@ function [snr_all, snr_per_level] = calc_snr(tx_signal, eq_noise)
% Get the unique amplitude levels in the transmitted signal
levels = unique(tx_signal);
% Preallocate an array to store the SNR for each unique level
% Loop over each unique level to compute the SNR for that level
for i = 1:length(levels)
% Find indices where tx_signal equals the current level
idx = (tx_signal == levels(i));
% Compute the SNR for these indices
snr_per_level(i) = snr(tx_signal(idx), eq_noise(idx));
snr_per_level = zeros(numel(levels),1);
try
% Preallocate an array to store the SNR for each unique level
% Loop over each unique level to compute the SNR for that level
for i = 1:length(levels)
% Find indices where tx_signal equals the current level
idx = (tx_signal == levels(i));
% Compute the SNR for these indices
snr_per_level(i) = snr(tx_signal(idx), eq_noise(idx));
end
catch ME
% Handle any errors that occur during SNR calculation
% warning('Error calculating SNR for level %d: %s', levels(i), ME.message);
end
end