mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-02-21 04:58:33 -05:00
Program jt9sim cleaned up in various ways. Final Fano decoding of
soft symbols moved to subroutine decode9. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2629 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
8970a140e0
commit
17ddb8eb01
@ -37,7 +37,7 @@ OBJS1 = trimlist.o display.o getdphi.o pctile.o ccf65.o \
|
|||||||
lenmsk.o decodemsk.o ping.o makepings.o alignmsg.o match.o \
|
lenmsk.o decodemsk.o ping.o makepings.o alignmsg.o match.o \
|
||||||
rtping.o jtmsk.o hipass.o setupmsk.o foldmsk.o genjt9.o \
|
rtping.o jtmsk.o hipass.o setupmsk.o foldmsk.o genjt9.o \
|
||||||
packbits.o unpackbits.o encode232.o interleave9.o entail.o \
|
packbits.o unpackbits.o encode232.o interleave9.o entail.o \
|
||||||
fano232.o
|
fano232.o spec9.o
|
||||||
|
|
||||||
libm65.a: $(OBJS1)
|
libm65.a: $(OBJS1)
|
||||||
ar cr libm65.a $(OBJS1)
|
ar cr libm65.a $(OBJS1)
|
||||||
|
@ -31,10 +31,10 @@ subroutine genjt9(message,minutes,msgsent,d6)
|
|||||||
call encode232(d1,nsym2,d2) !Convolutional code, K=32, r=1/2
|
call encode232(d1,nsym2,d2) !Convolutional code, K=32, r=1/2
|
||||||
call interleave9(d2,1,d3) !Interleave the single bits
|
call interleave9(d2,1,d3) !Interleave the single bits
|
||||||
call packbits(d3,nsym2,3,d4) !Pack 3-bit groups into words
|
call packbits(d3,nsym2,3,d4) !Pack 3-bit groups into words
|
||||||
d5=d4
|
|
||||||
print*,d5
|
|
||||||
|
|
||||||
! call graycode(d4,69,1,d5) !Apply Gray code
|
! d5=d4
|
||||||
|
! print*,d5
|
||||||
|
call graycode(d4,69,1,d5) !Apply Gray code
|
||||||
|
|
||||||
! Insert sync symbols (ntone=0) and add 1 to the data-tone numbers.
|
! Insert sync symbols (ntone=0) and add 1 to the data-tone numbers.
|
||||||
j=0
|
j=0
|
||||||
|
@ -7,19 +7,15 @@ program jt9sim
|
|||||||
integer*2 iwave !Generated waveform (no noise)
|
integer*2 iwave !Generated waveform (no noise)
|
||||||
real*8 f0,f,dt,twopi,phi,dphi,baud,fspan
|
real*8 f0,f,dt,twopi,phi,dphi,baud,fspan
|
||||||
character msg*22,msg0*22,message*22,msgsent*22,arg*8,fname*11
|
character msg*22,msg0*22,message*22,msgsent*22,arg*8,fname*11
|
||||||
integer*4 itone(85)
|
|
||||||
|
|
||||||
integer*4 mettab(0:255,0:1)
|
integer*4 itone(85) !Channel symbols (values 0-8)
|
||||||
integer*4 t0(13) !72-bit message as 6-bit words
|
integer*4 i4DataSymNoGray(69) !Data Symbols, values 0-7
|
||||||
integer*1 t1(13) !72 bits and zero tail as 8-bit bytes
|
integer*1 i1ScrambledBits(207) !Hard-decision demodulated bits, interleaved
|
||||||
integer*1 t2(207) !Encoded information-carrying bits
|
integer*1 i1Bits(207) !Encoded information-carrying bits
|
||||||
integer*1 t3(207) !Bits from t4, after interleaving
|
integer*1 i1SoftSymbols(207)
|
||||||
integer*4 t4(69) !Symbols from t5, values 0-7
|
|
||||||
integer*4 t5(69) !Gray-coded symbols, values 0-7
|
|
||||||
integer*4 t6(85) !Channel symbols including sync, values 0-8
|
|
||||||
integer*1 tmp(72)
|
|
||||||
integer*1 i1
|
integer*1 i1
|
||||||
equivalence (i1,i4)
|
equivalence (i1,i4)
|
||||||
|
|
||||||
integer isync(85) !Sync vector
|
integer isync(85) !Sync vector
|
||||||
data isync/ &
|
data isync/ &
|
||||||
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0, &
|
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0, &
|
||||||
@ -70,18 +66,6 @@ program jt9sim
|
|||||||
|
|
||||||
open(12,file='msgs.txt',status='old')
|
open(12,file='msgs.txt',status='old')
|
||||||
|
|
||||||
! Get the metric table
|
|
||||||
bias=0.37 !To be optimized, in decoder program
|
|
||||||
scale=10 ! ... ditto ...
|
|
||||||
open(19,file='met8.21',status='old')
|
|
||||||
|
|
||||||
do i=0,255
|
|
||||||
read(19,*) x00,x0,x1
|
|
||||||
mettab(i,0)=nint(scale*(x0-bias))
|
|
||||||
mettab(i,1)=nint(scale*(x1-bias)) !### Check range, etc. ###
|
|
||||||
enddo
|
|
||||||
close(19)
|
|
||||||
|
|
||||||
write(*,1000)
|
write(*,1000)
|
||||||
1000 format('File N freq S/N Message'/ &
|
1000 format('File N freq S/N Message'/ &
|
||||||
'---------------------------------------------------')
|
'---------------------------------------------------')
|
||||||
@ -147,51 +131,26 @@ program jt9sim
|
|||||||
write(10) ihdr,iwave(1:npts)
|
write(10) ihdr,iwave(1:npts)
|
||||||
close(10)
|
close(10)
|
||||||
|
|
||||||
! We're done! Now decode the data in itone, as a test.
|
! We're done! Now decode the data symbols from itone, as a test.
|
||||||
j=0
|
j=0
|
||||||
do i=1,85
|
do i=1,85
|
||||||
if(isync(i).eq.1) cycle
|
if(isync(i).eq.1) cycle
|
||||||
j=j+1
|
j=j+1
|
||||||
t5(j)=itone(i)-1
|
i4DataSymNoGray(j)=igray(itone(i)-1,-1)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
! call graycode(t5,69,-1,t4)
|
call unpackbits(i4DataSymNoGray,69,3,i1ScrambledBits)
|
||||||
t4=t5
|
call interleave9(i1ScrambledBits,-1,i1Bits)
|
||||||
call unpackbits(t4,69,3,t3)
|
|
||||||
! call interleave9(t3,-1,t2)
|
|
||||||
t2=t3
|
|
||||||
|
|
||||||
nbits=72
|
|
||||||
ndelta=17
|
|
||||||
limit=1000
|
|
||||||
do i=1,206
|
do i=1,206
|
||||||
i4=-10
|
i4=-10
|
||||||
if(t2(i).eq.1) i4=10
|
if(i1Bits(i).eq.1) i4=10
|
||||||
i4=i4+128
|
i4=i4+128
|
||||||
t2(i)=i1
|
i1SoftSymbols(i)=i1
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
print*,t2
|
call decode9(i1SoftSymbols,msg)
|
||||||
|
|
||||||
call fano232(t2,nbits+31,mettab,ndelta,limit,t1,ncycles,metric,ierr, &
|
|
||||||
maxmetric,maxnp)
|
|
||||||
print*,ncycles
|
|
||||||
|
|
||||||
nbytes=(nbits+7)/8
|
|
||||||
do i=1,nbytes
|
|
||||||
n=t1(i)
|
|
||||||
t4(i)=iand(n,255)
|
|
||||||
enddo
|
|
||||||
call unpackbits(t4,nbytes,8,tmp)
|
|
||||||
call packbits(tmp,12,6,t4)
|
|
||||||
do i=1,12
|
|
||||||
if(t4(i).lt.128) t1(i)=t4(i)
|
|
||||||
if(t4(i).ge.128) t1(i)=t4(i)-256
|
|
||||||
enddo
|
|
||||||
do i=1,12
|
|
||||||
t4(i)=t1(i)
|
|
||||||
enddo
|
|
||||||
call unpackmsg(t4,msg) !Unpack decoded msg
|
|
||||||
if(msg.ne.msg0) print*,'Decode error: ',msg0,' ',msg
|
if(msg.ne.msg0) print*,'Decode error: ',msg0,' ',msg
|
||||||
|
|
||||||
enddo
|
enddo
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//-------------------------------------------------------------- MainWindow
|
//--------------------------------------------------------------- MainWindow
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "devsetup.h"
|
#include "devsetup.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user