From: <car...@us...> - 2012-08-21 00:32:42
|
Revision: 10891 http://octave.svn.sourceforge.net/octave/?rev=10891&view=rev Author: carandraug Date: 2012-08-21 00:32:36 +0000 (Tue, 21 Aug 2012) Log Message: ----------- egolaydec: bug fix where the error flag was not given for more than 3 erroneous bits Modified Paths: -------------- trunk/octave-forge/main/comm/NEWS trunk/octave-forge/main/comm/inst/egolaydec.m Modified: trunk/octave-forge/main/comm/NEWS =================================================================== --- trunk/octave-forge/main/comm/NEWS 2012-08-20 17:15:30 UTC (rev 10890) +++ trunk/octave-forge/main/comm/NEWS 2012-08-21 00:32:36 UTC (rev 10891) @@ -5,6 +5,10 @@ istrellis poly2trellis + ** Fixed bug in `egolaydec' which gave an error when there were more + than the three allowed erroneous bits, rather than setting the + error flag. + Summary of important user-visible changes for communications 1.1.1: ------------------------------------------------------------------- Modified: trunk/octave-forge/main/comm/inst/egolaydec.m =================================================================== --- trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-20 17:15:30 UTC (rev 10890) +++ trunk/octave-forge/main/comm/inst/egolaydec.m 2012-08-21 00:32:36 UTC (rev 10891) @@ -14,7 +14,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {} egolaydec (@var{R}) +## @deftypefn {Function File} {} egolaydec (@var{R}) ## ## Given @var{R}, the received Extended Golay code, this function tries to ## decode @var{R} using the Extended Golay code parity check matrix. @@ -37,7 +37,7 @@ ## ## @example ## @group -## M=[rand(10,12)>0.5]; +## M=[rand(10,12)>0.5]; ## C1=egolayenc(M); ## C1(:,1)=mod(C1(:,1)+1,2) ## C2=egolaydec(C1) @@ -80,12 +80,13 @@ S=mod(RR*H,2); wt=sum(S); done=0; + E=[S, zeros(1,12)]; if (wt <= 3) E=[S, zeros(1,12)]; done=1; else SP = mod(repmat(S,[12, 1])+P,2); - idx = find( sum(SP,2) <= 2 ); + idx = find( sum(SP,2) <= 2 ); if ( idx ) idx=idx(1); %pick first of matches. Ui=zeros(1,12); Ui(idx)=1; @@ -118,9 +119,5 @@ return; end -%! %!assert(egolaydec([1 1 1 zeros(1,21)]),zeros(1,24)) %!assert(egolaydec([1 0 1 zeros(1,20) 1]),zeros(1,24)) -%! - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |