Agora  1.2.0
Agora project
parsedata_ul.m File Reference

Functions

Pilot RX by socket threads (=reference time)
 
 fprintf ("Average delay between rx thread and main thread: %.2f\n",... mean(pilot_recv(subset)))
 
 fprintf ("In functions: CSI: %.2f, ZF: %.2f, FFT + Demul + Decode: %.2f+%.2f+%.2f=%.2f, total: %.2f\n",... mean(csi_time_in_function(subset)),... mean(zf_time_in_function(subset)), mean(fft_time_in_function(subset)),... mean(demul_time_in_function(subset)), mean(decode_time_in_function(subset)),... mean(fft_time_in_function(subset))+mean(demul_time_in_function(subset))+mean(decode_time_in_function(subset)),... mean(csi_time_in_function(subset))+mean(fft_time_in_function(subset))+mean(zf_time_in_function(subset))+mean(demul_time_in_function(subset))+mean(decode_time_in_function(subset)))
 
 fprintf ("In main thread: queueing delay: %.2f, FFT of pilots done: %.2f, ZF done: %.2f, Decode done: %.2f, total: %.2f\n",... avg_proc_start, avg_fft_duration, avg_zf_duration,... avg_decode_duration, avg_proc_duration)
 
 fprintf ("Frame duration: %.2f, RX duration: %.5f, Processing delay: %.5f\n", avg_frame_duration, avg_rx_duration, avg_proc_duration-avg_rx_duration)
 
 fprintf ("Pilot RX duration: %.2f\n", mean(pilot_rx_duration(subset)))
 
 fprintf ("Process delay 99th: %.2f, ZF delay 99th: %.3f\n", proc_delay_99th, zf_delay_99th)
 
 fprintf ("Process delay mean: %.2f (std: %.2f), ZF delay mean: %.2f\n", avg_proc_delay, std_proc_delay, avg_zf_duration)
 
 fprintf ("UL processing duration: %.2f, std: %.2f\n", mean(frame_duration_decode(subset)), std(frame_duration_decode(subset)))
 
 figure (1)
 
 plot (fft_duration(1:frame_count), 'LineWidth', 2)
 
 plot (fft_time_in_function(subset), 'LineWidth', 2)
 
 plot (zf_time_in_function(subset), 'LineWidth', 2)
 
 plot (demul_time_in_function(subset), 'LineWidth', 2)
 
 plot (zf_duration(subset), 'LineWidth', 2)
 
 set (gca, 'FontSize', 18)
 
 xlabel ('Frame id')
 
 ylabel ('Duration(us)')
 
 legend ({ 'FFT in function', 'ZF in function', 'Demodulation in function', 'ZF'})
 
 figure (2)
 
 plot (frame_duration_fft(subset), 'LineWidth', 2)
 
 plot (frame_duration_zf(subset), 'LineWidth', 2)
 
 plot (frame_duration_demul(subset), 'LineWidth', 2)
 
 plot (frame_duration_rx(subset), 'LineWidth', 2)
 
 plot (frame_duration_decode(subset), 'LineWidth', 2)
 
 legend ({ 'FFT of pilots', 'ZF', 'Demodulation', 'RX', "Deocde"})
 
 figure (4)
 
 plot (process_delay(1:frame_count), 'LineWidth', 2)
 
 ylabel ('Delay(us)')
 
 title ('Processing delay') figure(5)
 
 set (h1, 'LineWidth', 2)
 
 xlabel ('Delay(us)')
 
 plot (pilot_recv(1:end) -frame_start(1:end), 'LineWidth', 2)
 
 ylabel ('Time(us)')
 
 title ('Delay between main thread and rx thread') % figure(8)
 
 xlabel ('Time(us)')
 
 fprintf ("In emulator: TX duration %.5f\n", avg_tx_duration)
 
 figure (6)
 
 plot (frame_duration_tx(subset), 'LineWidth', 24)
 
 set (gca, 'FontSize', 24)
 
 title ('TX duration')
 
 figure (3)
 
 set (h2, 'LineWidth', 2)
 
 set (h3, 'LineWidth', 2, 'LineStyle', '--', 'Color', 'k')
 
 xlabel ('Duration(us)')
 
 legend ({sprintf('RX duration(avg:%.2f us)', avg_rx_duration),... sprintf('Demul done(avg:%.2f us)', avg_demul_duration),... sprintf('Decode done(avg:%.2f us)',... avg_proc_duration)}, 'Location', 'southeast')
 
 plot (x_proc_delay, myccdf)
 
 set (gca, 'YScale', 'log')
 

