前几个月在工作中接触并了O-RAN.WG4协议,完成了Fronthaul传输中的compression和decompression部分,在研究传输代码后有了新的理解。
直接进入正题:
首先压缩针对的是位于U-Plane的每个PRB,包含12个I和12个Q数据,压缩时对原本数据进行处理,原本数据一般是带符号16位数据(int16)。传入时只会包含数据,压缩配置由M-Plane或者C-Plane给出,包括压缩位宽和压缩方式,记录于CompHdr中。
压缩位宽:每个PRB包含的12对IQ数据共12216bits,合48bytes。压缩时将数据转化为浮点和相应规则下的无符号尾数的形式,O-RAN协议支持位宽9bits,12bits,14bits,OTIC协议支持8bits,具体压缩位宽根据对接对象确定。8bits其实是比较符合数据的传输方式,不会产生1byte不够需要位操作的情况。
压缩模式:一共支持6种压缩模式,一般采用前三种模式(Block Floating Point ,Block Scaling ,μ-Law Compression )后三种应用较少(Beamspace Compression ,Modulation Compression ,Selective RE sending Compression )。因此本文主要记录前三种压缩模式的学习历程。一般的,越复杂的压缩算法精度的损失越小,相对产生的运算时间月常,在极大吞吐量的Fronthaul接口下,效率低的算法可能不能满足即时发送的需求,而对于前三种压缩模式通常采用最简单,速度最快的Block Floating Point 在可以满足精度需要的情况下成为首选。
Block Floating Point Compression
将数据压缩成带符号浮点和定长无符号尾数的方法,每个PRB有相同的尾数,取相同的精度,尾数由整体PRB最大值决定,同PRB中较小的数据将可能损失极大精度。
Inputs:
• fPRB - Original physical resource block (PRB), 12 complex resource elements with “native” word length of
the implementation e.g. 24 bits (UL should use as accurate value as possible from FFT & beamforming)
• iqWidth - Word length after compression (includes sign bit)
Outputs:
• cPRB - Compressed PRB, 12 complex resource elements with word length iqWidth
• exponent - Common exponent for compressed PRB
// Find max and min
maxV = max(Re(fPRB), Im(fPRB)), minV = min(Re(fPRB), Im(fPRB))
// Determine max absolute value
maxValue = max(maxV, |minV|-1) (msb of negative value can be one higher)
// Calculate exponent
raw_exp = [floor(log2(maxValue) +1)] (msb of maxValue)
// Calculate shift value and limit to positive
exponent = max(r