1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
clear all
close all
%% load the files
mm = imread('E:\2004_fd0006_250_c_0485.tif');
load('metadata_MU.mat');
Nuser = size(est,1);
%% plot the rx_rssi over time
h_fig = figure(1);
%plot_style = {'rx','bx','gx','kx'};
plot_style = {'c.','m.','b.','g.','k.'};
for u=1:Nuser
rx_rssi_dBm = [est(u,:).rx_rssi_dBm ];
%timestamp_tx = [est(u,:).timestamp_tx];
%timestamp_tx = timestamp_tx - 4.476e5;
framestamp_tx = [est(u,:).framestamp_tx];
err_ind = logical([est(u,:).err_ind]);
plot(framestamp_tx,mean(rx_rssi_dBm,1),plot_style{u});
hold on
% plot(framestamp_tx(err_ind),mean(rx_rssi_dBm(:,err_ind),1),'rx');
end
hold off
xlabel('Frame')
ylabel('RSSI [dBm]')
%xlim([min(framestamp_is),max(framestamp_is)])
%xlim([framestamp_is(max_start),framestamp_is(max_start+max_length)]);
legend('User 1','User 2','User 3','User 4')
saveas(h_fig, 'rx_rssi_time.eps', 'psc2');
%% plot the FER over time
h_fig = figure(2);
%plot_style = {'rx','bx','gx','kx'};
plot_style = {'c.','m.','b.','g.','k.'};
for u=1:Nuser
%timestamp_tx = [est(u,:).timestamp_tx];
%timestamp_tx = timestamp_tx - 4.476e5;
framestamp_tx = [est(u,:).framestamp_tx];
err_ind = [est(u,:).err_ind];
fer = sum(reshape(err_ind,100,[]),1);
plot(framestamp_tx(1:100:end),fer,plot_style{u});
hold on
% plot(framestamp_tx(err_ind),mean(rx_rssi_dBm(:,err_ind),1),'rx');
end
hold off
xlabel('Frame')
ylabel('FER')
%xlim([min(framestamp_is),max(framestamp_is)])
%xlim([framestamp_is(max_start),framestamp_is(max_start+max_length)]);
legend('User 1','User 2','User 3','User 4')
saveas(h_fig, 'fer_time.eps', 'psc2');
%% plot the maps
for u = 1:Nuser;
lat = [gps_data(u,:).latitude];
lon = [gps_data(u,:).longitude];
%%
rx_rssi_dBm = [est(u,:).rx_rssi_dBm];
h_fig = figure;
plot_gps_coordinates_sophia(mm,lon,lat,mean(rx_rssi_dBm(:,1:100:end),1));
title('Rx RSSI (dBm)')
saveas(h_fig,sprintf('rx_rssi_term%d.jpg',u))
%%
rx_snr = [est(u,:).rx_power] - [est(u,:).n0_power];
h_fig = figure;
plot_gps_coordinates_sophia(mm,lon,lat,mean(rx_snr(:,1:100:end),1));
title('Rx SNR (dB)')
saveas(h_fig,sprintf('rx_snr_term%d.jpg',u))
%%
% err_ind = [0 diff([est.pdu_errors])];
% err_ind(err_ind<0) = 0;
% err_ind(err_ind>1) = 1;
% err_100 = sum(reshape(err_ind,100,[]),1);
err_ind_all = [est(u,:).err_ind];
err_100 = sum(reshape(err_ind_all,100,[]),1);
h_fig = figure;
plot_gps_coordinates_sophia(mm,lon,lat,err_100(1:end));
title('Rx FER (%)')
saveas(h_fig,sprintf('rx_fer_term%d.jpg',u))
end