Tentative and temporary change to encode MSK144 in a separate process.

NB: temporary files are being written to execution directory!


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6989 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-08-03 15:34:42 +00:00
parent f0c3017ba8
commit 69685dfcb8
4 changed files with 59 additions and 10 deletions

View File

@ -1,4 +1,4 @@
subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file,ldpc_msg)
!!!!!!!!!!!!!!!!!! Experimental small blocklength ldpc version
! s8 + 48bits + s8 + 80 bits = 144 bits (72ms message duration)
@ -22,7 +22,9 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
use iso_c_binding, only: c_loc,c_size_t
use packjt
use hashing
character*512 pchk_file,gen_file
character*512 pchk_file,gen_file,ldpc_msg,ldpc_cw
character*120 fname1,fname2
character*2048 cmnd
character*22 msg0
character*22 message !Message to be generated
character*22 msgsent !Message as it will be received
@ -50,7 +52,16 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
i=index(pchk_file,".pchk")
gen_file=pchk_file(1:i-1)//".gen"
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
i=index(ldpc_msg,'ldpc_msg"')
ldpc_cw=ldpc_msg(1:i-1)//'ldpc_cw"'
! fname1=trim(ldpc_msg)
! fname2=trim(ldpc_cw)
! print*,'A ',fname1
fname1="ldpc_msg"
fname2="ldpc_cw"
! print*,'B ',fname1
! call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
if( first ) then
first=.false.
@ -82,7 +93,8 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
enddo
if(message(1:1).eq.'<') then
call genmsk40(message,msgsent,ichk,i4tone,itype,pchk_file)
call genmsk40(message,msgsent,ichk,i4tone,itype,pchk_file, &
fname1,fname2)
if(itype.lt.0) go to 999
i4tone(41)=-40
go to 999
@ -122,7 +134,19 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
enddo
enddo
call ldpc_encode(msgbits,codeword)
! call ldpc_encode(msgbits,codeword)
open(19,file=fname1,status='unknown')
write(19,1010) msgbits
1010 format(80i1)
close(19)
cmnd='encode '//trim(pchk_file)//' '//trim(gen_file)//' ' &
//trim(fname1)//' '//trim(fname2)
call system(cmnd)
open(19,file=fname2,status='old')
read(19,1020) codeword
1020 format(128i1)
close(19)
!Create 144-bit channel vector:
!8-bit sync word + 48 bits + 8-bit sync word + 80 bits

View File

@ -1,4 +1,4 @@
subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file)
subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file,fname1,fname2)
use hashing
character*22 msg,msgsent,hashmsg
@ -7,6 +7,8 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file)
character*4 crpt,rpt(0:63)
character*512 pchk_file,gen_file
character*512 pchk_file40,gen_file40
character*120 fname1,fname2
character*2048 cmnd
logical first
integer itone(144)
integer*1 message(16),codeword(32),bitseq(40)
@ -35,7 +37,7 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file)
pchk_file40=pchk_file(1:i-1)//"32-16"//pchk_file(i+6:)
i=index(pchk_file40,".pchk")
gen_file40=pchk_file40(1:i-1)//".gen"
call init_ldpc(trim(pchk_file40)//char(0),trim(gen_file40)//char(0))
! call init_ldpc(trim(pchk_file40)//char(0),trim(gen_file40)//char(0))
itype=-1
msgsent='*** bad message ***'
itone=0
@ -61,7 +63,19 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file)
do i=1,16
message(i)=iand(1,ishft(ig,1-i))
enddo
call ldpc_encode(message,codeword)
! call ldpc_encode(message,codeword)
open(19,file=fname1,status='unknown')
write(19,1010) message
1010 format(16i1)
close(19)
cmnd='encode '//trim(pchk_file)//' '//trim(gen_file)//' ' &
//trim(fname1)//' '//trim(fname2)
call system(cmnd)
open(19,file=fname2,status='old')
read(19,1020) codeword
1020 format(32i1)
close(19)
cwstring=" "
do i=1,32

View File

@ -78,7 +78,8 @@ extern "C" {
int* itext, int len1, int len2);
void genmsk144_(char* msg, int* ichk, char* msgsent, int itone[],
int* itext, char pchkFile[], int len1, int len2, int len3);
int* itext, char pchkFile[], char ldpcMsgFile[],
int len1, int len2, int len3, int len4);
void gen65_(char* msg, int* ichk, char* msgsent, int itone[],
int* itext, int len1, int len2);
@ -836,6 +837,14 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
if(i<pchkFile.length()) m_pchkFile[i]=ba[i];
}
QString ldpcMsgFile = m_config.temp_dir().absoluteFilePath("ldpc_msg");
ldpcMsgFile = '"' + ldpcMsgFile + '"';
ba = ldpcMsgFile.toLocal8Bit();
for(int i=0; i<512; i++) {
m_ldpcMsgFile[i]=32;
if(i<ldpcMsgFile.length()) m_ldpcMsgFile[i]=ba[i];
}
statusChanged();
//### The following is temporary ###
{
@ -2745,7 +2754,8 @@ void MainWindow::guiUpdate()
&m_currentMessageType, len1, len1);
if(m_modeTx=="MSK144") {
genmsk144_(message, &ichk, msgsent, const_cast<int *> (itone),
&m_currentMessageType, &m_pchkFile[0], len1, len1, 512);
&m_currentMessageType, &m_pchkFile[0], &m_ldpcMsgFile[0],
len1, len1, 512, 512);
if(m_restart) {
int nsym=144;
if(itone[40]==-40) nsym=40;

View File

@ -426,6 +426,7 @@ private:
char m_msg[100][80];
char m_pchkFile[512];
char m_ldpcMsgFile[512];
// labels in status bar
QLabel tx_status_label;