亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? setparitycheckmatrix.m

?? matlab最新LDPC源碼,不太好懂.請各位高手指點迷津~
?? M
字號:
function H = setParityCheckMatrix(h, H)
%SETPARITYCHECKMATRIX  Set parity check matrix of an LDPC encoder object.

%   Copyright 2006 The MathWorks, Inc.
%   $Revision: 1.1.6.2 $  $Date: 2006/06/23 19:24:48 $

if ~issparse(H)
    error('comm:ldpcenc:NonSparseParityCheckMatrix', ...
          'The parity-check matrix must be a sparse matrix.');
end

N = size(H,2);
K = N - size(H,1);

if N <= 0
    error('comm:ldpcenc:InvalidNumColumns', ...
          'The parity-check matrix must have at least one column.');
end

if K <= 0
    error('comm:ldpcenc:TooFewColumns', ...
          'The parity-check matrix must have more columns than rows.');
end

if ~isempty(find(nonzeros(H)~=1, 1))
    error('comm:ldpcenc:NotZeroOneMatrix', ...
          'The parity-check matrix must be a zero-one matrix.');
end

if ~isempty(find(full(sum(H,1)==0), 1))
    error('comm:ldpcenc:EmptyColumn', ...
          'The parity-check matrix must have at least one nonzero element in each column.');
end

H = logical(H);    % Convert the parity-check matrix to a logical matrix to save memory.
PB = H(:,K+1:end); % Extract the last (N-K) columns of the parity-check matrix.

% Check if PB is triangular
switch isfulldiagtriangular(PB)
    case 1,
        Alg = 'Forward Substitution';   % PB is lower triangular and has a full diagonal.
        RowOrder = -1;                  % Don't need to reverse the order of rows in PB
    case -1,
        Alg = 'Backward Substitution';  % PB is upper triangular and has a full diagonal.
        RowOrder = -1;                  % Don't need to reverse the order of rows in PB
    case 0,
        % Reverse the order of rows in PB, but keep PB, since if PB is not
        % triangular, we need to factorize it in GF(2).
        Reversed_PB = PB(end:-1:1,:);
        switch isfulldiagtriangular(Reversed_PB) % Check if Reversed_PB is triangular.
            case 1,
                Alg = 'Forward Substitution';
                RowOrder = (N-K):-1:1;
                PB = Reversed_PB;
            case -1,
                Alg = 'Backward Substitution';
                RowOrder = (N-K):-1:1;
                PB = Reversed_PB;
            case 0,
                Alg = 'Matrix Inverse';
        end
end

% The following properties won't be used for forward/backward substitution.
% But the C-MEX function expects these inputs. So just provide dummy
% values by default.
h.MatrixL_RowIndices  = int32(0);
h.MatrixL_ColumnSum   = int32(0);
h.MatrixL_RowStartLoc = int32(0);

if strcmp(Alg, 'Forward Substitution')
    h.EncodingMethod = int8(1);
    P = tril(PB, -1);  % Remove the diagonal of PB and put it in P.
elseif strcmp(Alg, 'Backward Substitution')
    h.EncodingMethod = int8(-1);
    P = triu(PB, 1);   % Remove the diagonal of PB and put it in P.
else
    % If we reach this line, then Alg = 'Matrix Inverse',
    % i.e., the last (N-K) columns of the parity-check matrix (i.e. PB) is not triangular.
    % Let's try to factorize it in GF(2).
    % See the comments in gf2factorize for details about what it does.
    [PL PB RowOrder invertible] = gf2factorize(PB);
    if ~invertible
        error('comm:ldpcenc:NonInvertibleParityCheckMatrix', ...
              'The last (N-K) columns of the parity-check matrix must be invertible in GF(2).');
    else
        % PB is invertible in GF(2), and has been modified by gf2factorize.
        h.EncodingMethod = int8(0);
        [h.MatrixL_RowIndices h.MatrixL_RowStartLoc h.MatrixL_ColumnSum] = ConvertMatrixFormat(tril(PL, -1));
        PB = PB(RowOrder, :); % Need to do this before the next line.
        P = triu(PB, 1);      % Now PB is upper triangular. Remove the diagonal and put it in P.
    end
