Merged master 8748
This commit is contained in:
@@ -0,0 +1,409 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 2005, 2006 Douglas Gregor.
|
||||
# Copyright (C) 2006 The Trustees of Indiana University
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# boostinspect:notab - Tabs are required for the Makefile.
|
||||
|
||||
BJAM=""
|
||||
TOOLSET=""
|
||||
BJAM_CONFIG=""
|
||||
BUILD=""
|
||||
PREFIX=/usr/local
|
||||
EPREFIX=
|
||||
LIBDIR=
|
||||
INCLUDEDIR=
|
||||
LIBS=""
|
||||
PYTHON=python
|
||||
PYTHON_VERSION=
|
||||
PYTHON_ROOT=
|
||||
ICU_ROOT=
|
||||
|
||||
# Handle case where builtin shell version of echo command doesn't
|
||||
# support -n. Use the installed echo executable if there is one
|
||||
# rather than builtin version to ensure -n is supported.
|
||||
ECHO=`which echo`
|
||||
if test "x$ECHO" = x; then
|
||||
ECHO=echo
|
||||
fi
|
||||
|
||||
# Internal flags
|
||||
flag_no_python=
|
||||
flag_icu=
|
||||
flag_show_libraries=
|
||||
|
||||
for option
|
||||
do
|
||||
case $option in
|
||||
|
||||
-help | --help | -h)
|
||||
want_help=yes ;;
|
||||
|
||||
-prefix=* | --prefix=*)
|
||||
PREFIX=`expr "x$option" : "x-*prefix=\(.*\)"`
|
||||
;;
|
||||
|
||||
-exec-prefix=* | --exec-prefix=*)
|
||||
EPREFIX=`expr "x$option" : "x-*exec-prefix=\(.*\)"`
|
||||
;;
|
||||
|
||||
-libdir=* | --libdir=*)
|
||||
LIBDIR=`expr "x$option" : "x-*libdir=\(.*\)"`
|
||||
;;
|
||||
|
||||
-includedir=* | --includedir=*)
|
||||
INCLUDEDIR=`expr "x$option" : "x-*includedir=\(.*\)"`
|
||||
;;
|
||||
|
||||
-show-libraries | --show-libraries )
|
||||
flag_show_libraries=yes
|
||||
;;
|
||||
|
||||
-with-bjam=* | --with-bjam=* )
|
||||
BJAM=`expr "x$option" : "x-*with-bjam=\(.*\)"`
|
||||
;;
|
||||
|
||||
-with-icu | --with-icu )
|
||||
flag_icu=yes
|
||||
;;
|
||||
|
||||
-with-icu=* | --with-icu=* )
|
||||
flag_icu=yes
|
||||
ICU_ROOT=`expr "x$option" : "x-*with-icu=\(.*\)"`
|
||||
;;
|
||||
|
||||
-without-icu | --without-icu )
|
||||
flag_icu=no
|
||||
;;
|
||||
|
||||
-with-libraries=* | --with-libraries=* )
|
||||
library_list=`expr "x$option" : "x-*with-libraries=\(.*\)"`
|
||||
if test "$library_list" != "all"; then
|
||||
old_IFS=$IFS
|
||||
IFS=,
|
||||
for library in $library_list
|
||||
do
|
||||
LIBS="$LIBS --with-$library"
|
||||
|
||||
if test $library = python; then
|
||||
requested_python=yes
|
||||
fi
|
||||
done
|
||||
IFS=$old_IFS
|
||||
|
||||
if test "x$requested_python" != xyes; then
|
||||
flag_no_python=yes
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
-without-libraries=* | --without-libraries=* )
|
||||
library_list=`expr "x$option" : "x-*without-libraries=\(.*\)"`
|
||||
old_IFS=$IFS
|
||||
IFS=,
|
||||
for library in $library_list
|
||||
do
|
||||
LIBS="$LIBS --without-$library"
|
||||
|
||||
if test $library = python; then
|
||||
flag_no_python=yes
|
||||
fi
|
||||
done
|
||||
IFS=$old_IFS
|
||||
;;
|
||||
|
||||
-with-python=* | --with-python=* )
|
||||
PYTHON=`expr "x$option" : "x-*with-python=\(.*\)"`
|
||||
;;
|
||||
|
||||
-with-python-root=* | --with-python-root=* )
|
||||
PYTHON_ROOT=`expr "x$option" : "x-*with-python-root=\(.*\)"`
|
||||
;;
|
||||
|
||||
-with-python-version=* | --with-python-version=* )
|
||||
PYTHON_VERSION=`expr "x$option" : "x-*with-python-version=\(.*\)"`
|
||||
;;
|
||||
|
||||
-with-toolset=* | --with-toolset=* )
|
||||
TOOLSET=`expr "x$option" : "x-*with-toolset=\(.*\)"`
|
||||
;;
|
||||
|
||||
-*)
|
||||
{ echo "error: unrecognized option: $option
|
||||
Try \`$0 --help' for more information." >&2
|
||||
{ (exit 1); exit 1; }; }
|
||||
;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
||||
if test "x$want_help" = xyes; then
|
||||
cat <<EOF
|
||||
\`./bootstrap.sh' prepares Boost for building on a few kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]...
|
||||
|
||||
Defaults for the options are specified in brackets.
|
||||
|
||||
Configuration:
|
||||
-h, --help display this help and exit
|
||||
--with-bjam=BJAM use existing Boost.Jam executable (bjam)
|
||||
[automatically built]
|
||||
--with-toolset=TOOLSET use specific Boost.Build toolset
|
||||
[automatically detected]
|
||||
--show-libraries show the set of libraries that require build
|
||||
and installation steps (i.e., those libraries
|
||||
that can be used with --with-libraries or
|
||||
--without-libraries), then exit
|
||||
--with-libraries=list build only a particular set of libraries,
|
||||
describing using either a comma-separated list of
|
||||
library names or "all"
|
||||
[all]
|
||||
--without-libraries=list build all libraries except the ones listed []
|
||||
--with-icu enable Unicode/ICU support in Regex
|
||||
[automatically detected]
|
||||
--without-icu disable Unicode/ICU support in Regex
|
||||
--with-icu=DIR specify the root of the ICU library installation
|
||||
and enable Unicode/ICU support in Regex
|
||||
[automatically detected]
|
||||
--with-python=PYTHON specify the Python executable [python]
|
||||
--with-python-root=DIR specify the root of the Python installation
|
||||
[automatically detected]
|
||||
--with-python-version=X.Y specify the Python version as X.Y
|
||||
[automatically detected]
|
||||
|
||||
Installation directories:
|
||||
--prefix=PREFIX install Boost into the given PREFIX
|
||||
[/usr/local]
|
||||
--exec-prefix=EPREFIX install Boost binaries into the given EPREFIX
|
||||
[PREFIX]
|
||||
|
||||
More precise control over installation directories:
|
||||
--libdir=DIR install libraries here [EPREFIX/lib]
|
||||
--includedir=DIR install headers here [PREFIX/include]
|
||||
|
||||
EOF
|
||||
fi
|
||||
test -n "$want_help" && exit 0
|
||||
|
||||
# TBD: Determine where the script is located
|
||||
my_dir="."
|
||||
|
||||
# Determine the toolset, if not already decided
|
||||
if test "x$TOOLSET" = x; then
|
||||
guessed_toolset=`$my_dir/tools/build/src/engine/build.sh --guess-toolset`
|
||||
case $guessed_toolset in
|
||||
acc | darwin | gcc | como | mipspro | pathscale | pgi | qcc | vacpp )
|
||||
TOOLSET=$guessed_toolset
|
||||
;;
|
||||
|
||||
intel-* )
|
||||
TOOLSET=intel
|
||||
;;
|
||||
|
||||
mingw )
|
||||
TOOLSET=gcc
|
||||
;;
|
||||
|
||||
sun* )
|
||||
TOOLSET=sun
|
||||
;;
|
||||
|
||||
* )
|
||||
# Not supported by Boost.Build
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
rm -f config.log
|
||||
|
||||
# Build bjam
|
||||
if test "x$BJAM" = x; then
|
||||
$ECHO -n "Building Boost.Build engine with toolset $TOOLSET... "
|
||||
pwd=`pwd`
|
||||
(cd "$my_dir/tools/build/src/engine" && ./build.sh "$TOOLSET") > bootstrap.log 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo
|
||||
echo "Failed to build Boost.Build build engine"
|
||||
echo "Consult 'bootstrap.log' for more details"
|
||||
exit 1
|
||||
fi
|
||||
cd "$pwd"
|
||||
arch=`cd $my_dir/tools/build/src/engine && ./bootstrap/jam0 -d0 -f build.jam --toolset=$TOOLSET --toolset-root= --show-locate-target && cd ..`
|
||||
BJAM="$my_dir/tools/build/src/engine/$arch/b2"
|
||||
echo "tools/build/src/engine/$arch/b2"
|
||||
cp "$BJAM" .
|
||||
cp "$my_dir/tools/build/src/engine/$arch/bjam" .
|
||||
|
||||
fi
|
||||
|
||||
# TBD: Turn BJAM into an absolute path
|
||||
|
||||
# If there is a list of libraries
|
||||
if test "x$flag_show_libraries" = xyes; then
|
||||
cat <<EOF
|
||||
|
||||
The following Boost libraries have portions that require a separate build
|
||||
and installation step. Any library not listed here can be used by including
|
||||
the headers only.
|
||||
|
||||
The Boost libraries requiring separate building and installation are:
|
||||
EOF
|
||||
$BJAM -d0 --show-libraries | grep '^[[:space:]]*-'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Setup paths
|
||||
if test "x$EPREFIX" = x; then
|
||||
EPREFIX="$PREFIX"
|
||||
fi
|
||||
|
||||
if test "x$LIBDIR" = x; then
|
||||
LIBDIR="$EPREFIX/lib"
|
||||
fi
|
||||
|
||||
if test "x$INCLUDEDIR" = x; then
|
||||
INCLUDEDIR="$PREFIX/include"
|
||||
fi
|
||||
|
||||
# Find Python
|
||||
if test "x$flag_no_python" = x; then
|
||||
result=`$PYTHON -c "exit" > /dev/null 2>&1`
|
||||
if [ "$?" -ne "0" ]; then
|
||||
flag_no_python=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$flag_no_python" = x; then
|
||||
if test "x$PYTHON_VERSION" = x; then
|
||||
$ECHO -n "Detecting Python version... "
|
||||
PYTHON_VERSION=`$PYTHON -c "import sys; print (\"%d.%d\" % (sys.version_info[0], sys.version_info[1]))"`
|
||||
echo $PYTHON_VERSION
|
||||
fi
|
||||
|
||||
if test "x$PYTHON_ROOT" = x; then
|
||||
$ECHO -n "Detecting Python root... "
|
||||
PYTHON_ROOT=`$PYTHON -c "import sys; print(sys.prefix)"`
|
||||
echo $PYTHON_ROOT
|
||||
fi
|
||||
fi
|
||||
|
||||
# Configure ICU
|
||||
$ECHO -n "Unicode/ICU support for Boost.Regex?... "
|
||||
if test "x$flag_icu" != xno; then
|
||||
if test "x$ICU_ROOT" = x; then
|
||||
COMMON_ICU_PATHS="/usr /usr/local /sw"
|
||||
for p in $COMMON_ICU_PATHS; do
|
||||
if test -r $p/include/unicode/utypes.h; then
|
||||
ICU_ROOT=$p
|
||||
fi
|
||||
done
|
||||
|
||||
if test "x$ICU_ROOT" = x; then
|
||||
echo "not found."
|
||||
else
|
||||
BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
|
||||
echo "$ICU_ROOT"
|
||||
fi
|
||||
else
|
||||
BJAM_CONFIG="$BJAM_CONFIG -sICU_PATH=$ICU_ROOT"
|
||||
echo "$ICU_ROOT"
|
||||
fi
|
||||
else
|
||||
echo "disabled."
|
||||
fi
|
||||
|
||||
# Backup the user's existing project-config.jam
|
||||
JAM_CONFIG_OUT="project-config.jam"
|
||||
if test -r "project-config.jam"; then
|
||||
counter=1
|
||||
|
||||
while test -r "project-config.jam.$counter"; do
|
||||
counter=`expr $counter + 1`
|
||||
done
|
||||
|
||||
echo "Backing up existing Boost.Build configuration in project-config.jam.$counter"
|
||||
mv "project-config.jam" "project-config.jam.$counter"
|
||||
fi
|
||||
|
||||
# Generate user-config.jam
|
||||
echo "Generating Boost.Build configuration in project-config.jam..."
|
||||
cat > project-config.jam <<EOF
|
||||
# Boost.Build Configuration
|
||||
# Automatically generated by bootstrap.sh
|
||||
|
||||
import option ;
|
||||
import feature ;
|
||||
|
||||
# Compiler configuration. This definition will be used unless
|
||||
# you already have defined some toolsets in your user-config.jam
|
||||
# file.
|
||||
if ! $TOOLSET in [ feature.values <toolset> ]
|
||||
{
|
||||
using $TOOLSET ;
|
||||
}
|
||||
|
||||
project : default-build <toolset>$TOOLSET ;
|
||||
EOF
|
||||
|
||||
# - Python configuration
|
||||
if test "x$flag_no_python" = x; then
|
||||
cat >> project-config.jam <<EOF
|
||||
|
||||
# Python configuration
|
||||
import python ;
|
||||
if ! [ python.configured ]
|
||||
{
|
||||
using python : $PYTHON_VERSION : $PYTHON_ROOT ;
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
|
||||
if test "x$ICU_ROOT" != x; then
|
||||
cat >> project-config.jam << EOF
|
||||
|
||||
path-constant ICU_PATH : $ICU_ROOT ;
|
||||
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat >> project-config.jam << EOF
|
||||
|
||||
# List of --with-<library> and --without-<library>
|
||||
# options. If left empty, all libraries will be built.
|
||||
# Options specified on the command line completely
|
||||
# override this variable.
|
||||
libraries = $LIBS ;
|
||||
|
||||
# These settings are equivivalent to corresponding command-line
|
||||
# options.
|
||||
option.set prefix : $PREFIX ;
|
||||
option.set exec-prefix : $EPREFIX ;
|
||||
option.set libdir : $LIBDIR ;
|
||||
option.set includedir : $INCLUDEDIR ;
|
||||
|
||||
# Stop on first error
|
||||
option.set keep-going : false ;
|
||||
EOF
|
||||
|
||||
cat << EOF
|
||||
|
||||
Bootstrapping is done. To build, run:
|
||||
|
||||
./b2
|
||||
|
||||
To adjust configuration, edit 'project-config.jam'.
|
||||
Further information:
|
||||
|
||||
- Command line help:
|
||||
./b2 --help
|
||||
|
||||
- Getting started guide:
|
||||
http://www.boost.org/more/getting_started/unix-variants.html
|
||||
|
||||
- Boost.Build documentation:
|
||||
http://www.boost.org/build/doc/html/index.html
|
||||
|
||||
EOF
|
||||
@@ -0,0 +1,147 @@
|
||||
subroutine genmsk144(msg0,mygrid,ichk,bcontest,msgsent,i4tone,itype)
|
||||
! s8 + 48bits + s8 + 80 bits = 144 bits (72ms message duration)
|
||||
!
|
||||
! Encode an MSK144 message
|
||||
! Input:
|
||||
! - msg0 requested message to be transmitted
|
||||
! - ichk if ichk=1, return only msgsent
|
||||
! if ichk.ge.10000, set imsg=ichk-10000 for short msg
|
||||
! - msgsent message as it will be decoded
|
||||
! - i4tone array of audio tone values, 0 or 1
|
||||
! - itype message type
|
||||
! 1 = standard message "Call_1 Call_2 Grid/Rpt"
|
||||
! 2 = type 1 prefix
|
||||
! 3 = type 1 suffix
|
||||
! 4 = type 2 prefix
|
||||
! 5 = type 2 suffix
|
||||
! 6 = free text (up to 13 characters)
|
||||
! 7 = short message "<Call_1 Call2> Rpt"
|
||||
|
||||
use iso_c_binding, only: c_loc,c_size_t
|
||||
use packjt
|
||||
use hashing
|
||||
character*22 msg0
|
||||
character*22 message !Message to be generated
|
||||
character*22 msgsent !Message as it will be received
|
||||
character*6 mygrid
|
||||
integer*4 i4Msg6BitWords(13) !72-bit message as 6-bit words
|
||||
integer*4 i4tone(144) !
|
||||
integer*1, target:: i1Msg8BitBytes(10) !80 bits represented in 10 bytes
|
||||
integer*1 codeword(128) !Encoded bits before re-ordering
|
||||
integer*1 msgbits(80) !72-bit message + 8-bit hash
|
||||
integer*1 bitseq(144) !Tone #s, data and sync (values 0-1)
|
||||
integer*1 i1hash(4)
|
||||
integer*1 s8(8)
|
||||
logical bcontest
|
||||
real*8 pp(12)
|
||||
real*8 xi(864),xq(864),pi,twopi
|
||||
data s8/0,1,1,1,0,0,1,0/
|
||||
equivalence (ihash,i1hash)
|
||||
logical first
|
||||
data first/.true./
|
||||
save
|
||||
|
||||
if(first) then
|
||||
first=.false.
|
||||
nsym=128
|
||||
pi=4.0*atan(1.0)
|
||||
twopi=8.*atan(1.0)
|
||||
do i=1,12
|
||||
pp(i)=sin((i-1)*pi/12)
|
||||
enddo
|
||||
endif
|
||||
|
||||
if(msg0(1:1).eq.'@') then !Generate a fixed tone
|
||||
read(msg0(2:5),*,end=1,err=1) nfreq !at specified frequency
|
||||
go to 2
|
||||
1 nfreq=1000
|
||||
2 i4tone(1)=nfreq
|
||||
else
|
||||
message=msg0
|
||||
do i=1,22
|
||||
if(ichar(message(i:i)).eq.0) then
|
||||
message(i:)=' '
|
||||
exit
|
||||
endif
|
||||
enddo
|
||||
|
||||
do i=1,22 !Strip leading blanks
|
||||
if(message(1:1).ne.' ') exit
|
||||
message=message(i+1:)
|
||||
enddo
|
||||
|
||||
if(message(1:1).eq.'<') then
|
||||
call genmsk40(message,msgsent,ichk,i4tone,itype)
|
||||
if(itype.lt.0) go to 999
|
||||
i4tone(41)=-40
|
||||
go to 999
|
||||
endif
|
||||
|
||||
call packmsg(message,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
|
||||
|
||||
if(ichk.eq.1) go to 999
|
||||
i4=0
|
||||
ik=0
|
||||
im=0
|
||||
do i=1,12
|
||||
nn=i4Msg6BitWords(i)
|
||||
do j=1, 6
|
||||
ik=ik+1
|
||||
i4=i4+i4+iand(1,ishft(nn,j-6))
|
||||
i4=iand(i4,255)
|
||||
if(ik.eq.8) then
|
||||
im=im+1
|
||||
i1Msg8BitBytes(im)=i4
|
||||
ik=0
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
||||
ihash=nhash(c_loc(i1Msg8BitBytes),int(9,c_size_t),146)
|
||||
ihash=2*iand(ihash,32767) !Generate the 8-bit hash
|
||||
i1Msg8BitBytes(10)=i1hash(1) !Hash code to byte 10
|
||||
|
||||
mbit=0
|
||||
do i=1, 10
|
||||
i1=i1Msg8BitBytes(i)
|
||||
do ibit=1,8
|
||||
mbit=mbit+1
|
||||
msgbits(mbit)=iand(1,ishft(i1,ibit-8))
|
||||
enddo
|
||||
enddo
|
||||
|
||||
call encode_msk144(msgbits,codeword)
|
||||
|
||||
!Create 144-bit channel vector:
|
||||
!8-bit sync word + 48 bits + 8-bit sync word + 80 bits
|
||||
bitseq=0
|
||||
bitseq(1:8)=s8
|
||||
bitseq(9:56)=codeword(1:48)
|
||||
bitseq(57:64)=s8
|
||||
bitseq(65:144)=codeword(49:128)
|
||||
bitseq=2*bitseq-1
|
||||
|
||||
xq(1:6)=bitseq(1)*pp(7:12) !first bit is mapped to 1st half-symbol on q
|
||||
do i=1,71
|
||||
is=(i-1)*12+7
|
||||
xq(is:is+11)=bitseq(2*i+1)*pp
|
||||
enddo
|
||||
xq(864-5:864)=bitseq(1)*pp(1:6) !last half symbol
|
||||
do i=1,72
|
||||
is=(i-1)*12+1
|
||||
xi(is:is+11)=bitseq(2*i)*pp
|
||||
enddo
|
||||
! Map I and Q to tones.
|
||||
i4tone=0
|
||||
do i=1,72
|
||||
i4tone(2*i-1)=(bitseq(2*i)*bitseq(2*i-1)+1)/2;
|
||||
i4tone(2*i)=-(bitseq(2*i)*bitseq(mod(2*i,144)+1)-1)/2;
|
||||
enddo
|
||||
endif
|
||||
|
||||
! Flip polarity
|
||||
i4tone=-i4tone+1
|
||||
|
||||
999 return
|
||||
end subroutine genmsk144
|
||||
@@ -1,507 +0,0 @@
|
||||
module jt65_decode
|
||||
|
||||
integer, parameter :: NSZ=3413, NZMAX=60*12000
|
||||
|
||||
type :: jt65_decoder
|
||||
procedure(jt65_decode_callback), pointer :: callback => null()
|
||||
contains
|
||||
procedure :: decode
|
||||
end type jt65_decoder
|
||||
|
||||
! Callback function to be called with each decode
|
||||
abstract interface
|
||||
subroutine jt65_decode_callback(this,sync,snr,dt,freq,drift, &
|
||||
nflip,width,decoded,ft,qual,nsmo,nsum,minsync)
|
||||
|
||||
import jt65_decoder
|
||||
implicit none
|
||||
class(jt65_decoder), intent(inout) :: this
|
||||
real, intent(in) :: sync
|
||||
integer, intent(in) :: snr
|
||||
real, intent(in) :: dt
|
||||
integer, intent(in) :: freq
|
||||
integer, intent(in) :: drift
|
||||
integer, intent(in) :: nflip
|
||||
real, intent(in) :: width
|
||||
character(len=22), intent(in) :: decoded
|
||||
integer, intent(in) :: ft
|
||||
integer, intent(in) :: qual
|
||||
integer, intent(in) :: nsmo
|
||||
integer, intent(in) :: nsum
|
||||
integer, intent(in) :: minsync
|
||||
|
||||
end subroutine jt65_decode_callback
|
||||
end interface
|
||||
|
||||
contains
|
||||
|
||||
subroutine decode(this,callback,dd0,npts,newdat,nutc,nf1,nf2,nfqso, &
|
||||
ntol,nsubmode,minsync,nagain,n2pass,nrobust,ntrials,naggressive, &
|
||||
ndepth,emedelay,clearave,mycall,hiscall,hisgrid,nexp_decode)
|
||||
|
||||
! Process dd0() data to find and decode JT65 signals.
|
||||
|
||||
use jt65_mod
|
||||
use timer_module, only: timer
|
||||
|
||||
include 'constants.f90'
|
||||
|
||||
class(jt65_decoder), intent(inout) :: this
|
||||
procedure(jt65_decode_callback) :: callback
|
||||
real, intent(in) :: dd0(NZMAX),emedelay
|
||||
integer, intent(in) :: npts, nutc, nf1, nf2, nfqso, ntol &
|
||||
, nsubmode, minsync, n2pass, ntrials, naggressive, ndepth &
|
||||
, nexp_decode
|
||||
logical, intent(in) :: newdat, nagain, nrobust, clearave
|
||||
character(len=12), intent(in) :: mycall, hiscall
|
||||
character(len=6), intent(in) :: hisgrid
|
||||
|
||||
real dd(NZMAX)
|
||||
real ss(552,NSZ)
|
||||
real savg(NSZ)
|
||||
real a(5)
|
||||
character*22 decoded,decoded0,avemsg,deepave
|
||||
type candidate
|
||||
real freq
|
||||
real dt
|
||||
real sync
|
||||
real flip
|
||||
end type candidate
|
||||
type(candidate) ca(300)
|
||||
type accepted_decode
|
||||
real freq
|
||||
real dt
|
||||
real sync
|
||||
character*22 decoded
|
||||
end type accepted_decode
|
||||
type(accepted_decode) dec(50)
|
||||
logical :: first_time,prtavg,single_decode,bVHF
|
||||
|
||||
integer h0(0:11),d0(0:11)
|
||||
real r0(0:11)
|
||||
common/decstats/ntry65a,ntry65b,n65a,n65b,num9,numfano
|
||||
common/steve/thresh0
|
||||
common/sync/ss
|
||||
|
||||
! 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
data h0/41,42,43,43,44,45,46,47,48,48,49,49/
|
||||
data d0/71,72,73,74,76,77,78,80,81,82,83,83/
|
||||
|
||||
! 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
data r0/0.70,0.72,0.74,0.76,0.78,0.80,0.82,0.84,0.86,0.88,0.90,0.90/
|
||||
data nutc0/-999/,nfreq0/-999/,nsave/0/
|
||||
save
|
||||
|
||||
this%callback => callback
|
||||
first_time=newdat
|
||||
dd=dd0
|
||||
ndecoded=0
|
||||
|
||||
if(nsubmode.ge.100) then
|
||||
! This is QRA64 mode
|
||||
mode64=2**(nsubmode-100)
|
||||
!###
|
||||
! open(60,file='qra64_data.bin',access='stream',position='append')
|
||||
! write(60) dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
||||
! mycall,hiscall,hisgrid
|
||||
! close(60)
|
||||
!###
|
||||
call qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
|
||||
emedelay,mycall,hiscall,hisgrid,sync,nsnr,dtx,nfreq,decoded,nft)
|
||||
if (associated(this%callback)) then
|
||||
ndrift=0
|
||||
nflip=1
|
||||
width=1.0
|
||||
nsmo=0
|
||||
nqual=0
|
||||
call this%callback(sync,nsnr,dtx,nfreq,ndrift, &
|
||||
nflip,width,decoded,nft,nqual,nsmo,1,minsync)
|
||||
end if
|
||||
go to 900
|
||||
endif
|
||||
|
||||
! do ipass=1,n2pass !Two-pass decoding loop
|
||||
npass=1
|
||||
if(n2pass .gt. 1) npass=ndepth+1 !**** TEMPORARY ****
|
||||
do ipass=1,npass
|
||||
first_time=.true.
|
||||
if(ipass.eq.1) then !First-pass parameters
|
||||
thresh0=2.5
|
||||
nsubtract=1
|
||||
nrob=0
|
||||
elseif( ipass.eq.2 ) then !Second-pass parameters
|
||||
thresh0=2.0
|
||||
nsubtract=1
|
||||
nrob=0
|
||||
elseif( ipass.eq.3 ) then
|
||||
thresh0=2.0
|
||||
nsubtract=1
|
||||
nrob=0
|
||||
elseif( ipass.eq.4 ) then
|
||||
thresh0=2.0
|
||||
nsubtract=0
|
||||
nrob=1
|
||||
endif
|
||||
if(npass.eq.1) then
|
||||
nsubtract=0
|
||||
thresh0=2.0
|
||||
endif
|
||||
|
||||
call timer('symsp65 ',0)
|
||||
ss=0.
|
||||
! call symspec65(dd,npts,ss,nqsym,savg) !Get normalized symbol spectra
|
||||
call symspec65(dd,npts,nqsym,savg) !Get normalized symbol spectra
|
||||
call timer('symsp65 ',1)
|
||||
nfa=nf1
|
||||
nfb=nf2
|
||||
single_decode=iand(nexp_decode,32).ne.0 .or. nagain
|
||||
bVHF=iand(nexp_decode,64).ne.0
|
||||
|
||||
!### Q: should either of the next two uses of "single_decode" be "bVHF" instead?
|
||||
if(single_decode .or. (bVHF .and. ntol.lt.1000)) then
|
||||
nfa=max(200,nfqso-ntol)
|
||||
nfb=min(4000,nfqso+ntol)
|
||||
thresh0=1.0
|
||||
endif
|
||||
df=12000.0/8192.0 !df = 1.465 Hz
|
||||
if(bVHF) then
|
||||
ia=max(1,nint(nfa/df)-ntol)
|
||||
ib=min(NSZ,nint(nfb/df)+ntol)
|
||||
nz=ib-ia+1
|
||||
call lorentzian(savg(ia),nz,a)
|
||||
baseline=a(1)
|
||||
amp=a(2)
|
||||
f0=(a(3)+ia-1)*df
|
||||
width=a(4)*df
|
||||
endif
|
||||
|
||||
ncand=0
|
||||
call timer('sync65 ',0)
|
||||
! call sync65(ss,nfa,nfb,naggressive,ntol,nqsym,ca,ncand,0,bVHF)
|
||||
call sync65(nfa,nfb,naggressive,ntol,nqsym,ca,ncand,nrob,bVHF)
|
||||
call timer('sync65 ',1)
|
||||
|
||||
! If a candidate was found within +/- ntol of nfqso, move it into ca(1).
|
||||
call fqso_first(nfqso,ntol,ca,ncand)
|
||||
if(single_decode) then
|
||||
if(ncand.eq.0) ncand=1
|
||||
if(abs(ca(1)%freq - f0).gt.width) width=2*df !### ??? ###
|
||||
endif
|
||||
nvec=ntrials
|
||||
|
||||
mode65=2**nsubmode
|
||||
nflip=1
|
||||
nqd=0
|
||||
decoded=' '
|
||||
decoded0=""
|
||||
freq0=0.
|
||||
prtavg=.false.
|
||||
if(.not.nagain) nsum=0
|
||||
if(clearave) then
|
||||
nsum=0
|
||||
nsave=0
|
||||
endif
|
||||
|
||||
if(bVHF) then
|
||||
! Be sure to search for shorthand message at nfqso +/- ntol
|
||||
if(ncand.lt.300) ncand=ncand+1
|
||||
ca(ncand)%sync=5.0
|
||||
ca(ncand)%dt=2.5
|
||||
ca(ncand)%freq=nfqso
|
||||
endif
|
||||
do icand=1,ncand
|
||||
sync1=ca(icand)%sync
|
||||
dtx=ca(icand)%dt
|
||||
freq=ca(icand)%freq
|
||||
!write(*,*) icand,sync1,dtx,freq,ndepth,bVHF,mode65
|
||||
if(bVHF) then
|
||||
flip=ca(icand)%flip
|
||||
nflip=flip
|
||||
endif
|
||||
if(sync1.lt.float(minsync)) nflip=0
|
||||
if(ipass.eq.1) ntry65a=ntry65a + 1
|
||||
if(ipass.eq.2) ntry65b=ntry65b + 1
|
||||
call timer('decod65a',0)
|
||||
nft=0
|
||||
nspecial=0
|
||||
call decode65a(dd,npts,first_time,nqd,freq,nflip,mode65,nvec, &
|
||||
naggressive,ndepth,ntol,mycall,hiscall,hisgrid, &
|
||||
nexp_decode,bVHF,sync2,a,dtx,nft,nspecial,qual, &
|
||||
nhist,nsmo,decoded)
|
||||
if(nspecial.eq.2) decoded='RO'
|
||||
if(nspecial.eq.3) decoded='RRR'
|
||||
if(nspecial.eq.4) decoded='73'
|
||||
call timer('decod65a',1)
|
||||
if(sync1.lt.float(minsync) .and. &
|
||||
decoded.eq.' ') nflip=0
|
||||
if(nft.ne.0) nsum=1
|
||||
|
||||
nhard_min=param(1)
|
||||
nrtt1000=param(4)
|
||||
ntotal_min=param(5)
|
||||
nsmo=param(9)
|
||||
|
||||
nfreq=nint(freq+a(1))
|
||||
ndrift=nint(2.0*a(2))
|
||||
if(bVHF) then
|
||||
s2db=sync1 - 30.0 + db(width/3.3) !### VHF/UHF/microwave
|
||||
if(nspecial.gt.0) s2db=sync2
|
||||
else
|
||||
s2db=10.0*log10(sync2) - 35 !### Empirical (HF)
|
||||
endif
|
||||
nsnr=nint(s2db)
|
||||
if(nsnr.lt.-30) nsnr=-30
|
||||
if(nsnr.gt.-1) nsnr=-1
|
||||
nftt=0
|
||||
|
||||
if(nft.ne.1 .and. iand(ndepth,16).eq.16 .and. (.not.prtavg)) then
|
||||
! Single-sequence FT decode failed, so try for an average FT decode.
|
||||
if(nutc.ne.nutc0 .or. abs(nfreq-nfreq0).gt.ntol) then
|
||||
! This is a new minute or a new frequency, so call avg65.
|
||||
nutc0=nutc
|
||||
nfreq0=nfreq
|
||||
nsave=nsave+1
|
||||
nsave=mod(nsave-1,64)+1
|
||||
call avg65(nutc,nsave,sync1,dtx,nflip,nfreq,mode65,ntol, &
|
||||
ndepth,nagain,ntrials,naggressive,clearave,neme,mycall, &
|
||||
hiscall,hisgrid,nftt,avemsg,qave,deepave,nsum,ndeepave)
|
||||
nsmo=param(9)
|
||||
nqave=qave
|
||||
|
||||
if (associated(this%callback) .and. nsum.ge.2) then
|
||||
call this%callback(sync1,nsnr,dtx-1.0,nfreq,ndrift, &
|
||||
nflip,width,avemsg,nftt,nqave,nsmo,nsum,minsync)
|
||||
prtavg=.true.
|
||||
end if
|
||||
|
||||
endif
|
||||
endif
|
||||
|
||||
if(nftt.eq.1) then
|
||||
! nft=1
|
||||
decoded=avemsg
|
||||
go to 5
|
||||
endif
|
||||
n=naggressive
|
||||
rtt=0.001*nrtt1000
|
||||
if(nft.lt.2 .and. minsync.ge.0 .and. nspecial.eq.0) then
|
||||
if(nhard_min.gt.50) cycle
|
||||
if(nhard_min.gt.h0(n)) cycle
|
||||
if(ntotal_min.gt.d0(n)) cycle
|
||||
if(rtt.gt.r0(n)) cycle
|
||||
endif
|
||||
|
||||
5 continue
|
||||
if(decoded.eq.decoded0 .and. abs(freq-freq0).lt. 3.0 .and. &
|
||||
minsync.ge.0) cycle !Don't display dupes
|
||||
if(decoded.ne.' ' .or. minsync.lt.0) then
|
||||
if(nsubtract.eq.1) then
|
||||
call timer('subtr65 ',0)
|
||||
call subtract65(dd,npts,freq,dtx)
|
||||
call timer('subtr65 ',1)
|
||||
endif
|
||||
|
||||
ndupe=0 ! de-dedupe
|
||||
do i=1, ndecoded
|
||||
if(decoded==dec(i)%decoded) then
|
||||
ndupe=1
|
||||
exit
|
||||
endif
|
||||
enddo
|
||||
if(ndupe.ne.1 .and. sync1.ge.float(minsync)) then
|
||||
if(ipass.eq.1) n65a=n65a + 1
|
||||
if(ipass.eq.2) n65b=n65b + 1
|
||||
if(ndecoded.lt.50) ndecoded=ndecoded+1
|
||||
dec(ndecoded)%freq=freq+a(1)
|
||||
dec(ndecoded)%dt=dtx
|
||||
dec(ndecoded)%sync=sync2
|
||||
dec(ndecoded)%decoded=decoded
|
||||
nqual=min(qual,9999.0)
|
||||
|
||||
if (associated(this%callback)) then
|
||||
call this%callback(sync1,nsnr,dtx-1.0,nfreq,ndrift, &
|
||||
nflip,width,decoded,nft,nqual,nsmo,1,minsync)
|
||||
end if
|
||||
endif
|
||||
decoded0=decoded
|
||||
freq0=freq
|
||||
if(decoded0.eq.' ') decoded0='*'
|
||||
endif
|
||||
enddo !Candidate loop
|
||||
if(ipass.eq.2 .and. ndecoded.lt.1) exit
|
||||
enddo !Two-pass loop
|
||||
900 return
|
||||
end subroutine decode
|
||||
|
||||
subroutine avg65(nutc,nsave,snrsync,dtxx,nflip,nfreq,mode65,ntol,ndepth, &
|
||||
nagain, ntrials,naggressive,clearave,neme,mycall,hiscall,hisgrid,nftt, &
|
||||
avemsg,qave,deepave,nsum,ndeepave)
|
||||
|
||||
! Decodes averaged JT65 data
|
||||
|
||||
use jt65_mod
|
||||
parameter (MAXAVE=64)
|
||||
character*22 avemsg,deepave,deepbest
|
||||
character mycall*12,hiscall*12,hisgrid*6
|
||||
character*1 csync,cused(64)
|
||||
logical nagain
|
||||
integer iused(64)
|
||||
! Accumulated data for message averaging
|
||||
integer iutc(MAXAVE)
|
||||
integer nfsave(MAXAVE)
|
||||
integer nflipsave(MAXAVE)
|
||||
real s1b(-255:256,126)
|
||||
real s1save(-255:256,126,MAXAVE)
|
||||
real s2(66,126)
|
||||
real s3save(64,63,MAXAVE)
|
||||
real s3b(64,63)
|
||||
real s3c(64,63)
|
||||
real dtsave(MAXAVE)
|
||||
real syncsave(MAXAVE)
|
||||
logical first,clearave
|
||||
data first/.true./
|
||||
save
|
||||
|
||||
if(first .or. clearave) then
|
||||
iutc=-1
|
||||
nfsave=0
|
||||
dtdiff=0.2
|
||||
first=.false.
|
||||
s3save=0.
|
||||
s1save=0.
|
||||
nsave=1 !### ???
|
||||
! Silence compiler warnings
|
||||
if(nagain .and. ndeepave.eq.-99 .and. neme.eq.-99) stop
|
||||
endif
|
||||
|
||||
do i=1,64
|
||||
if(iutc(i).lt.0) exit
|
||||
if(nutc.eq.iutc(i) .and. abs(nfreq-nfsave(i)).le.ntol) go to 10
|
||||
enddo
|
||||
|
||||
! Save data for message averaging
|
||||
iutc(nsave)=nutc
|
||||
syncsave(nsave)=snrsync
|
||||
dtsave(nsave)=dtxx
|
||||
nfsave(nsave)=nfreq
|
||||
nflipsave(nsave)=nflip
|
||||
s1save(-255:256,1:126,nsave)=s1
|
||||
s3save(1:64,1:63,nsave)=s3a
|
||||
|
||||
10 syncsum=0.
|
||||
dtsum=0.
|
||||
nfsum=0
|
||||
nsum=0
|
||||
s1b=0.
|
||||
s3b=0.
|
||||
s3c=0.
|
||||
|
||||
do i=1,MAXAVE !Consider all saved spectra
|
||||
cused(i)='.'
|
||||
if(iutc(i).lt.0) cycle
|
||||
if(mod(iutc(i),2).ne.mod(nutc,2)) cycle !Use only same (odd/even) seq
|
||||
if(abs(dtxx-dtsave(i)).gt.dtdiff) cycle !DT must match
|
||||
if(abs(nfreq-nfsave(i)).gt.ntol) cycle !Freq must match
|
||||
if(nflip.ne.nflipsave(i)) cycle !Sync type (*/#) must match
|
||||
s3b=s3b + s3save(1:64,1:63,i)
|
||||
s1b=s1b + s1save(-255:256,1:126,i)
|
||||
syncsum=syncsum + syncsave(i)
|
||||
dtsum=dtsum + dtsave(i)
|
||||
nfsum=nfsum + nfsave(i)
|
||||
cused(i)='$'
|
||||
nsum=nsum+1
|
||||
iused(nsum)=i
|
||||
enddo
|
||||
if(nsum.lt.64) iused(nsum+1)=0
|
||||
|
||||
syncave=0.
|
||||
dtave=0.
|
||||
fave=0.
|
||||
if(nsum.gt.0) then
|
||||
syncave=syncsum/nsum
|
||||
dtave=dtsum/nsum
|
||||
fave=float(nfsum)/nsum
|
||||
endif
|
||||
|
||||
do i=1,nsave
|
||||
csync='*'
|
||||
if(nflipsave(i).lt.0.0) csync='#'
|
||||
write(14,1000) cused(i),iutc(i),syncsave(i),dtsave(i)-1.0,nfsave(i),csync
|
||||
1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1)
|
||||
enddo
|
||||
if(nsum.lt.2) go to 900
|
||||
|
||||
nftt=0
|
||||
df=1378.125/512.0
|
||||
|
||||
! Do the smoothing loop
|
||||
qualbest=0.
|
||||
minsmo=0
|
||||
maxsmo=0
|
||||
if(mode65.ge.2) then
|
||||
minsmo=nint(width/df)
|
||||
maxsmo=2*minsmo
|
||||
endif
|
||||
nn=0
|
||||
do ismo=minsmo,maxsmo
|
||||
if(ismo.gt.0) then
|
||||
do j=1,126
|
||||
call smo121(s1b(-255,j),512)
|
||||
if(j.eq.1) nn=nn+1
|
||||
if(nn.ge.4) then
|
||||
call smo121(s1b(-255,j),512)
|
||||
if(j.eq.1) nn=nn+1
|
||||
endif
|
||||
enddo
|
||||
endif
|
||||
|
||||
do i=1,66
|
||||
jj=i
|
||||
if(mode65.eq.2) jj=2*i-1
|
||||
if(mode65.eq.4) then
|
||||
ff=4*(i-1)*df - 355.297852
|
||||
jj=nint(ff/df)+1
|
||||
endif
|
||||
s2(i,1:126)=s1b(jj,1:126)
|
||||
enddo
|
||||
|
||||
do j=1,63
|
||||
k=mdat(j) !Points to data symbol
|
||||
if(nflip.lt.0) k=mdat2(j)
|
||||
do i=1,64
|
||||
s3c(i,j)=4.e-5*s2(i+2,k)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
nadd=nsum*ismo
|
||||
call extract(s3c,nadd,mode65,ntrials,naggressive,ndepth,nflip,mycall, &
|
||||
hiscall,hisgrid,nexp_decode,ncount,nhist,avemsg,ltext,nftt,qual)
|
||||
if(nftt.eq.1) then
|
||||
nsmo=ismo
|
||||
param(9)=nsmo
|
||||
go to 900
|
||||
else if(nftt.eq.2) then
|
||||
if(qual.gt.qualbest) then
|
||||
deepbest=avemsg
|
||||
qualbest=qual
|
||||
nnbest=nn
|
||||
nsmobest=ismo
|
||||
nfttbest=nftt
|
||||
endif
|
||||
endif
|
||||
enddo
|
||||
|
||||
if(nfttbest.eq.2) then
|
||||
avemsg=deepbest !### ???
|
||||
deepave=deepbest
|
||||
qave=qualbest
|
||||
nsmo=nsmobest
|
||||
param(9)=nsmo
|
||||
nftt=nfttbest
|
||||
endif
|
||||
900 continue
|
||||
|
||||
return
|
||||
end subroutine avg65
|
||||
|
||||
end module jt65_decode
|
||||
@@ -1,224 +0,0 @@
|
||||
|
||||
# CODE 1
|
||||
|
||||
make-pchk ex-dep.pchk 4 6 0:0 0:5 3:1 3:2
|
||||
print-pchk -d ex-dep.pchk
|
||||
|
||||
Parity check matrix in ex-dep.pchk (dense format):
|
||||
|
||||
1 0 0 0 0 1
|
||||
0 0 0 0 0 0
|
||||
0 0 0 0 0 0
|
||||
0 1 1 0 0 0
|
||||
|
||||
echo 00011011 >ex-dep.src
|
||||
|
||||
# SPARSE REPRESENTATION
|
||||
|
||||
make-gen ex-dep.pchk ex-dep.gen sparse
|
||||
Note: Parity check matrix has 2 redundant checks
|
||||
Number of 1s per check in L is 0.8, U is 0.5, B is 0.2, total is 1.5
|
||||
print-gen -d ex-dep.gen
|
||||
|
||||
Generator matrix in ex-dep.gen (sparse representation):
|
||||
|
||||
Column order (message bits at end):
|
||||
|
||||
5 2 1 3 4 0
|
||||
|
||||
Row order:
|
||||
|
||||
0 3 2 1
|
||||
|
||||
L:
|
||||
|
||||
1 0 0 0
|
||||
0 0 0 0
|
||||
0 0 0 0
|
||||
0 1 0 0
|
||||
|
||||
U:
|
||||
|
||||
0 0 0 0 0 1
|
||||
0 1 1 0 0 0
|
||||
0 0 0 0 0 0
|
||||
0 0 0 0 0 0
|
||||
|
||||
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
|
||||
Encoded 4 blocks, source block size 2, encoded block size 6
|
||||
000000
|
||||
100001
|
||||
000010
|
||||
100011
|
||||
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
|
||||
Block counts: tot 4, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
|
||||
# DENSE REPRESENTATION
|
||||
|
||||
make-gen ex-dep.pchk ex-dep.gen dense
|
||||
Note: Parity check matrix has 2 redundant checks
|
||||
Number of 1s per check in Inv(A) X B is 0.2
|
||||
print-gen -d ex-dep.gen
|
||||
|
||||
Generator matrix in ex-dep.gen (dense representation):
|
||||
|
||||
Column order (message bits at end):
|
||||
|
||||
0 1 2 3 4 5
|
||||
|
||||
Inv(A) X B:
|
||||
|
||||
0 1
|
||||
0 0
|
||||
0 0
|
||||
0 0
|
||||
|
||||
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
|
||||
Encoded 4 blocks, source block size 2, encoded block size 6
|
||||
000000
|
||||
100001
|
||||
000010
|
||||
100011
|
||||
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
|
||||
Block counts: tot 4, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
|
||||
# MIXED REPRESENTATION
|
||||
|
||||
make-gen ex-dep.pchk ex-dep.gen mixed
|
||||
Note: Parity check matrix has 2 redundant checks
|
||||
Number of 1s per check in Inv(A) is 0.5, in B is 0.2, total is 0.8
|
||||
print-gen -d ex-dep.gen
|
||||
|
||||
Generator matrix in ex-dep.gen (mixed representation):
|
||||
|
||||
Column order (message bits at end):
|
||||
|
||||
0 1 2 3 4 5
|
||||
|
||||
Inv(A):
|
||||
|
||||
1 0 0 0
|
||||
0 0 0 1
|
||||
0 0 0 0
|
||||
0 0 0 0
|
||||
|
||||
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
|
||||
Encoded 4 blocks, source block size 2, encoded block size 6
|
||||
000000
|
||||
100001
|
||||
000010
|
||||
100011
|
||||
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
|
||||
Block counts: tot 4, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
|
||||
# CODE 2
|
||||
|
||||
make-pchk ex-dep.pchk 4 5 0:0 0:1 1:1 1:2 2:0 2:2 3:3 3:4
|
||||
print-pchk -d ex-dep.pchk
|
||||
|
||||
Parity check matrix in ex-dep.pchk (dense format):
|
||||
|
||||
1 1 0 0 0
|
||||
0 1 1 0 0
|
||||
1 0 1 0 0
|
||||
0 0 0 1 1
|
||||
|
||||
echo 01 >ex-dep.src
|
||||
|
||||
# SPARSE REPRESENTATION
|
||||
|
||||
make-gen ex-dep.pchk ex-dep.gen sparse
|
||||
Note: Parity check matrix has 1 redundant checks
|
||||
Number of 1s per check in L is 1.0, U is 1.2, B is 0.5, total is 2.8
|
||||
print-gen -d ex-dep.gen
|
||||
|
||||
Generator matrix in ex-dep.gen (sparse representation):
|
||||
|
||||
Column order (message bits at end):
|
||||
|
||||
4 1 2 3 0
|
||||
|
||||
Row order:
|
||||
|
||||
3 0 1 2
|
||||
|
||||
L:
|
||||
|
||||
0 1 0 0
|
||||
0 1 1 0
|
||||
0 0 1 0
|
||||
1 0 0 0
|
||||
|
||||
U:
|
||||
|
||||
0 0 0 1 1
|
||||
0 1 0 0 0
|
||||
0 0 1 0 0
|
||||
0 0 0 0 0
|
||||
|
||||
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
|
||||
Encoded 2 blocks, source block size 1, encoded block size 5
|
||||
00000
|
||||
11100
|
||||
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
|
||||
Block counts: tot 2, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
|
||||
# DENSE REPRESENTATION
|
||||
|
||||
make-gen ex-dep.pchk ex-dep.gen dense
|
||||
Note: Parity check matrix has 1 redundant checks
|
||||
Number of 1s per check in Inv(A) X B is 0.2
|
||||
print-gen -d ex-dep.gen
|
||||
|
||||
Generator matrix in ex-dep.gen (dense representation):
|
||||
|
||||
Column order (message bits at end):
|
||||
|
||||
0 1 3 2 4
|
||||
|
||||
Inv(A) X B:
|
||||
|
||||
0
|
||||
0
|
||||
1
|
||||
0
|
||||
|
||||
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
|
||||
Encoded 2 blocks, source block size 1, encoded block size 5
|
||||
00000
|
||||
00011
|
||||
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
|
||||
Block counts: tot 2, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
|
||||
# MIXED REPRESENTATION
|
||||
|
||||
make-gen ex-dep.pchk ex-dep.gen mixed
|
||||
Note: Parity check matrix has 1 redundant checks
|
||||
Number of 1s per check in Inv(A) is 1.0, in B is 0.2, total is 1.2
|
||||
print-gen -d ex-dep.gen
|
||||
|
||||
Generator matrix in ex-dep.gen (mixed representation):
|
||||
|
||||
Column order (message bits at end):
|
||||
|
||||
0 1 3 2 4
|
||||
|
||||
Inv(A):
|
||||
|
||||
1 1 0 0
|
||||
0 1 0 0
|
||||
0 0 0 1
|
||||
0 0 0 0
|
||||
|
||||
encode ex-dep.pchk ex-dep.gen ex-dep.src ex-dep.enc; cat ex-dep.enc
|
||||
Encoded 2 blocks, source block size 1, encoded block size 5
|
||||
00000
|
||||
00011
|
||||
verify ex-dep.pchk ex-dep.enc ex-dep.gen ex-dep.src
|
||||
Block counts: tot 2, with chk errs 0, with src errs 0, both 0
|
||||
Bit error rate (on message bits only): 0.000e+00
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user