Add control of decoding "depth".

Improve the way pctile gets an estimate of array median.
Put info for mettab() into a data statement.
Attempt decoding near all freqs that give sync >= 1.0
Remove killbyname


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2707 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-31 18:33:56 +00:00
parent 05c3dadc99
commit 15edace930
10 changed files with 126 additions and 63 deletions

Binary file not shown.

View File

@ -1,4 +1,4 @@
subroutine decode9(i1SoftSymbols,msg)
subroutine decode9(i1SoftSymbols,limit,nlim,msg)
! Decoder for JT9
! Input: i1SoftSymbols(207) - Single-bit soft symbols
@ -11,11 +11,46 @@ subroutine decode9(i1SoftSymbols,msg)
integer*1 i1SoftSymbols(207)
integer*1 i1DecodedBits(72)
real*4 xx0(0:255)
integer*1 i1
logical first
integer*4 mettab(0:255,0:1)
equivalence (i1,i4)
data first/.true./
data xx0/ &
1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
0.988, 1.000, 0.991, 0.993, 1.000, 0.995, 1.000, 0.991, &
1.000, 0.991, 0.992, 0.991, 0.990, 0.990, 0.992, 0.996, &
0.990, 0.994, 0.993, 0.991, 0.992, 0.989, 0.991, 0.987, &
0.985, 0.989, 0.984, 0.983, 0.979, 0.977, 0.971, 0.975, &
0.974, 0.970, 0.970, 0.970, 0.967, 0.962, 0.960, 0.957, &
0.956, 0.953, 0.942, 0.946, 0.937, 0.933, 0.929, 0.920, &
0.917, 0.911, 0.903, 0.895, 0.884, 0.877, 0.869, 0.858, &
0.846, 0.834, 0.821, 0.806, 0.790, 0.775, 0.755, 0.737, &
0.713, 0.691, 0.667, 0.640, 0.612, 0.581, 0.548, 0.510, &
0.472, 0.425, 0.378, 0.328, 0.274, 0.212, 0.146, 0.075, &
0.000,-0.079,-0.163,-0.249,-0.338,-0.425,-0.514,-0.606, &
-0.706,-0.796,-0.895,-0.987,-1.084,-1.181,-1.280,-1.376, &
-1.473,-1.587,-1.678,-1.790,-1.882,-1.992,-2.096,-2.201, &
-2.301,-2.411,-2.531,-2.608,-2.690,-2.829,-2.939,-3.058, &
-3.164,-3.212,-3.377,-3.463,-3.550,-3.768,-3.677,-3.975, &
-4.062,-4.098,-4.186,-4.261,-4.472,-4.621,-4.623,-4.608, &
-4.822,-4.870,-4.652,-4.954,-5.108,-5.377,-5.544,-5.995, &
-5.632,-5.826,-6.304,-6.002,-6.559,-6.369,-6.658,-7.016, &
-6.184,-7.332,-6.534,-6.152,-6.113,-6.288,-6.426,-6.313, &
-9.966,-6.371,-9.966,-7.055,-9.966,-6.629,-6.313,-9.966, &
-5.858,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966, &
-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966, &
-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966, &
-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966, &
-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966, &
-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966,-9.966/
save
if(first) then
@ -23,23 +58,21 @@ subroutine decode9(i1SoftSymbols,msg)
! bias=0.37 !To be optimized, in decoder program
bias=0.0 !Seems better, in jt9.exe ???
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. ###
mettab(i,0)=nint(scale*(xx0(i)-bias))
if(i.ge.1) mettab(256-i,1)=mettab(i,0)
enddo
close(19)
close(19)
first=.false.
endif
msg=' '
nbits=72
ndelta=17
limit=100000
call fano232(i1SoftSymbols,nbits+31,mettab,ndelta,limit,i1DecodedBytes, &
ncycles,metric,ierr)
nlim=ncycles/nbits
if(ncycles.lt.(nbits*limit)) then
nbytes=(nbits+7)/8
do i=1,nbytes

View File

