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

📄 wcdmasecondinterleaver.m

📁 WCDMA model in symulink model in matlab
💻 M
字号:
function int_table = WcdmaSecondInterleaver(numBits);
% Performs second interleaver as specified by 3GPP TS 25.212.

% Inter-column permutation pattern for 2nd interleaver
perm = [0 20 10 5 15 25 3 13 23 8 18 28 1 11 21 6 16 26 4 14 24 19 9 29 12 2 7 22 27 17];
perm = perm + 1;

% Assign number of Columns C2
nCols = 30;

% Determine the number of rows R2 of the matrix
nRows = ceil(numBits/nCols);

% Pad input bits with zeros
inputSeq = [1:numBits];
nZeros = nCols*nRows - numBits;
inputSeq = [inputSeq zeros(1,nZeros)];

% Write the input bit sequence into R2xC2 matrix row-by-row
inMatrix = reshape(inputSeq', nCols, nRows)';

% Perform the inter-column permutation
outMatrix = inMatrix(:,perm);

% Read the bit sequence of the block interleaver column-by-column
int_table = reshape(outMatrix, 1, nRows*nCols)';

% Perform Zero pruning
int_table = int_table(find(int_table ~= 0));

⌨️ 快捷键说明

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