end

% Update all internal data structures for the encoding operation.
h.RowOrder = int32(RowOrder-1);
[h.MatrixA_RowIndices h.MatrixA_RowStartLoc h.MatrixA_ColumnSum] = ConvertMatrixFormat(H(:,1:K));
[h.MatrixB_RowIndices h.MatrixB_RowStartLoc h.MatrixB_ColumnSum] = ConvertMatrixFormat(P);

% Update all external properties.
h.StoredParityCheckMatrix = H;  % For the property ParityCheckMatrix
h.BlockLength = N;
h.NumInfoBits = K;
h.NumParityBits = N - K;
h.EncodingAlgorithm = Alg;



%% Internal function
function shape = isfulldiagtriangular(X)
% X must be a square logical matrix.
% shape = 1  if X is lower triangular and has a full diagonal.
% shape = -1 if X is upper triangular and has a full diagonal.
% Otherwise, shape = 0.
% If X is a diagonal matrix, X is considered upper triangular.

N = size(X,1);
NumNonzeros = nnz(X);
if ~all(diag(X)) % Full diagonal?
    shape = 0;   % Must have a full diagonal.
else
    NumNonzerosInLowerPart = nnz(tril(X));
    if NumNonzerosInLowerPart == NumNonzeros
        shape = 1;  % X is lower triangular.
    elseif NumNonzerosInLowerPart == N
        shape = -1; % X is upper triangular.
    else
        shape = 0;  % X is not triangular.
    end
end


%% Internal function
function [RowIndices RowStartLoc ColumnSum] = ConvertMatrixFormat(X)
% Create an alternative representation of a zero-one matrix.

% Find nonzero elements.
[i,j] = find(X);  %#ok

% Generate zero-based row indices and use int32 for C-MEX function.
RowIndices = int32(i-1);

% Find the number of nonzero elements in each column.
% Use int32 for C-MEX function.
ColumnSum  = int32(full(sum(X)));

% For each column, find where the corresponding row indices start in RowIndices.
% Generate zero-based indices and use int32 for C-MEX function.
CumulativeSum = cumsum(double(ColumnSum));
RowStartLoc = int32([0 CumulativeSum(1:end-1)]);


%% Internal function
function [A B chosen_pivots invertible] = gf2factorize(X)
%GF2FACTORIZE  Factorize a square matrix in GF(2).
%   [A B chosen_pivots invertible] = gf2factorize(X) factorizes a square matrix X
%   in GF(2) using Gaussian elimination.
%
%   X = A * B    (in GF(2), i.e., using modulo-2 arithmetic)
%
%   X may be a sparse matrix. Nonzero elements are treated as ones.
%   A and B are sparse logical matrices.
%
%   A is always lower triangular.
%   If X is invertible in GF(2), then B(chosen_pivots,:) is upper triangular and
%   invertible = true.
%   If X is non-invertible in GF(2), then X = A * B still holds and invertible = false.
%
%   To evaluate A * B in GF(2), use mod(A*double(B),2).

n = size(X,1);
if n ~= size(X,2)
    % This should never occur.
    error('comm:ldpcenc:NonSquareInputForFactorization', ...
          'Input for gf2factorize must be a square matrix.');
end

Y1 = logical(eye(n,n));
Y2 = full(X~=0);
chosen_pivots = zeros(n,1); % Haven't chosen any pivots yet.
invertible = true; % Assume that X is invertible in GF(2).

