mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-01 08:07:10 -04:00
Some code cleanup.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6496 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
fef14a566f
commit
a7e1e8ee75
@ -155,27 +155,19 @@ void mixed_encode
|
||||
|
||||
// Wrapper for calling sparse_encode from fortran
|
||||
void ldpc_encode_(
|
||||
char msg[82],
|
||||
char cdw[128]
|
||||
char msg[N-M],
|
||||
char cdw[N]
|
||||
){
|
||||
int i;
|
||||
char checks[46];
|
||||
char checks[M];
|
||||
|
||||
printf("msg: ");
|
||||
for (i=0; i<82; i++) {
|
||||
printf("%d", msg[i]); }
|
||||
printf("\n");
|
||||
sparse_encode(msg,cdw);
|
||||
mod2sparse_mulvec (H, cdw, checks);
|
||||
for (i = 0; i<46; i++) {
|
||||
for (i = 0; i<M; i++) {
|
||||
if( checks[i] == 1 ) {
|
||||
printf("Failed to encode.\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
printf("cdw: ");
|
||||
for (i=0; i<128; i++) {
|
||||
printf("%d", cdw[i]); }
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ for i in `seq 1 1000`
|
||||
do
|
||||
seed=$i
|
||||
echo seed $seed
|
||||
make-ldpc ldpc.pchk $m $n $seed evenboth 120x3/8x4 no4cycle
|
||||
make-ldpc ldpc.pchk $m $n $seed evenboth 124x3/4x4 no4cycle
|
||||
make-gen ldpc.pchk ldpc.gen dense
|
||||
encode ldpc.pchk ldpc.gen ldpc.src ldpc.enc
|
||||
transmit ldpc.enc ldpc.rec 1 awgn 0.7
|
||||
|
@ -2,26 +2,25 @@ program msksim
|
||||
|
||||
use, intrinsic :: iso_c_binding
|
||||
|
||||
parameter (N=128, M=46, K=82) ! M and N are global variables on the C side.
|
||||
parameter (N=128, M=48, K=80) ! M and N are global variables on the C side.
|
||||
integer(1) message(1:K)
|
||||
integer(1) codeword(1:N)
|
||||
integer(1) decoded(1:K)
|
||||
real*8 lratio(N)
|
||||
character(50) pchk_file,gen_file
|
||||
|
||||
pchk_file="./jtmode_codes/ldpc-128-82-sf11.pchk"
|
||||
gen_file="./jtmode_codes/ldpc-128-82-sf11.gen"
|
||||
pchk_file="./jtmode_codes/ldpc-128-80-sf13.pchk"
|
||||
gen_file="./jtmode_codes/ldpc-128-80-sf13.gen"
|
||||
|
||||
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
|
||||
|
||||
|
||||
message(1:41)=1
|
||||
message(42:82)=0
|
||||
message(1:40)=1
|
||||
message(41:80)=0
|
||||
call ldpc_encode(message,codeword)
|
||||
|
||||
max_iterations=10
|
||||
ntrials=1000000
|
||||
rate=82.0/128.0
|
||||
rate=real(K)/real(N)
|
||||
|
||||
write(*,*) "Eb/N0 ngood nundetected"
|
||||
do idb = 0, 11
|
||||
@ -30,7 +29,6 @@ do idb = 0, 11
|
||||
|
||||
ngood=0
|
||||
nue=0
|
||||
aviter=0.0
|
||||
|
||||
do itrial=1, ntrials
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user