@ -1,4 +1,4 @@
subroutine decoder(ntrSeconds,nRxLog,c0)
subroutine decoder(ntrSeconds,ndepth,nRxLog,c0)
! Decoder for JT9. Can run stand-alone, reading data from *.wav files;
! or as the back end of wsjt-x, with data placed in a shared memory region.
@ -24,6 +24,9 @@ subroutine decoder(ntrSeconds,nRxLog,c0)
newdat=1
nsynced=0
ndecoded=0
limit=1000
if(ndepth.ge.2) limit=20000
if(ndepth.ge.3) limit=100000
nsps=0
if(ntrMinutes.eq.1) then
@ -67,9 +70,9 @@ subroutine decoder(ntrSeconds,nRxLog,c0)
sbest=0.
do i=ia,ib
f=(i-1)*df3
if((i.eq.ipk .or. ccfred(i).ge.10.0) .and. f.gt.fgood+10.0*df8) then
if((i.eq.ipk .or. ccfred(i).ge.3.0) .and. f.gt.fgood+10.0*df8) then
call spec9(c0,npts8,nsps,f,fpk,xdt,i1SoftSymbols)
call decode9(i1SoftSymbols,msg)
call decode9(i1SoftSymbols,limit,nlim,msg)
snr=10.0*log10(ccfred(i)) - 10.0*log10(2500.0/df3) + 2.0
sync=ccfred(i) - 2.0
if(sync.lt.0.0) sync=0.0

View File

@ -3,7 +3,22 @@ subroutine pctile(x,npts,npct,xmedian)
real x(npts)
integer hist(0:1000)
if(npts.le.0) then
xmedian=1.0
go to 900
endif
ave=sum(x)/npts
s=0.
ns=0
do i=1,npts
if(x(i).lt.3.0*ave) then
s=s+x(i)
ns=ns+1
endif
enddo
ave=s/ns
hist=0
do i=1,npts
j=nint(100.0*x(i)/ave)
@ -20,6 +35,8 @@ subroutine pctile(x,npts,npct,xmedian)
enddo
xmedian=j*ave/100.0
if(j.lt.10) xmedian=1.0
900 continue
return
end subroutine pctile

View File

@ -45,6 +45,7 @@ subroutine sync9(ss,tstep,df3,ntol,nfqso,ccfred,ia,ib,ipkbest)
enddo
call pctile(ccfred(ia),ib-ia+1,50,xmed)
if(xmed.le.1.0) xmed=1.0
ccfred=ccfred/xmed
return

View File

@ -1,4 +1,4 @@
//-------------------------------------------------------------- MainWindow
//--------------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "devsetup.h"
@ -55,9 +55,9 @@ MainWindow::MainWindow(QWidget *parent) :
ui->actionSave_all->setActionGroup(saveGroup);
QActionGroup* DepthGroup = new QActionGroup(this);
ui->actionNo_Deep_Search->setActionGroup(DepthGroup);
ui->actionNormal_Deep_Search->setActionGroup(DepthGroup);
ui->actionAggressive_Deep_Search->setActionGroup(DepthGroup);
ui->actionQuickDecode->setActionGroup(DepthGroup);
ui->actionMediumDecode->setActionGroup(DepthGroup);
ui->actionDeepestDecode->setActionGroup(DepthGroup);
QButtonGroup* txMsgButtonGroup = new QButtonGroup;
txMsgButtonGroup->addButton(ui->txrb1,1);
@ -113,6 +113,7 @@ MainWindow::MainWindow(QWidget *parent) :
m_NB=false;
m_mode="JT9-1";
m_TRperiod=60;
decodeBusy(false);
ui->xThermo->setFillBrush(Qt::green);
@ -193,10 +194,6 @@ MainWindow::~MainWindow()
soundOutThread.quitExecution=true;
soundOutThread.wait(3000);
}
if(!m_decoderBusy) {
QFile lockFile(m_appDir + "/.lock");
lockFile.remove();
}
delete ui;
}
@ -307,9 +304,9 @@ void MainWindow::readSettings()
on_actionLinrad_triggered();
ui->actionLinrad->setChecked(true);
}
if(m_ndepth==0) ui->actionNo_Deep_Search->setChecked(true);
if(m_ndepth==1) ui->actionNormal_Deep_Search->setChecked(true);
if(m_ndepth==2) ui->actionAggressive_Deep_Search->setChecked(true);
if(m_ndepth==1) ui->actionQuickDecode->setChecked(true);
if(m_ndepth==2) ui->actionMediumDecode->setChecked(true);
if(m_ndepth==3) ui->actionDeepestDecode->setChecked(true);
}
//-------------------------------------------------------------- dataSink()
@ -780,21 +777,6 @@ void MainWindow::on_actionNo_shorthands_if_Tx1_triggered()
stub();
}
void MainWindow::on_actionNo_Deep_Search_triggered() //No Deep Search
{
m_ndepth=0;
}
void MainWindow::on_actionNormal_Deep_Search_triggered() //Normal DS
{
m_ndepth=1;
}
void MainWindow::on_actionAggressive_Deep_Search_triggered() //Aggressive DS
{
m_ndepth=2;
}
void MainWindow::on_actionNone_triggered() //Save None
{
m_saveSynced=false;
@ -880,7 +862,8 @@ void MainWindow::decode() //decode()
jt9com_.ntol=m_tol;
if(jt9com_.nutc < m_nutc0) m_RxLog |= 1; //Date and Time to wsjtx_rx.log
m_nutc0=jt9com_.nutc;
*future3 = QtConcurrent::run(decoder_, &m_TRperiod, &m_RxLog, &c0[0]);
*future3 = QtConcurrent::run(decoder_, &m_TRperiod, &m_ndepth,
&m_RxLog, &c0[0]);
watcher3->setFuture(*future3);
}
@ -1560,3 +1543,21 @@ void MainWindow::on_pbTxFreq_clicked()
m_txFreq=ntx;
ui->TxFreqSpinBox->setValue(ntx);
}
void MainWindow::on_actionQuickDecode_triggered()
{
m_ndepth=1;
ui->actionQuickDecode->setChecked(true);
}
void MainWindow::on_actionMediumDecode_triggered()
{
m_ndepth=2;
ui->actionMediumDecode->setChecked(true);
}
void MainWindow::on_actionDeepestDecode_triggered()
{
m_ndepth=3;
ui->actionDeepestDecode->setChecked(true);
}

