image thumbnail

Channel Noise Estimation Using Particle based Belief Propagation for LDPC decoding in AWGN and BSC

by

 

Channel Noise Estimation Using Particle based Belief Propagation for LDPC decoding in AWGN and BSC

invgampdf(x,a,b)
% Authors:
% 
% Shuang Wang, Lijuan Cui and Samuel Cheng
% 
% Copyright:
% 
% Copyright ? 2007-2011 Shuang Wang
% 
% Questions:
% 
% For any questions, please contact me by shuangwang AT ou dot edu
%
% reference
%  L. Cui, S. Wang, S. Cheng, M. Yeary, "Adaptive Binary Slepian-Wolf Decoding using Particle Based Belief Propagation", Communications, IEEE Transactions on, to appear.
%  S. Wang, L. Cui, S. Cheng, Y. Zhai, M. Yeary, Q. Wu, "Noise Adaptive LDPC Decoding Using Particle Filtering," Communications, IEEE Transactions on, Vol 59. pp. 913 - 916, April 2011.
%
function y = invgampdf(x,a,b)
%invGAMPDF inverse Gamma probability density function.

if nargin < 2
    error('stats:gampdf:TooFewInputs','Requires at least two input arguments');
elseif nargin < 3
    b = 1;
end

% Return NaN for out of range parameters.
a(a <= 0) = NaN;
%b(b <= 0) = NaN;
x(x <= 0) = NaN;

try
    z = b ./ x;

    % Negative data would create complex values, potentially creating
    % spurious NaNi's in other elements of y.  Map them to the far right
    % tail, which will be forced to zero.
    z(z < 0) = Inf;
    u = a .* log(z) - z - gammaln(a);
catch
    error('stats:gampdf:InputSizeMismatch',...
          'Non-scalar arguments must match in size.');
end

% % Get the correct limit for z == 0.
% u(z == 0 & a == 1) = 0;
% % These two cases work automatically
% %  u(z == 0 & a < 1) = Inf;
% %  u(z == 0 & a > 1) = -Inf;

% Force a 0 for extreme right tail, instead of getting exp(Inf-Inf)==NaN
u(z == Inf & isfinite(a)) = -Inf;
% Force a 0 when a is infinite, instead of getting exp(Inf-Inf)==NaN
u(z < Inf & a == Inf) = -Inf;

y = exp(u) ./ x;

Contact us