Skip to content

Commit

Permalink
Added octave plotting functions that had been removed accidentally.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericps1 committed Oct 29, 2015
1 parent ae07c5c commit 40f136f
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 2 deletions.
Binary file modified CRTS-Manual.pdf
Binary file not shown.
45 changes: 45 additions & 0 deletions logs/octave/Plot_CR_NET_RX.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
% redefine time based on first time instant
net_rx_t = net_rx_t - net_rx_t(1);

% define parameters used to calculate instantaneous throughput
t_step = 0.01;
steps = ceil(net_rx_t(end)/t_step);
t = linspace(t_step, t_step*steps, steps);
net_throughput = zeros(1,steps);
j = 1;

% step through time calculating average throughput over the current step
for i = 1:steps
while(net_rx_t(j) < t(i))
net_throughput(i) = net_throughput(i) + 8*net_rx_bytes(j)/t_step;
j = j+1;
if(j == length(net_rx_t))
break;
end
end
if(j == length(net_rx_t))
break
end
end

% taking a moving average
MA_span = 1.0;
taps = round(MA_span/t_step);
net_throughput = filter(ones(1,taps)/taps, 1, [net_throughput zeros(1,taps)]);

% normalize samples at either end of the filter
for i=1:taps
net_throughput(i) = net_throughput(i)*(taps/i);
net_throughput(end-i+1) = net_throughput(end-i+1)*(taps/i);
end

% remove filter delay
net_throughput = net_throughput(1+floor(taps/2):end-ceil(taps/2));

% plot
figure;
plot(t,net_throughput);
title('Throughput vs. Time');
xlabel('Time (s)');
ylabel('Throughput (bps)');

73 changes: 73 additions & 0 deletions logs/octave/Plot_CR_PHY_RX.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
phy_rx_t = t - t(1);

figure;
stem(phy_rx_t,phy_rx_Control_valid);
title('Valid Control Messages');
xlabel('Time (s)');
ylabel('Valid Control');
ylim([-1 2]);

figure;
stem(phy_rx_t,phy_rx_Payload_valid);
title('Valid Payloads');
xlabel('Time (s)');
ylabel('Valid Payload');
ylim([-1 2]);

figure;
plot(phy_rx_t,phy_rx_EVM);
title('Error Vector Magnitide');
xlabel('Time (s)');
ylabel('EVM (dB)');

figure;
plot(phy_rx_t,phy_rx_RSSI);
title('Received Signal Strength Indicator');
xlabel('Time (s)');
ylabel('RSSI (dB)');

figure;
plot(phy_rx_t,phy_rx_CFO);
title('Carrier Frequency Offset');
xlabel('Time (s)');
ylabel('CFO (f/fs)');

figure;
plot(phy_rx_t,phy_rx_num_syms);
title('Number of Frame Symbols');
xlabel('Time (s)\");');
ylabel('Number of Frame Symbols');

figure;
plot(phy_rx_t,phy_rx_mod_scheme);
title('Modulation Scheme');
xlabel('Time (s)');
ylabel('Modulation Scheme');
ylim([25 30]);
labels = {'Unknown','PSK2','PSK4','PSK8','PSK16','PSK32','PSK64','PSK128','PSK256','DPSK2','DPSK4','DPSK8','DPSK16','DPSK32','DPSK64','DPSK128','DPSK256','ASK2','ASK4','ASK8','ASK16','ASK32','ASK64','ASK128','ASK256','QAM4', 'QAM16', 'QAM32', 'QAM64', 'QAM128', 'QAM256','APSK2','APSK4','APSK8','APSK16','APSK32','APSK64','APSK128','APSK256','BPSK','QPSK','OOK','SQAM32','SQAM128','V29','Optimal QAM16','Optimal QAM32','Optimal QAM64','Optimal QAM128','Optimal QAM256','VT Logo'};
set(gca, 'YTick', 0:52, 'YTickLabel', labels);

figure;
plot(phy_rx_t,phy_rx_BPS);
title('Bits Per Symbol');
xlabel('Time (s)');
ylabel('Bits Per Symbol');
ylim([0, max(phy_rx_BPS)+1]);

