uninterleaver.m

来自「WCDMA系统信号交织与接收解交织部分」· M 代码 · 共 21 行

M
21
字号
function source_out=uninterleaver(source_in)
%rem是求余数
%按列写,按行读
global   INTERLEAVERLENGTH
len=length(source_in);

cols=fix((len-1)/INTERLEAVERLENGTH) + 1; %一帧转成列矩阵后的列数
theLastRowOfLastCol= rem( len -1 ,INTERLEAVERLENGTH) +1;  %最后一列的最后一行

for n=1:len
    if n> cols * theLastRowOfLastCol
        theRow=theLastRowOfLastCol + fix((n - cols * theLastRowOfLastCol -1)/(cols -1)) +1;
        theCol=rem(n- cols * theLastRowOfLastCol -1 ,cols -1 ) +1 ;
    else
        theRow=fix((n-1)/cols) +1;
        theCol=rem(n-1,cols) +1;
    end
    source_out((theCol-1)*INTERLEAVERLENGTH + theRow)= source_in( n);
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?