Skip to content

Commit

Permalink
AWGN/MPP plots for RADE V2 PAPR/bandwidth paper
Browse files Browse the repository at this point in the history
  • Loading branch information
drowe67 committed Jan 20, 2025
1 parent dce6360 commit c1899e6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
16 changes: 10 additions & 6 deletions compare_models.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ function run_model() {
model=$1
dim=$2
epoch=$3
chan=$4
shift
shift
shift
shift
python3 ./train.py --cuda-visible-devices 0 --sequence-length 400 --batch-size 512 --latent-dim ${dim} \
--epochs 1 --lr 0.003 --lr-decay-factor 0.0001 \
~/Downloads/tts_speech_16k_speexdsp.f32 tmp \
--range_EbNo --plot_EqNo ${model} --initial-checkpoint ${model}/checkpoints/checkpoint_epoch_${epoch}.pth $@
--range_EbNo --plot_EqNo ${model}_${chan} --initial-checkpoint ${model}/checkpoints/checkpoint_epoch_${epoch}.pth $@
}

# TODO automate here; Makefile like behaivour to generate model${model}_loss_EqNodB.txt files if they don't exist
Expand All @@ -28,12 +30,14 @@ function run_model() {
#run_model model18 40 --bottleneck 3 # mixed rate Rs with tanh applied to |tx|
#run_model model17_check7 80 --range_EbNo_start -9 --bottleneck 3 # should be repeat of 17
#run_model ~/tmp/240607_radio_ae/model17_check3 80 --bottleneck 3 --range_EbNo_start -9 # 17 with aux emebdded 25 bits/s data
#run_model model19_check3 80 100 --bottleneck 3 --range_EbNo_start -9 --auxdata # RADE V1 model
#run_model 250117_test 80 200 --bottleneck 3 --range_EbNo_start -9 --auxdata --txbpf # 0dB PAPR, 99% power BW < 1.5Rq, 3 stage clip/filter
#run_model model19_check3 80 100 awgn --bottleneck 3 --range_EbNo_start -9 --auxdata # RADE V1 model
#run_model 250117_test 80 200 awgn --bottleneck 3 --range_EbNo_start -9 --auxdata --txbpf # 0dB PAPR, 99% power BW < 1.5Rq, 3 stage clip/filter
#run_model model19_check3 80 100 mpp --bottleneck 3 --range_EbNo_start 0 --auxdata --h_file h_nc20_train_mpp.f32 # RADE V1 model
#run_model 250117_test 80 200 mpp --bottleneck 3 --range_EbNo_start 0 --auxdata --txbpf --h_file h_nc20_train_mpp.f32 # 0dB PAPR, 99% power BW < 1.5Rq, 3 stage clip/filter

model_list='model19_check3 250117_test'
model_dim=(80 80)
declare -a model_legend=("RADE V1" "Joint PAPR/BW")
model_list='model19_check3_awgn 250117_test_awgn model19_check3_mpp 250117_test_mpp'
model_dim=(80 80 80 80)
declare -a model_legend=("RADE V1 AWGN" "Joint PAPR/BW AWGN" "RADE V1 MPP" "Joint PAPR/BW MPP")

loss_EqNo=""
loss_CNo="50,1"
Expand Down
8 changes: 7 additions & 1 deletion radae_plots.m
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ function loss_EqNo_plot(png_fn, epslatex, varargin)
i++;
end
hold off; grid; xlabel('Eq/No (dB)'); ylabel('loss'); legend('boxoff');
mn = min(data(:,1))
axis([mn mn+20 0.105 0.25])
if length(png_fn)
print("-dpng",png_fn);
end
Expand All @@ -164,13 +166,15 @@ function loss_CNo_plot(png_fn, epslatex, Rs, B, varargin)
end
figure(1); clf; hold on;
i = 1;
mn = 100;
while i <= length(varargin)
fn = varargin{i};
data = load(fn);
i++; dim = varargin{i}; Nc = dim/2;
i++; leg = varargin{i}; leg = strrep (leg, "_", " ");
EqNo = data(:,1);
CNo = EqNo + 10*log10(Rs*Nc/B);
mn = min([mn; CNo]);
plot(CNo,data(:,2),sprintf("+-;%s;",leg))
i++;
end
Expand All @@ -180,7 +184,9 @@ function loss_CNo_plot(png_fn, epslatex, Rs, B, varargin)
else
xlabel('SNR (dB)');
end
ylabel('loss');
ylabel('loss');
mn = floor(mn);
axis([mn mn+20 0.05 0.25])
if length(png_fn)
print("-dpng",png_fn);
end
Expand Down

0 comments on commit c1899e6

Please sign in to comment.