figure;
plot(phy_rx_t,phy_rx_fec0);
title('Inner Forward Error Correction');
xlabel('Time (s)');
ylabel('FEC Scheme');
labels = {'Unknown','None','Repeat (1/3)','Repeat(1/5)','Hamming (7/4)','Hamming (8/4)','Hamming (12/8)','Golay (24/12)','SEC-DED (22/16)','SEC-DED (22/16)','SEC-DED (39/32)','SEC-DED72/64)','Convultional (1/2,7)','Convolutional (1/2,9)','Convolutional (1/3,9)','Convolutional (1/6,15)','Convolutional (2/3,7)','Convolutional (3/4,7)','Convolutional (4/5,7)','Convolutional (5/6,7)','Convolutional(6/7,7)','Convolutional (7/8,7)','Convolutional (2/3,9)','Convolutional (3/4,9)','Convolutional (4/5,9)','Convolutional (5/6,9)','Convolutional(6/7,9)','Convolutional(7/8,9)','Reed-Solomon (8)'};
set(gca, 'YTick', 0:28, 'YTickLabel', labels);

figure;
plot(phy_rx_t,phy_rx_fec1);
title('Outter Forward Error Correction');
xlabel('Time (s)');
ylabel('FEC Scheme');
labels = {'Unknown','None','Repeat (1/3)','Repeat(1/5)','Hamming (7/4)','Hamming (8/4)','Hamming (12/8)','Golay (24/12)','SEC-DED (22/16)','SEC-DED (22/16)','SEC-DED (39/32)','SEC-DED72/64)','Convultional (1/2,7)','Convolutional (1/2,9)','Convolutional (1/3,9)','Convolutional (1/6,15)','Convolutional (2/3,7)','Convolutional (3/4,7)','Convolutional (4/5,7)','Convolutional (5/6,7)','Convolutional(6/7,7)','Convolutional (7/8,7)','Convolutional (2/3,9)','Convolutional (3/4,9)','Convolutional (4/5,9)','Convolutional (5/6,9)','Convolutional(6/7,9)','Convolutional(7/8,9)','Reed-Solomon (8)'};
set(gca, 'YTick', 0:28, 'YTickLabel', labels);


93 changes: 93 additions & 0 deletions logs/octave/Plot_CR_PHY_TX.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
phy_tx_t = phy_tx_t - phy_tx_t(1);

figure;
plot(phy_tx_t, phy_tx_numSubcarriers);
title('Number of subcarriers');
xlabel('Time (s)');
ylabel('Number of Subcarriers');

figure;
plot(phy_tx_t, phy_tx_cp_len);
title('Length of Cyclic Prefix');
xlabel('Time (s)');
ylabel('Samples');

figure;
plot(phy_tx_t, phy_tx_taper_len);
title('Taper Length');
xlabel('Time (s)');
ylabel('Samples');

figure;
plot(phy_tx_t, phy_tx_gain_uhd);
title('Tx USRP Gain');
xlabel('Time (s)');
ylabel('Gain (dB)');

figure;
plot(phy_tx_t, phy_tx_gain_soft);
title('Tx Soft Gain');
xlabel('Time (s)');
ylabel('Gain (dB)');

figure;
plot(phy_tx_t, phy_tx_lo_freq);
title('Tx Center Frequency');
xlabel('Time (s)');
ylabel('Frequency (Hz)');
if(max(phy_tx_freq)-min(phy_tx_freq) > 0)
ylim([2*min(phy_tx_freq)-max(phy_tx_freq), 2*max(phy_tx_freq)-min(phy_tx_freq)]);
end

figure;
plot(phy_tx_t, phy_tx_lo_freq);
title('Tx LO Frequency');
xlabel('Time (s)');
ylabel('Frequency (Hz)');
if(max(phy_tx_lo_freq)-min(phy_tx_lo_freq) > 0)
ylim([2*min(phy_tx_lo_freq)-max(phy_tx_lo_freq), 2*max(phy_tx_lo_freq)-min(phy_tx_lo_freq)]);
end

figure;
plot(phy_tx_t, phy_tx_dsp_freq);
title('Tx DSP Frequency');
xlabel('Time (s)');
ylabel('Frequency (Hz)');
if(max(phy_tx_dsp_freq)-min(phy_tx_dsp_freq) > 0)
ylim([2*min(phy_tx_dsp_freq)-max(phy_tx_dsp_freq), 2*max(phy_tx_dsp_freq)-min(phy_tx_dsp_freq)]);
end

figure;
plot(phy_tx_t, phy_tx_rate);
title('Tx Rate');
xlabel('Time (s)');
ylabel('Tx Rate (Hz)');