for col = 1:n
    candidate_rows = Y2(:,col);
    candidate_rows(chosen_pivots(1:(col-1))) = 0; % Never use a chosen pivot.
    candidate_rows = find(candidate_rows); % Convert into row indices.

    if isempty(candidate_rows)
        invertible = false; % X is not invertible in GF(2).
        break;
    else
        pivot = candidate_rows(1);      % Choose the first candidate row as the pivot row.
        chosen_pivots(col) = pivot;     % Record this pivot.

        % Find all nonzero elements in the pivot row.
        % They will be xor-ed with the corresponding elements in other
        % candidate rows.
        columnind = find(Y2(pivot,:));

        % Subtract the pivot row from all other candidate_rows.
        % Exploit the fact that we are working in GF(2).
        % Just use logical NOT.
        % As we continue in this loop, Y2 will become "psychologically"
        % upper triangular.
        Y2(candidate_rows(2:end), columnind) = not(Y2(candidate_rows(2:end), columnind));

        % Update the lower triangular matrix Y1.
        Y1(candidate_rows(2:end), pivot) = 1;
    end
end

% Output sparse matrices to save memory.
A = sparse(Y1);
B = sparse(Y2);

if ~invertible
    % Output the chosen pivots even if X is not invertible in GF(2).
    chosen_pivots = [chosen_pivots(1:(col-1)); setdiff((1:n)', chosen_pivots(1:(col-1)))];
end

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区欧美日韩| 成人av先锋影音| 在线成人免费视频| 石原莉奈在线亚洲二区| 91视频xxxx| 国产亚洲精品福利| 国产精品一卡二卡在线观看| 国产精品色婷婷| 一本久久a久久精品亚洲| 亚洲午夜日本在线观看| 国产欧美日韩在线视频| av在线不卡网| 亚洲成人三级小说| 久久一留热品黄| 99久久精品情趣| 亚洲一区二区三区中文字幕| 91精品国产欧美一区二区| 国产一区二区不卡| 综合久久国产九一剧情麻豆| 欧美日韩aaa| 高清国产一区二区三区| 亚洲综合激情网| 久久久蜜桃精品| 在线观看视频一区二区欧美日韩| 美女一区二区三区在线观看| 中文字幕一区在线| 91精品视频网| 丁香另类激情小说| 日本一不卡视频| 亚洲三级久久久| 日韩美一区二区三区| 播五月开心婷婷综合| 丝袜亚洲另类丝袜在线| 中文字幕av资源一区| 欧美二区乱c少妇| jvid福利写真一区二区三区| 日本视频一区二区| 亚洲欧美另类小说视频| 久久久久久久综合| 69精品人人人人| 从欧美一区二区三区| 天天av天天翘天天综合网色鬼国产| 亚洲国产精华液网站w| 91精品国产91久久综合桃花| 91网页版在线| 国产成人av网站| 日韩精品国产欧美| 一区二区三区久久| 国产精品国产三级国产有无不卡 | 91麻豆精品秘密| 久久99在线观看| 亚洲一区二区三区视频在线| 国产精品久久久久久久午夜片| 精品少妇一区二区三区在线视频| 欧亚洲嫩模精品一区三区| 大胆欧美人体老妇| 国产传媒一区在线| 久久国产精品99精品国产| 性欧美大战久久久久久久久| 亚洲乱码国产乱码精品精的特点| 国产精品久久久久婷婷 | 亚洲视频一区二区在线| 国产视频一区在线观看| 精品国产一区二区三区忘忧草| 欧美精品第一页| 欧美日韩亚洲国产综合| 欧美在线|欧美| 欧美专区日韩专区| 在线精品视频一区二区三四| 欧美中文字幕一二三区视频| 色94色欧美sute亚洲线路二| 色诱亚洲精品久久久久久| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 欧美日韩免费观看一区二区三区 | 麻豆91免费看| 日韩av电影天堂| 免费高清不卡av| 久久99精品一区二区三区| 精品在线一区二区| 国产伦精品一区二区三区视频青涩| 狠狠色狠狠色合久久伊人| 麻豆成人在线观看| 国产精品99久久久久久久vr| 日韩综合小视频| 亚洲精品一二三四区| 亚洲精品午夜久久久| 亚洲在线观看免费| 五月激情六月综合| 美腿丝袜亚洲综合| 国产在线国偷精品免费看| 国产精品一区二区91| 成人精品视频一区二区三区 | 在线精品视频免费观看| 在线播放91灌醉迷j高跟美女| 欧美精品tushy高清| 欧美精品一区二区三区高清aⅴ| 精品美女一区二区| 欧美精品一区二区三区一线天视频| 精品免费视频一区二区| 国产亚洲精品7777| 亚洲视频每日更新| 婷婷综合五月天| 国产精一品亚洲二区在线视频| 成人午夜精品在线| 欧美性一级生活| 日韩精品一区二区三区蜜臀 | 毛片基地黄久久久久久天堂| 国产美女一区二区| 91麻豆国产福利在线观看| 884aa四虎影成人精品一区| 久久久亚洲欧洲日产国码αv| 亚洲欧美日韩在线| 蜜臀av一区二区在线观看| 不卡av免费在线观看| 欧美一区二区三区成人| 国产欧美一区二区精品秋霞影院| 亚洲国产精品自拍| 成人久久视频在线观看| 欧美日韩日日骚| 国产精品乱码一区二区三区软件| 亚洲h动漫在线| av中文字幕在线不卡| 日韩免费观看2025年上映的电影| 亚洲精品综合在线| 国产一区二区三区日韩| 欧美日韩在线播放一区| 国产精品美女久久久久久2018| 偷窥少妇高潮呻吟av久久免费| 国产成人精品免费在线| 91精品国产全国免费观看 | 亚洲午夜影视影院在线观看| 国产精品主播直播| 91精品国产美女浴室洗澡无遮挡| 最新日韩av在线| 国产精品亚洲а∨天堂免在线| 欧美精品少妇一区二区三区 | 一区二区三区中文免费| 国产精品白丝jk白祙喷水网站| 69精品人人人人| 夜夜嗨av一区二区三区网页| 成人永久免费视频| 精品国产乱码久久久久久免费| 偷偷要91色婷婷| 欧美在线观看你懂的| 亚洲色图欧美激情| 国产精品亚洲综合一区在线观看| 日韩免费在线观看| 免费高清不卡av| 在线播放中文一区| 午夜在线成人av| 欧美专区日韩专区| 亚洲综合精品自拍| 91成人免费电影| 亚洲精品成a人| 一本色道久久综合亚洲aⅴ蜜桃 | 国产东北露脸精品视频| 日韩一区二区精品葵司在线| 首页综合国产亚洲丝袜| 欧美日韩精品一区二区三区蜜桃| 亚洲精品国产一区二区三区四区在线| 丁香另类激情小说| 国产精品国产三级国产| jvid福利写真一区二区三区| 国产精品动漫网站| 色综合久久久网| 亚洲精品视频一区二区| 色香蕉久久蜜桃| 亚洲五码中文字幕| 91精品国产黑色紧身裤美女| 偷拍亚洲欧洲综合| 91精品国产乱码久久蜜臀| 美女脱光内衣内裤视频久久影院| 欧美一区二区三区四区在线观看| 热久久国产精品| 欧美不卡视频一区| 国产乱妇无码大片在线观看| 中文字幕av在线一区二区三区| 91亚洲精品久久久蜜桃| 成人免费在线观看入口| 91国产成人在线| 丝袜美腿亚洲色图| 久久天天做天天爱综合色| 国产suv精品一区二区883| 亚洲欧美另类小说| 91精品在线免费观看| 国产在线视频不卡二| 欧美国产成人在线| 91电影在线观看| 精品一区二区三区在线播放| 中文字幕免费不卡| 91色porny在线视频| 午夜精品久久久久久不卡8050| 69久久99精品久久久久婷婷 | 色综合久久综合网97色综合| 亚洲h动漫在线| 久久精品水蜜桃av综合天堂| 色综合久久久久综合体桃花网| 蜜桃久久久久久| 一色屋精品亚洲香蕉网站| 欧美日韩国产精品成人|