summaryrefslogtreecommitdiff
path: root/lib/ft8/encode174.f90
diff options
context:
space:
mode:
authorChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:31 +0200
committerChristoph Berg <christoph.berg@credativ.de>2022-08-23 10:23:31 +0200
commit0e579a45e2e5823f90e2632073749583cd15fa0d (patch)
tree5e709e13d41c8ea0da0968fb6c4566057b4b7909 /lib/ft8/encode174.f90
parent28d1767618141cd6481de2e93e36e3dfa555d4b4 (diff)
parent2d1068e60bce7ae1fff11623454900e8cee956b1 (diff)
Update upstream source from tag 'upstream/2.6.0_rc3+repack'
Update to upstream version '2.6.0~rc3+repack' with Debian dir 9ee8bc3a4b60bb88f4d57c7d1f2d37dbc1632144
Diffstat (limited to 'lib/ft8/encode174.f90')
-rwxr-xr-xlib/ft8/encode174.f90100
1 files changed, 50 insertions, 50 deletions
diff --git a/lib/ft8/encode174.f90 b/lib/ft8/encode174.f90
index 599f1064..2a14614b 100755
--- a/lib/ft8/encode174.f90
+++ b/lib/ft8/encode174.f90
@@ -1,50 +1,50 @@
-subroutine encode174(message,codeword)
-! Encode an 87-bit message and return a 174-bit codeword.
-! The generator matrix has dimensions (87,87).
-! The code is a (174,87) regular ldpc code with column weight 3.
-! The code was generated using the PEG algorithm.
-! After creating the codeword, the columns are re-ordered according to
-! "colorder" to make the codeword compatible with the parity-check matrix
-!
-
-include "ldpc_174_87_params.f90"
-
-integer*1 codeword(N)
-integer*1 gen(M,K)
-integer*1 itmp(N)
-integer*1 message(K)
-integer*1 pchecks(M)
-logical first
-data first/.true./
-
-save first,gen
-
-if( first ) then ! fill the generator matrix
- gen=0
- do i=1,M
- do j=1,11
- read(g(i)( (j-1)*2+1:(j-1)*2+2 ),"(Z2)") istr
- do jj=1, 8
- icol=(j-1)*8+jj
- if( icol .le. 87 ) then
- if( btest(istr,8-jj) ) gen(i,icol)=1
- endif
- enddo
- enddo
- enddo
-first=.false.
-endif
-
-do i=1,M
- nsum=0
- do j=1,K
- nsum=nsum+message(j)*gen(i,j)
- enddo
- pchecks(i)=mod(nsum,2)
-enddo
-itmp(1:M)=pchecks
-itmp(M+1:N)=message(1:K)
-codeword(colorder+1)=itmp(1:N)
-
-return
-end subroutine encode174
+subroutine encode174(message,codeword)
+! Encode an 87-bit message and return a 174-bit codeword.
+! The generator matrix has dimensions (87,87).
+! The code is a (174,87) regular ldpc code with column weight 3.
+! The code was generated using the PEG algorithm.
+! After creating the codeword, the columns are re-ordered according to
+! "colorder" to make the codeword compatible with the parity-check matrix
+!
+
+include "ldpc_174_87_params.f90"
+
+integer*1 codeword(N)
+integer*1 gen(M,K)
+integer*1 itmp(N)
+integer*1 message(K)
+integer*1 pchecks(M)
+logical first
+data first/.true./
+
+save first,gen
+
+if( first ) then ! fill the generator matrix
+ gen=0
+ do i=1,M
+ do j=1,11
+ read(g(i)( (j-1)*2+1:(j-1)*2+2 ),"(Z2)") istr
+ do jj=1, 8
+ icol=(j-1)*8+jj
+ if( icol .le. 87 ) then
+ if( btest(istr,8-jj) ) gen(i,icol)=1
+ endif
+ enddo
+ enddo
+ enddo
+first=.false.
+endif
+
+do i=1,M
+ nsum=0
+ do j=1,K
+ nsum=nsum+message(j)*gen(i,j)
+ enddo
+ pchecks(i)=mod(nsum,2)
+enddo
+itmp(1:M)=pchecks
+itmp(M+1:N)=message(1:K)
+codeword(colorder+1)=itmp(1:N)
+
+return
+end subroutine encode174