[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Implementation of qfunc in Communications Package
From: |
Richardson, Anthony |
Subject: |
Implementation of qfunc in Communications Package |
Date: |
Thu, 30 Jan 2014 16:36:59 +0000 |
Is it possible to replace the current definition of qfunc in the communications
package with this one?
function y = qfunc2(x)
y = erfc(x/sqrt(2))/2;
end
The current implementation returns 0 for arguments greater than about 8. (It
implements qfunc as
1 - normcdf(x) and so relies on the differences between two numbers that are
both about 1.) The
implementation above relies on erfc and is good down to machine precision. It
doesn't return 0 until
the argument is greater than about 38. The following script illustrates the
differences:
k = 0:0.01:20;
figure(1)
subplot(2,1,1)
semilogy(k, qfunc2(k));
ax = axis();
subplot(2,1,2)
semilogy(k, qfunc(k));
axis(ax);
qfuncinv suffers from similar problems, but unfortunately the fix is not so
simple. Octave's implementation
of erfcinv returns Inf for arguments smaller than about 1e-17. MATLAB's
implementation doesn't return Inf
until the argument is less than 1e-320 or so. (I know that such small
probabilities are uncommon in "regular"
statistics, but not uncommon in digital communications where we may be
interested in the probability of one
bit error in a billion/trillion/gazillion.)
Tony Richardson
- Implementation of qfunc in Communications Package,
Richardson, Anthony <=