⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interleaver.m

📁 WCDMA系统信号交织与接收解交织部分
💻 M
字号:
function source_out=interleaver(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        
    theCol=fix((n-1)/INTERLEAVERLENGTH) +1 ;
    theRow=rem(n-1,INTERLEAVERLENGTH) +1;
    if theRow>theLastRowOfLastCol
        index= theLastRowOfLastCol * cols  + (theRow - theLastRowOfLastCol -1) * (cols-1) + theCol;
    else
        index=(theRow -1) * cols + theCol;
    end
    source_out(index)= source_in(n);
end

⌨️ 快捷键说明

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