Variables

 fid = fopen('../files/experiment/timeresult.txt')
 
Pilot RX by socket kPilotRX
 
Pilot RX by socket kProcessingStarted
 
Pilot RX by socket kPilotAllRX
 
Pilot RX by socket kFFTDone
 
Pilot RX by socket kZFDone
 
Pilot RX by socket kDemulDone
 
Pilot RX by socket kDecodeDone
 
Pilot RX by socket kRXDone
 
Pilot RX by socket time in CSI
 
Pilot RX by socket time in time in FFT
 
Pilot RX by socket time in time in time in ZF
 
Pilot RX by socket time in time in time in time in Demul
 
Pilot RX by socket time in time in time in time in time in Decode temp = textscan(fid,"%f%f%f%f%f%f%f%f%f%f%f%f%f%f", 'HeaderLines',2)
 
 frame_start = temp{1}
 
 pilot_recv =temp{2}
 
 process_start = temp{3}
 
 all_pilot_received = temp{4}
 
 fft_processed = temp{5}
 
 zf_processed = temp{6}
 
 demul_processed = temp{7}
 
 decode_processed = temp{8}
 
 rx_processed = temp{9}
 
 demul_duration = demul_processed-zf_processed
 
 zf_duration = zf_processed-fft_processed
 
 fft_duration = fft_processed
 
 decode_duration = decode_processed - zf_duration
 
 frame_duration_rx = rx_processed
 
 frame_duration_fft = fft_processed
 
 frame_duration_demul = demul_processed
 
 frame_duration_decode = decode_processed
 
 frame_duration_zf = zf_processed
 
 frame_duration = diff(frame_start)
 
 frame_count = length(demul_processed)
 
 pilot_rx_duration = all_pilot_received
 
 queueing_delay = process_start
 
 frame_duration_processing = max([frame_duration,frame_duration_decode(1:end-1)],[],2)
 
 csi_time_in_function = temp{10}
 
 fft_time_in_function = temp{11}
 
 zf_time_in_function = temp{12}
 
 demul_time_in_function = temp{13}
 
 decode_time_in_function = temp{14}
 
 index = [1:frame_count]
 
 subset = index(500:frame_count-2)
 
 avg_frame_duration = mean(frame_duration(subset))
 
 avg_rx_duration = mean(frame_duration_rx(subset))
 
 avg_demul_duration = mean(frame_duration_demul(subset))
 
 avg_proc_duration = mean(frame_duration_decode(subset))
 
 std_proc_duration = std(frame_duration_decode(subset))
 
 avg_proc_start = mean(process_start(subset))
 
 avg_zf_duration = mean(zf_duration(subset))
 
 avg_fft_duration = mean(fft_duration(subset))
 
 avg_decode_duration = mean(decode_duration(subset))
 
 process_delay = demul_processed-rx_processed
 
 avg_proc_delay = mean(process_delay(subset))
 
 std_proc_delay = std(process_delay(subset))
 
 x_set = x_proc_delay(f_proc_delay>0.99)
 
 proc_delay_99th = x_set(1)
 
 zf_delay_99th = x_set(1)
 
 clf
 
