More flexibility in QRA65code, including simple S/N simulations.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6802 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-06-23 13:58:18 +00:00
parent 84891dde37
commit f146375dd0
3 changed files with 100 additions and 49 deletions

View File

@ -13,6 +13,15 @@ void qra65_enc_(int x[], int y[])
void qra65_dec_(float r[], int xdec[], int* rc)
{
// Return codes:
// rc<0 no decode
// rc=0 [? ? ?] AP0 (decoding with no a-priori information)
// rc=1 [CQ ? ?] AP27
// rc=2 [CQ ? ] AP44
// rc=3 [CALL ? ?] AP29
// rc=4 [CALL ? ] AP45
// rc=5 [CALL CALL ?] AP57
// int ncall=0xf70c238; //K1ABC
int ncall=0x890c60c; //KA1ABC
int i;

View File

@ -1,79 +1,119 @@
program QRA65code
! Provides examples of message packing, bit and symbol ordering,
! Reed Solomon encoding, and other necessary details of the QRA65
! QRA (63,12) encoding, and other necessary details of the QRA65
! protocol.
! Return codes from qra65_dec:
! irc=0 [? ? ?] AP0 (decoding with no a-priori information)
! irc=1 [CQ ? ?] AP27
! irc=2 [CQ ? ] AP44
! irc=3 [CALL ? ?] AP29
! irc=4 [CALL ? ] AP45
! irc=5 [CALL CALL ?] AP57
use packjt
character*22 msg,msg0,msg1,decoded,cok*3,bad*1,msgtype*10
character*22 msg,msg0,msg1,decoded,cok*3,bad*1,msgtype*10,arg*12
integer dgen(12),sent(63),dec(12)
real s3(0:63,1:63)
include 'testmsg.f90'
nargs=iargc()
if(nargs.ne.1) then
print*,'Usage: qra65code "message"'
print*,' qra65code -t'
if(nargs.lt.1) then
print*,'Usage: qra65code "message" [snr2500] [Nrpt]'
print*,' qra65code -t [snr2500]'
go to 999
endif
call getarg(1,msg) !Get message from command line
snr2500=10.0
if(nargs.ge.2) then
call getarg(2,arg)
read(arg,*) snr2500
endif
sig=sqrt(2.0)*10.0**(0.05*(snr2500+29.7))
nmsg=1
if(msg(1:2).eq."-t") nmsg=NTEST
nrpt=1
if(msg(1:2).eq."-t") then
nmsg=NTEST
else
if(nargs.ge.3) then
call getarg(3,arg)
read(arg,*) nrpt
endif
endif
write(*,1010)
1010 format(" Message Decoded Err? Type rc"/77("-"))
do imsg=1,nmsg
if(nmsg.gt.1) msg=testmsg(imsg)
ngood=0
nbad=0
do nn=1,nrpt
do imsg=1,nmsg
if(nmsg.gt.1) msg=testmsg(imsg)
call fmtmsg(msg,iz) !To upper, collapse mult blanks
msg0=msg !Input message
call chkmsg(msg,cok,nspecial,flip) !See if it includes "OOO" report
msg1=msg !Message without "OOO"
call packmsg(msg1,dgen,itype) !Pack message into 12 six-bit bytes
msgtype=""
if(itype.eq.1) msgtype="Std Msg"
if(itype.eq.2) msgtype="Type 1 pfx"
if(itype.eq.3) msgtype="Type 1 sfx"
if(itype.eq.4) msgtype="Type 2 pfx"
if(itype.eq.5) msgtype="Type 2 sfx"
if(itype.eq.6) msgtype="Free text"
call fmtmsg(msg,iz) !To upper, collapse mult blanks
msg0=msg !Input message
call chkmsg(msg,cok,nspecial,flip) !See if it includes "OOO" report
msg1=msg !Message without "OOO"
call packmsg(msg1,dgen,itype) !Pack message into 12 six-bit bytes
msgtype=""
if(itype.eq.1) msgtype="Std Msg"
if(itype.eq.2) msgtype="Type 1 pfx"
if(itype.eq.3) msgtype="Type 1 sfx"
if(itype.eq.4) msgtype="Type 2 pfx"
if(itype.eq.5) msgtype="Type 2 sfx"
if(itype.eq.6) msgtype="Free text"
call qra65_enc(dgen,sent) !Encode using QRA65
call qra65_enc(dgen,sent) !Encode using QRA65
! Generate a simulated s3() array with moderately high S/N
s3=1.0
do j=1,63
do i=0,63
s3(i,j)=1.0 + 0.1*gran()
do j=1,63
do i=0,63
x=gran()
y=gran()
s3(i,j)=x*x + y*y
enddo
k=sent(j)
x=gran() + sig
y=gran()
s3(k,j)=x*x + y*y
enddo
k=sent(j)
s3(k,j)=s3(k,j) + 1.2
call qra65_dec(s3,dec,irc) !Decode
decoded=" "
if(irc.ge.0) then
call unpackmsg(dec,decoded) !Unpack the user message
call fmtmsg(decoded,iz)
else
dec=0
endif
if(decoded.eq.msg0) then
ngood=ngood+1
else
if(irc.ge.0) nbad=nbad+1
endif
ii=imsg
if(nrpt.gt.1) ii=nn
write(*,1020) ii,msg0,decoded,itype,msgtype,irc
1020 format(i3,2x,a22,2x,a22,4x,i3,": ",a13,i3)
enddo
call qra65_dec(s3,dec,irc) !Decode
decoded=" "
if(irc.ge.0) then
call unpackmsg(dec,decoded) !Unpack the user message
call fmtmsg(decoded,iz)
endif
if(nmsg.eq.1 .and.nrpt.eq.1) then
write(*,1030) dgen
1030 format(/'Packed message, 6-bit symbols ',12i3) !Display packed symbols
bad=" "
if(decoded.ne.msg0) bad="*"
write(*,1020) imsg,msg0,decoded,bad,itype,msgtype,irc
1020 format(i2,'.',2x,a22,2x,a22,3x,a1,i3,": ",a13,i3)
write(*,1040) sent
1040 format(/'Information-carrying channel symbols'/(i5,20i3))
write(*,1050) dec
1050 format(/'Received message, 6-bit symbols ',12i3) !Display packed symbols
endif
enddo
if(nmsg.eq.1) then
write(*,1030) dgen
1030 format(/'Packed message, 6-bit symbols ',12i3) !Display packed symbols
write(*,1040) sent
1040 format(/'Information-carrying channel symbols'/(i5,20i3))
write(*,1050) dec
1050 format(/'Received message, 6-bit symbols ',12i3) !Display packed symbols
if(nrpt.gt.1) then
write(*,1060) ngood,nrpt,nbad
1060 format('Decoded messages: ',i3,'/',i3,' Undetected errors:',i4)
endif
999 end program QRA65code

View File

@ -823,10 +823,12 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
//###
{
QString t=m_config.my_callsign();
if(t!="IV3NWV" and t!="K1JT" and t!="K9AN" and t!="G4WJS" and t!="IW0HDV") {
if(t!="IV3NWV" and t!="K1JT" and t!="K9AN" and t!="G4WJS"
and t!="IW0HDV" and t!="VE1SKY") {
ui->actionQRA65->setChecked(false);
ui->actionQRA65->setEnabled(false);
}
ui->actionMSK144->setChecked(false);
ui->actionMSK144->setEnabled(false); }
}
//###
// this must be the last statement of constructor