Updates to Users Guide.

Double-click on waterfall sets Tol to a reduced (mode-dependent) value.
Tol is saved/restored on program restart.
Added digital gain slider for setting input level.
Garbage decode "15P6715P67WCV" is rejected.
Arrays ss and c0 are copied and saved when newdat=1.  Further processing is
done on the copies.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2712 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-11-01 19:54:40 +00:00
parent 07c009c837
commit c19460de27
14 changed files with 94 additions and 29 deletions

Binary file not shown.

View File

@ -24,6 +24,7 @@ void getfile(QString fname, int ntrperiod)
fread(jt9com_.d2,1,44,fp);
int nrd=fread(jt9com_.d2,2,npts,fp);
fclose(fp);
jt9com_.newdat=1;
}
}

View File

@ -83,6 +83,7 @@ subroutine decode9(i1SoftSymbols,limit,nlim,msg)
call packbits(i1DecodedBits,12,6,i4Decoded6BitWords)
call unpackmsg(i4Decoded6BitWords,msg) !Unpack decoded msg
if(index(msg,'000AAA ').gt.0) msg=' '
if(index(msg,'15P6715P67WCV').gt.0) msg=' '
endif
return

View File

@ -1,4 +1,4 @@
subroutine decoder(ntrSeconds,ndepth,nRxLog,c0)
subroutine decoder(ntrSeconds,ndepth,nRxLog,c00)
! 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.
@ -13,13 +13,21 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c0)
real*4 ccfred(NSMAX)
integer*1 i1SoftSymbols(207)
integer*2 id2
complex c0(NDMAX)
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, &
ntr,nfqso,nagain,newdat,npts8,nfb,ntol,kin,nsynced,ndecoded
complex c0(NDMAX),c00(NDMAX)
common/jt9com/ss0(184,NSMAX),savg(NSMAX),id2(NMAX),nutc0,ndiskdat, &
ntr,nfqso,nagain,newdat,npts80,nfb,ntol,kin,nsynced,ndecoded
common/jt9comB/ss(184,NSMAX),c0
logical first
data first/.true./
save
if(newdat.ne.0) then
ss=ss0
c0=c00
nutc=nutc0
npts8=npts80
endif
ntrMinutes=ntrSeconds/60
newdat=1
nsynced=0

View File

@ -140,15 +140,15 @@ program jt9sim
enddo
call unpackbits(i4DataSymNoGray,69,3,i1ScrambledBits)
call interleave9(i1ScrambledBits,-1,i1Bits)
do i=1,206
i4=-10
if(i1Bits(i).eq.1) i4=10
i4=i4+128
i1SoftSymbols(i)=i1
enddo
call decode9(i1SoftSymbols,msg)
limit=1000
call decode9(i1SoftSymbols,limit,nlim,msg)
if(msg.ne.msg0) print*,'Decode error: ',msg0,' ',msg
endif
enddo

View File