hold on
 
 h1 = cdfplot(process_delay(subset))
 
 frame_ends =temp{1}
 
 frame_duration_tx = diff(frame_ends)
 
 avg_tx_duration = mean(frame_duration_tx(1200:length(frame_duration_tx)-1))
 
 frame_duration_rx1 = diff(frame_start)
 
 h2 =cdfplot(frame_duration_demul(subset))
 
 h3 =cdfplot(frame_duration_tx(1200:length(frame_duration_tx)-1))
 
 tail_proc_duration = x_set(1)
 
 median_proc_duration = x_set(1)
 
 myccdf = 1-f_proc_delay
 

Function Documentation

◆ figure() [1/5]

figure ( )

◆ figure() [2/5]

figure ( )

◆ figure() [3/5]

figure ( )

◆ figure() [4/5]

figure ( )

◆ figure() [5/5]

figure ( )

◆ fprintf() [1/9]

fprintf ( "Average delay between rx thread and main thread: %.2f\n ,
...   meanpilot_recv(subset) 
)

◆ fprintf() [2/9]

fprintf ( "Frame duration: %.  2f,
RX duration:%.  5f,
Processing delay:%.5f\n ,
avg_frame_duration  ,
avg_rx_duration  ,
avg_proc_duration avg_rx_duration 
)

◆ fprintf() [3/9]

fprintf ( "In emulator: TX duration %.5f\n ,
avg_tx_duration   
)

◆ fprintf() [4/9]

fprintf ( "In functions: CSI: %.  2f,
ZF:%.  2f,
FFT+Demul+Decode:%.2f+%.2f+%.  2f = %.2f,
total:%.2f\n ,
...   meancsi_time_in_function(subset),
...   meanzf_time_in_function(subset),
mean(fft_time_in_function(subset))  ,
...   meandemul_time_in_function(subset),
mean(decode_time_in_function(subset))  ,
...   meanfft_time_in_function(subset))+mean(demul_time_in_function(subset))+mean(decode_time_in_function(subset),
...   meancsi_time_in_function(subset))+mean(fft_time_in_function(subset))+mean(zf_time_in_function(subset))+mean(demul_time_in_function(subset))+mean(decode_time_in_function(subset) 
)

◆ fprintf() [5/9]

fprintf ( "In main thread: queueing delay: %.  2f,
FFT of pilots done:%.  2f,
ZF done:%.  2f,
Decode done:%.  2f,
total:%.2f\n ,
  avg_proc_start,
avg_fft_duration  ,
avg_zf_duration  ,
  avg_decode_duration,
avg_proc_duration   
)

◆ fprintf() [6/9]

fprintf ( "Pilot RX duration: %.2f\n ,
mean(pilot_rx_duration(subset))   
)

◆ fprintf() [7/9]

fprintf ( "Process delay 99th: %.  2f,
ZF delay 99th:%.3f\n ,
proc_delay_99th  ,
zf_delay_99th   
)

◆ fprintf() [8/9]

fprintf ( "Process delay mean: %.2f   std: %.2f,
ZF delay mean:%.2f\n ,
avg_proc_delay  ,
std_proc_delay  ,
avg_zf_duration   
)

◆ fprintf() [9/9]

fprintf ( "UL processing duration: %.  2f,
std:%.2f\n ,
mean(frame_duration_decode(subset))  ,
std(frame_duration_decode(subset))   
)

◆ legend() [1/3]

legend ( { 'FFT in function', 'ZF in function', 'Demodulation in function', 'ZF'}  )

◆ legend() [2/3]

legend ( { 'FFT of pilots', 'ZF', 'Demodulation', 'RX', "Deocde"}  )

◆ legend() [3/3]

legend ( {sprintf('RX duration(avg:%.2f us)', avg_rx_duration),... sprintf('Demul done(avg:%.2f us)', avg_demul_duration),... sprintf('Decode done(avg:%.2f us)',... avg_proc_duration)}  ,
'Location'  ,
'southeast'   
)

◆ plot() [1/14]