figure;
plot(phy_tx_t, phy_tx_mod_scheme);
title('Modulation Scheme');
xlabel('Time (s)');
ylabel('Modulation Scheme');
labels = {'Unknown','PSK2','PSK4','PSK8','PSK16','PSK32','PSK64','PSK128','PSK256','DPSK2','DPSK4','DPSK8','DPSK16','DPSK32','DPSK64','DPSK128','DPSK256','ASK2','ASK4','ASK8','ASK16','ASK32','ASK64','ASK128','ASK256','QAM4', 'QAM16', 'QAM32', 'QAM64', 'QAM128', 'QAM256','APSK2','APSK4','APSK8','APSK16','APSK32','APSK64','APSK128','APSK256','BPSK','QPSK','OOK','SQAM32','SQAM128','V29','Optimal QAM16','Optimal QAM32','Optimal QAM64','Optimal QAM128','Optimal QAM256','VT Logo'};
set(gca, 'YTick', 0:52, 'YTickLabel', labels);

figure;
plot(phy_tx_t,phy_tx_fec0);
title('Inner Forward Error Correction');
xlabel('Time (s)');
ylabel('FEC Scheme');
labels = {'Unknown','None','Repeat (1/3)','Repeat(1/5)','Hamming (7/4)','Hamming (8/4)','Hamming (12/8)','Golay (24/12)','SEC-DED (22/16)','SEC-DED (39/32)','SEC-DED72/64)','Convultional (1/2,7)','Convolutional (1/2,9)','Convolutional (1/3,9)','Convolutional (1/6,15)','Convolutional (2/3,7)','Convolutional (3/4,7)','Convolutional (4/5,7)','Convolutional (5/6,7)','Convolutional(6/7,7)','Convolutional (7/8,7)','Convolutional (2/3,9)','Convolutional (3/4,9)','Convolutional (4/5,9)','Convolutional (5/6,9)','Convolutional(6/7,9)','Convolutional(7/8,9)','Reed-Solomon (8)'};
set(gca, 'YTick', 0:28, 'YTickLabel', labels);
ylim([0 28]);

figure;
plot(phy_tx_t,phy_tx_fec1);
title('Outter Forward Error Correction');
xlabel('Time (s)');
ylabel('FEC Scheme');
labels = {'Unknown','None','Repeat (1/3)','Repeat(1/5)','Hamming (7/4)','Hamming (8/4)','Hamming (12/8)','Golay (24/12)','SEC-DED (22/16)','SEC-DED (39/32)','SEC-DED (72/64)','Convultional (1/2,7)','Convolutional (1/2,9)','Convolutional (1/3,9)','Convolutional (1/6,15)','Convolutional (2/3,7)','Convolutional (3/4,7)','Convolutional (4/5,7)','Convolutional (5/6,7)','Convolutional(6/7,7)','Convolutional (7/8,7)','Convolutional (2/3,9)','Convolutional (3/4,9)','Convolutional (4/5,9)','Convolutional (5/6,9)','Convolutional(6/7,9)','Convolutional(7/8,9)','Reed-Solomon (8)'};
set(gca, 'YTick', 0:28, 'YTickLabel', labels);
ylim([0 28]);



10 changes: 10 additions & 0 deletions logs/octave/Plot_Interferer_TX.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Int_tx_t = Int_tx_t - Int_tx_t(1);

figure;
plot(Int_tx_t,Int_tx_freq);
title('Transmit Frequency');
xlabel('Time (s)');
ylabel('Frequency (Hz)');
ylim([2*min(Int_tx_freq)-max(Int_tx_freq), 2*max(Int_tx_freq)-min(Int_tx_freq)]);


4 changes: 2 additions & 2 deletions tutorials/tutorial_1.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the master\_scenario\_file.cfg file. This file tells the experiment controller
how many scenarios to run and their names. Make the values match:

NumberofScenarios = 1;
scenario\_1 = "2_Node_FDD_Network.cfg";
scenario\_1 = "Two_Node_FDD_Network.cfg";
reps\_scenario\_1 = 1;

Now open the scenario configuration file 2\_Node\_FDD\_Network.cfg This file
Expand Down Expand Up @@ -46,5 +46,5 @@ Go to /logs/octave and you should see several auto-generated .m files. To view
a plot of the network throughput vs. time for each node run:

$ octave
> 2_Node_FDD_Network_N1_NET_RX
> Two_Node_FDD_Network_N1_NET_RX
> Plot_CR_NET_RX

0 comments on commit 40f136f

Please sign in to comment.