gr-projectCACHE is a GNU Radio module that combines, inter alia, novel caching strategies and polar codes for wireless communications. It uses its dedicated software library project_caching
.
-
Definitons location:
- Typestruct definitions:
- Defined in
DataDefinition.h
:cf_data, data_matrix, NODE, header_transmission, ...
- Defined in
- Class definitions:
PC
defined inPC.*
- Functions:
- Defined in
FuncsFromMain.*
:colorRienumeration()
- Defined in
Conversions.*
:- All
conv_*()
functions.
- All
- Defined in
PolarDec_b_impl.*
itself:update()
,snr()
,decode_header()
,reinitialize()
- Defined in
- Typestruct definitions:
-
Terminology note:
- PC_w : weak | PC_s : strong
- GRASP: Greedy Randomized Adaptive Search Procedure. Basically an optimization algorithm to solve a optimization problem when there is no mainstream method. The improvement comes with a local search \
No need to read more
- FIGURE TO BE DONE (draw.io)
- Initialization in private constructor (as usual), all variables declared in header
- Initialize fundamental types variables and arrays (int, bool, float,...)
- Initialize custom variables then construct Polar Codes (PC). The latter is done as follows:
PC_w.constructPC()
construct Weak PC. Consists of 3 functions:initPC(n,k,SNR)
. starts withsetPC(n,k,SNR)
constructGenMatrix()
Construct Generator Matrix. useskroneckerProduct()
arrangeBits()
. Based on Bhattacharyya parameter, need to look up.
- Construct Strong PC
PC_s
based onPC_w
from step 1. Consists of 4 functions:initPC(n,k,SNR)
. the same as the weaksetGenMatrix(PC_w.genMatrix)
Copies Generator Matrix ofPC_w
.setRn(PC_w.Rn)
Copies Permutation Vector ofPC_w
.setArrangedBits(PC_w.arragedBits)
Copies arranged bits ofPC_w
.- Note:
Z
array is just for computation, the actual arranged bits are inarragedBits[i]
(TYPO included).
- Note:
- Runtime (Inside
work()
)- Generation processes (and prints). They are executed once,
bool d_gen
makes sure of that. In the following order:generateData()
conflictGraphGenerator()
- if GRASP coloring is active:
graspGraphColoring()
colorRienumeration()
- If coloring is successful (i.e.
int d_n_col
> 0) we can start coding:codingData()
MaxBipartiteGraph()
codingDataPolar()
TX_PC_Pack()
: Generate packets to be transmitted and stores them ind_transmission[]
. Some notes:d_transmission[]
is a matrix and is NOT the output of the block.d_transmission1[]
is the actual output vector and is made of vectors fromd_transmission[]
- The packet
d_transmission1[]
contains the Header, the Strong/Weak 2 information bytes and the payload.
- Formatting and type conversions
- HW adaptation : Repeat the last packet to make sure that all the buffer is processed
- Add tags
- Check how many samples were produced in GR block output:
- If all the packets were transmitted,
use cleanVar()
& stop flowgraph. - If not, continue and produce the minimum between what's left of the generated packet or the GR block output buffer, i.e.
min(d_transmission1-d_offset,noutput_items)
- call
work()
function again (loop all over) and skip step 1 sinced_gen = false
.
- If all the packets were transmitted,
- Generation processes (and prints). They are executed once,
-
Functions:
calculate_output_stream_length()
return 0 ALWAYS ???update()
: Updatesd_y1
andd_y2
which are used insnr()
-
update(d_sSymb, in)
:d_sSymb
is actually input0 sizein[]
is input0 (pointer)
-
snr()
computation : -
LOGIC REMARK : returns first
int
argument ? and isn't affected to anything ? We don't care!
- COMPUTE REMARK : We could remove the
abs()
commands since we compute powers with even parity (2 and 4)
-
decode_header()
:- uses
conv_4QPSKsymb_to_int()
and type conversions for each reading step - read header length
- read ID demands
- ... READING UNFINISHED
- uses
reinitialize()
: Restore header and main variables
-
Initialization is the same as the Encoder, with more stuff:
- QUESTION : If
d_id_user < d_n_users
: readCacheInfo() ? Something about the last user ? (line 72) - Then Create & set directories
- QUESTION : If
-
Runtime inside
work()
:-
Initialize some local variables
-
Get
packet_num
tags- QUESTION : What are they used for ?
-
Estimate SNR. Executed in every call of
work()
. The steps are :- Run
update()
thensnr()
- SNR Averaging.
- Computation:
- IMG TO BE UPLOADED
- Used in cases {3,4,5} in the State Machine (SM) (and for debug print)
- Computation:
- Run
-
Demodulate 8 QPSK symbols (ID of the Header) :
- Run
conv_8QPSKsymb_to_int()
and compute Header IDd_id_spack
- Check packet nature based on Header ID and update SM (controlled by
d_case
):- If
d_id_spack == d_id_expected
, it means Rx packet was expected --> Successful transmission.- Respective SM cases
d_case = {1,2,3}
- Respective SM cases
- If
d_id_spack != d_id_expected
, it means Rx packet wasn't expected.- Respective SM cases
d_case = {0,4,5}
- Respective SM cases
- If
- Run
-
INVESTIGATE STATE MACHINE
-
Check Remaining packets
-
Repeat
-
\