plot ( demul_time_in_function(subset ,
'LineWidth'  ,
 
)

◆ plot() [2/14]

plot ( fft_duration(1:frame_count ,
'LineWidth'  ,
 
)

◆ plot() [3/14]

plot ( fft_time_in_function(subset ,
'LineWidth'  ,
 
)

◆ plot() [4/14]

plot ( frame_duration_decode(subset ,
'LineWidth'  ,
 
)

◆ plot() [5/14]

plot ( frame_duration_demul(subset ,
'LineWidth'  ,
 
)

◆ plot() [6/14]

plot ( frame_duration_fft(subset ,
'LineWidth'  ,
 
)

◆ plot() [7/14]

plot ( frame_duration_rx(subset ,
'LineWidth'  ,
 
)

◆ plot() [8/14]

plot ( frame_duration_tx(subset ,
'LineWidth'  ,
24   
)

◆ plot() [9/14]

plot ( frame_duration_zf(subset ,
'LineWidth'  ,
 
)

◆ plot() [10/14]

plot ( pilot_recv(1:end) -frame_start(1:end)  ,
'LineWidth'  ,
 
)

◆ plot() [11/14]

plot ( process_delay(1:frame_count ,
'LineWidth'  ,
 
)

◆ plot() [12/14]

plot ( x_proc_delay  ,
myccdf   
)

◆ plot() [13/14]

plot ( zf_duration(subset ,
'LineWidth'  ,
 
)

◆ plot() [14/14]

plot ( zf_time_in_function(subset ,
'LineWidth'  ,
 
)

◆ set() [1/6]

set ( gca  ,
'FontSize ,
18   
)

◆ set() [2/6]

set ( gca  ,
'FontSize ,
24   
)

◆ set() [3/6]

set ( gca  ,
'YScale'  ,
'log'   
)

◆ set() [4/6]

set ( h1  ,
'LineWidth'  ,
 
)

◆ set() [5/6]

set ( h2  ,
'LineWidth'  ,
 
)

◆ set() [6/6]

set ( h3  ,
'LineWidth'  ,
,
'LineStyle'  ,
'--'  ,
'Color'  ,
'k'   
)

◆ threads()

Pilot RX by socket threads ( )

◆ title() [1/3]

title ( 'Delay between main thread and rx thread'  )

◆ title() [2/3]

title ( 'Processing delay'  )

◆ title() [3/3]

title ( 'TX duration'  )

◆ xlabel() [1/4]

xlabel ( 'Delay(us)'  )

◆ xlabel() [2/4]

xlabel ( 'Duration(us)'  )

◆ xlabel() [3/4]

xlabel ( 'Frame id )

◆ xlabel() [4/4]

xlabel ( 'Time(us)'  )

◆ ylabel() [1/3]

ylabel ( 'Delay(us)'  )

◆ ylabel() [2/3]

ylabel ( 'Duration(us)'  )

◆ ylabel() [3/3]

ylabel ( 'Time(us)'  )

Variable Documentation

◆ all_pilot_received

all_pilot_received = temp{4}

◆ avg_decode_duration

avg_decode_duration = mean(decode_duration(subset))

◆ avg_demul_duration

avg_demul_duration = mean(frame_duration_demul(subset))

◆ avg_fft_duration

avg_fft_duration = mean(fft_duration(subset))

◆ avg_frame_duration

avg_frame_duration = mean(frame_duration(subset))

◆ avg_proc_delay

avg_proc_delay = mean(process_delay(subset))

◆ avg_proc_duration

avg_proc_duration = mean(frame_duration_decode(subset))

◆ avg_proc_start

avg_proc_start = mean(process_start(subset))

◆ avg_rx_duration

avg_rx_duration = mean(frame_duration_rx(subset))

◆ avg_tx_duration

avg_tx_duration = mean(frame_duration_tx(1200:length(frame_duration_tx)-1))

◆ avg_zf_duration

avg_zf_duration = mean(zf_duration(subset))

◆ clf

clf

◆ CSI

Pilot RX by socket time in CSI

◆ csi_time_in_function

csi_time_in_function = temp{10}

◆ decode_duration

decode_duration = decode_processed - zf_duration

◆ decode_processed

decode_processed = temp{8}

◆ decode_time_in_function

decode_time_in_function = temp{14}

◆ Demul

Pilot RX by socket time in time in time in time in Demul

◆ demul_duration

demul_duration = demul_processed-zf_processed

◆ demul_processed

demul_processed = temp{7}

◆ demul_time_in_function

demul_time_in_function = temp{13}

◆ FFT

Pilot RX by socket time in time in FFT

◆ fft_duration

fft_duration = fft_processed

◆ fft_processed

fft_processed = temp{5}

◆ fft_time_in_function

fft_time_in_function = temp{11}

◆ fid

fid = fopen('../files/experiment/timeresult.txt')

◆ frame_count

frame_count = length(demul_processed)

◆ frame_duration

frame_duration = diff(frame_start)

◆ frame_duration_decode

frame_duration_decode = decode_processed

◆ frame_duration_demul

frame_duration_demul = demul_processed

◆ frame_duration_fft

frame_duration_fft = fft_processed

◆ frame_duration_processing

frame_duration_processing = max([frame_duration,frame_duration_decode(1:end-1)],[],2)

◆ frame_duration_rx

frame_duration_rx = rx_processed

◆ frame_duration_rx1

frame_duration_rx1 = diff(frame_start)

◆ frame_duration_tx

frame_duration_tx = diff(frame_ends)

◆ frame_duration_zf

frame_duration_zf = zf_processed

◆ frame_ends

frame_ends =temp{1}

◆ frame_start

frame_start = temp{1}

◆ h1

h1 = cdfplot(process_delay(subset))

◆ h2

◆ h3

◆ index

index = [1:frame_count]

◆ kDecodeDone

Pilot RX by socket kDecodeDone

◆ kDemulDone

Pilot RX by socket kDemulDone

◆ kFFTDone

Pilot RX by socket kFFTDone

◆ kPilotAllRX

Pilot RX by socket kPilotAllRX

◆ kPilotRX

Pilot RX by socket kPilotRX

◆ kProcessingStarted

Pilot RX by socket kProcessingStarted

◆ kRXDone

Pilot RX by socket kRXDone

◆ kZFDone

Pilot RX by socket kZFDone

◆ median_proc_duration

median_proc_duration = x_set(1)

◆ myccdf

myccdf = 1-f_proc_delay

◆ on

grid on

◆ pilot_recv

pilot_recv =temp{2}

◆ pilot_rx_duration

pilot_rx_duration = all_pilot_received

◆ proc_delay_99th

proc_delay_99th = x_set(1)

◆ process_delay

process_delay = demul_processed-rx_processed

◆ process_start

process_start = temp{3}

◆ queueing_delay

queueing_delay = process_start

◆ rx_processed

rx_processed = temp{9}

◆ std_proc_delay

std_proc_delay = std(process_delay(subset))

◆ std_proc_duration

std_proc_duration = std(frame_duration_decode(subset))

◆ subset

subset = index(500:frame_count-2)

◆ tail_proc_duration

tail_proc_duration = x_set(1)

◆ temp

temp = textscan(fid,"%f%f%f%f%f%f%f%f%f%f%f%f%f%f", 'HeaderLines',2)

◆ x_set

x_set = x_proc_delay(f_proc_delay>0.99)

◆ ZF

Pilot RX by socket time in time in time in ZF

◆ zf_delay_99th

zf_delay_99th = x_set(1)

◆ zf_duration

zf_duration = zf_processed-fft_processed

◆ zf_processed

zf_processed = temp{6}

◆ zf_time_in_function

zf_time_in_function = temp{12}