@ -1,4 +1,4 @@
subroutine symspec(k,ntrperiod,nsps,nb,nbslider,pxdb,s,red, &
subroutine symspec(k,ntrperiod,nsps,ingain,nb,nbslider,pxdb,s,red, &
df3,ihsym,nzap,slimit,lstrong,c0,npts8)
! Input:
@ -82,10 +82,11 @@ subroutine symspec(k,ntrperiod,nsps,nb,nbslider,pxdb,s,red, &
if(nwindow.ne.0) kstep1=NFFT1/2
fac=2.0/NFFT1
nblks=(k-k1)/kstep1
gain=10.0**(0.05*ingain)
do nblk=1,nblks
j=k1+1
do i=1,NFFT1
x0(i)=id2(k1+i)
x0(i)=gain*id2(k1+i)
enddo
call timf2(x0,k,NFFT1,nwindow,nb,peaklimit,x1, &
slimit,lstrong,px,nzap)

View File

@ -113,6 +113,8 @@ MainWindow::MainWindow(QWidget *parent) :
m_NB=false;
m_mode="JT9-1";
m_TRperiod=60;
m_inGain=0;
m_dataAvailable=false;
decodeBusy(false);
ui->xThermo->setFillBrush(Qt::green);
@ -159,8 +161,11 @@ MainWindow::MainWindow(QWidget *parent) :
m_monitoring=true; // Start with Monitoring ON
soundInThread.setMonitoring(m_monitoring);
m_diskData=false;
m_tol=50;
g_pWideGraph->setTol(m_tol);
static int ntol[] = {1,2,5,10,20,50,100,200,500,1000};
for (int i=0; i<10; i++) {
if(ntol[i]==m_tol) ui->tolSpinBox->setValue(i);
}
// Create "m_worked", a dictionary of all calls in wsjt.log
QFile f("wsjt.log");
@ -240,6 +245,8 @@ void MainWindow::writeSettings()
settings.setValue("NB",m_NB);
settings.setValue("NBslider",m_NBslider);
settings.setValue("TxFreq",m_txFreq);
settings.setValue("Tol",m_tol);
settings.setValue("InGain",m_inGain);
settings.endGroup();
}
@ -296,6 +303,9 @@ void MainWindow::readSettings()
m_saveDecoded=ui->actionSave_decoded->isChecked();
m_saveAll=ui->actionSave_all->isChecked();
m_ndepth=settings.value("NDepth",0).toInt();
m_tol=settings.value("Tol",5).toInt();
m_inGain=settings.value("InGain",0).toInt();
ui->inGain->setValue(m_inGain);
ui->actionF4_sets_Tx6->setChecked(m_kb8rq);
settings.endGroup();
@ -340,7 +350,7 @@ void MainWindow::dataSink(int k)
nb=0;
if(m_NB) nb=1;
trmin=m_TRperiod/60;
symspec_(&k, &trmin, &m_nsps, &nb, &m_NBslider, &px, s, red,
symspec_(&k, &trmin, &m_nsps, &m_inGain, &nb, &m_NBslider, &px, s, red,
&df3, &ihsym, &nzap, &slimit, lstrong, c0, &npts8);
if(ihsym <=0) return;
QString t;
@ -380,6 +390,7 @@ void MainWindow::dataSink(int k)
}
// This is a bit strange. Why do we need the "-3" ???
if(ihsym == m_hsymStop-3) {
m_dataAvailable=true;
jt9com_.npts8=(ihsym*m_nsps)/16;
jt9com_.newdat=1;
jt9com_.nagain=0;
@ -731,6 +742,7 @@ void MainWindow::diskWriteFinished() //diskWriteFinished
void MainWindow::decoderFinished() //decoderFinished
{
jt9com_.newdat=0;
QFile f("decoded.txt");
f.open(QIODevice::ReadOnly);
QTextStream in(&f);
@ -834,15 +846,26 @@ void MainWindow::on_DecodeButton_clicked() //Decode request
void MainWindow::freezeDecode(int n) //freezeDecode()
{
static int ntol[] = {1,2,5,10,20,50,100,200,500,1000};
if(!m_decoderBusy) {
jt9com_.newdat=0;
jt9com_.nagain=1;
int i;
if(m_mode=="JT9-1") i=4;
if(m_mode=="JT9-2") i=4;
if(m_mode=="JT9-5") i=3;
if(m_mode=="JT9-10") i=2;
if(m_mode=="JT9-30") i=1;
m_tol=ntol[i];
g_pWideGraph->setTol(m_tol);
ui->tolSpinBox->setValue(i);
decode();
}
}
void MainWindow::decode() //decode()
{
if(!m_dataAvailable) return;
decodeBusy(true);
ui->DecodeButton->setStyleSheet(m_pbdecoding_style1);
@ -855,8 +878,6 @@ void MainWindow::decode() //decode()
jt9com_.nutc=100*ihr + imin;
}
// jt9com_.newdat=1;
// jt9com_.nagain=0;
jt9com_.nfqso=g_pWideGraph->QSOfreq();
m_tol=g_pWideGraph->Tol();
jt9com_.ntol=m_tol;
@ -1561,3 +1582,8 @@ void MainWindow::on_actionDeepestDecode_triggered()
m_ndepth=3;
ui->actionDeepestDecode->setChecked(true);
}
void MainWindow::on_inGain_valueChanged(int n)
{
m_inGain=n;
}

View File

@ -105,16 +105,12 @@ private slots:
void on_NBslider_valueChanged(int value);
void on_TxFreqSpinBox_valueChanged(int arg1);
void on_pbTxFreq_clicked();
void on_actionSave_synced_triggered();
void on_actionSave_decoded_triggered();
void on_actionQuickDecode_triggered();
void on_actionMediumDecode_triggered();
void on_actionDeepestDecode_triggered();
void on_inGain_valueChanged(int n);
private:
Ui::MainWindow *ui;
@ -142,6 +138,7 @@ private:
qint32 m_nsps;
qint32 m_hsymStop;
qint32 m_len1;
qint32 m_inGain;
bool m_monitoring;
bool m_transmitting;
@ -161,6 +158,7 @@ private:
bool m_kb8rq;
bool m_NB;
bool m_call3Modified;
bool m_dataAvailable;
char m_decoded[80];
@ -228,10 +226,10 @@ extern int ptt(int nport, int itx, int* iptt);
extern "C" {
//----------------------------------------------------- C and Fortran routines
void symspec_(int* k, int* ntrperiod, int* nsps, int* nb, int* m_NBslider,
float* px, float s[], float red[], float* df3, int* nhsym,
int* nzap, float* slimit, uchar lstrong[], float c0[],
int* npts8);
void symspec_(int* k, int* ntrperiod, int* nsps, int* ingain, int* nb,
int* m_NBslider, float* px, float s[], float red[],
float* df3, int* nhsym, int* nzap, float* slimit,
uchar lstrong[], float c0[], int* npts8);
void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2);

View File

@ -40,7 +40,7 @@
<rect>
<x>11</x>
<y>2</y>
<width>565</width>
<width>571</width>
<height>423</height>
</rect>
</property>
@ -287,6 +287,25 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="inGain">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>190</height>
</size>
</property>
<property name="minimum">
<number>-50</number>
</property>
<property name="maximum">
<number>50</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>

View File

@ -382,6 +382,11 @@ void CPlotter::setTol(int n) //setTol()
DrawOverlay();
}
int CPlotter::Tol() //Tol()
{
return m_tol;
}
void CPlotter::setBinsPerPixel(int n) // set nbpp
{
m_binsPerPixel = n;

View File

@ -35,7 +35,6 @@ public:
qint32 m_nSpan;
qint32 m_binsPerPixel;
qint32 m_fQSO;
qint32 m_tol;
qint32 m_fCal;
qint32 m_w;
@ -52,6 +51,7 @@ public:
void UpdateOverlay();
void setDataFromDisk(bool b);
void setTol(int n);
int Tol();
void setBinsPerPixel(int n);
int binsPerPixel();
void setFQSO(int n, bool bf);
@ -114,6 +114,7 @@ private:
qint32 m_h;
qint32 m_h1;
qint32 m_h2;
qint32 m_tol;
private slots:
void mousePressEvent(QMouseEvent *event);

View File

@ -29,6 +29,7 @@ typedef struct
{
int kin; //Parameters sent to/from the portaudio callback function
bool bzero;
bool monitoring;
} paUserData;
//--------------------------------------------------------------- a2dCallback
@ -61,7 +62,9 @@ extern "C" int a2dCallback( const void *inputBuffer, void *outputBuffer,
nbytes=2*framesToProcess; //Bytes per frame
k=udata->kin;
memcpy(&jt9com_.d2[k],inputBuffer,nbytes); //Copy all samples to d2
if(udata->monitoring) {
memcpy(&jt9com_.d2[k],inputBuffer,nbytes); //Copy all samples to d2
}
udata->kin += framesToProcess;
jt9com_.kin=udata->kin;
@ -80,6 +83,7 @@ void SoundInThread::run() //SoundInThread::run()
udata.kin=0; //Buffer pointer
udata.bzero=false; //Flag to request reset of kin
udata.monitoring=m_monitoring;
inParam.device=m_nDevIn; //### Input Device Number ###
inParam.channelCount=1; //Number of analog channels
@ -99,7 +103,7 @@ void SoundInThread::run() //SoundInThread::run()
FRAMES_PER_BUFFER, //Frames per buffer
// paClipOff+paDitherOff, //No clipping or dithering
paClipOff, //No clipping
a2dCallback, //Input callbeck routine
a2dCallback, //Input callback routine
&udata); //userdata
paerr=Pa_StartStream(inStream);
@ -121,6 +125,7 @@ void SoundInThread::run() //SoundInThread::run()
while (!qe) {
qe = quitExecution;
if (qe) break;
udata.monitoring=m_monitoring;
qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000;
nsec = ms/1000; // Time according to this computer
ntr = nsec % m_TRperiod;

View File

@ -214,14 +214,14 @@ void WideGraph::wideFreezeDecode(int n)
void WideGraph::setTol(int n)
{
ui->widePlot->m_tol=n;
ui->widePlot->setTol(n);
ui->widePlot->DrawOverlay();
ui->widePlot->update();
}
int WideGraph::Tol()
{
return ui->widePlot->m_tol;
return ui->widePlot->Tol();
}
void WideGraph::setFcal(int n)

View File

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