View File

@ -68,9 +68,6 @@ private slots:
void on_actionDelete_all_wav_files_in_SaveDir_triggered();
void on_actionF4_sets_Tx6_triggered();
void on_actionNo_shorthands_if_Tx1_triggered();
void on_actionNo_Deep_Search_triggered();
void on_actionNormal_Deep_Search_triggered();
void on_actionAggressive_Deep_Search_triggered();
void on_actionNone_triggered();
void on_actionSave_all_triggered();
void on_actionKeyboard_shortcuts_triggered();
@ -113,6 +110,12 @@ private slots:
void on_actionSave_decoded_triggered();
void on_actionQuickDecode_triggered();
void on_actionMediumDecode_triggered();
void on_actionDeepestDecode_triggered();
private:
Ui::MainWindow *ui;
qint32 m_nDevIn;
@ -232,7 +235,7 @@ void symspec_(int* k, int* ntrperiod, int* nsps, int* nb, int* m_NBslider,
void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2);
void decoder_(int* ntrperiod, int* mRxLog, float c0[]);
void decoder_(int* ntrperiod, int* ndepth, int* mRxLog, float c0[]);
}
#endif // MAINWINDOW_H

View File

@ -1179,7 +1179,9 @@ p, li { white-space: pre-wrap; }
<property name="title">
<string>Decode</string>
</property>
<addaction name="actionNo_Deep_Search"/>
<addaction name="actionQuickDecode"/>
<addaction name="actionMediumDecode"/>
<addaction name="actionDeepestDecode"/>
</widget>
<widget class="QMenu" name="menuSave">
<property name="title">
@ -1350,31 +1352,15 @@ p, li { white-space: pre-wrap; }
<string>No shorthand decodes if Tx1</string>
</property>
</action>
<action name="actionNo_Deep_Search">
<action name="actionQuickDecode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="text">
<string>TBD...</string>
</property>
</action>
<action name="actionNormal_Deep_Search">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Normal Deep Search</string>
</property>
</action>
<action name="actionAggressive_Deep_Search">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Aggressive Deep Search</string>
<string>Quick</string>
</property>
</action>
<action name="actionNone">
@ -1606,6 +1592,25 @@ p, li { white-space: pre-wrap; }
<string>Save decoded</string>
</property>
</action>
<action name="actionMediumDecode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Medium</string>
</property>
</action>
<action name="actionDeepestDecode">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Deepest</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

View File

@ -1,6 +1,6 @@
[Setup]
AppName=wsjtx
AppVerName=wsjtx Version 0.2 r2705
AppVerName=wsjtx Version 0.2 r2706
AppCopyright=Copyright (C) 2001-2012 by Joe Taylor, K1JT
DefaultDirName=c:\wsjtx
DefaultGroupName=wsjtx

View File

@ -38,7 +38,7 @@ SOURCES += main.cpp mainwindow.cpp plotter.cpp about.cpp \
displaytext.cpp getdev.cpp
win32 {
SOURCES += killbyname.cpp
SOURCES +=
}
HEADERS += mainwindow.h plotter.h soundin.h soundout.h \