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 38867d68fb
commit a84c3a8c5d
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); fread(jt9com_.d2,1,44,fp);
int nrd=fread(jt9com_.d2,2,npts,fp); int nrd=fread(jt9com_.d2,2,npts,fp);
fclose(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 packbits(i1DecodedBits,12,6,i4Decoded6BitWords)
call unpackmsg(i4Decoded6BitWords,msg) !Unpack decoded msg call unpackmsg(i4Decoded6BitWords,msg) !Unpack decoded msg
if(index(msg,'000AAA ').gt.0) msg=' ' if(index(msg,'000AAA ').gt.0) msg=' '
if(index(msg,'15P6715P67WCV').gt.0) msg=' '
endif endif
return 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; ! 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. ! 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) real*4 ccfred(NSMAX)
integer*1 i1SoftSymbols(207) integer*1 i1SoftSymbols(207)
integer*2 id2 integer*2 id2
complex c0(NDMAX) complex c0(NDMAX),c00(NDMAX)
common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, & common/jt9com/ss0(184,NSMAX),savg(NSMAX),id2(NMAX),nutc0,ndiskdat, &
ntr,nfqso,nagain,newdat,npts8,nfb,ntol,kin,nsynced,ndecoded ntr,nfqso,nagain,newdat,npts80,nfb,ntol,kin,nsynced,ndecoded
common/jt9comB/ss(184,NSMAX),c0
logical first logical first
data first/.true./ data first/.true./
save save
if(newdat.ne.0) then
ss=ss0
c0=c00
nutc=nutc0
npts8=npts80
endif
ntrMinutes=ntrSeconds/60 ntrMinutes=ntrSeconds/60
newdat=1 newdat=1
nsynced=0 nsynced=0

View File

@ -140,15 +140,15 @@ program jt9sim
enddo enddo
call unpackbits(i4DataSymNoGray,69,3,i1ScrambledBits) call unpackbits(i4DataSymNoGray,69,3,i1ScrambledBits)
call interleave9(i1ScrambledBits,-1,i1Bits) call interleave9(i1ScrambledBits,-1,i1Bits)
do i=1,206 do i=1,206
i4=-10 i4=-10
if(i1Bits(i).eq.1) i4=10 if(i1Bits(i).eq.1) i4=10
i4=i4+128 i4=i4+128
i1SoftSymbols(i)=i1 i1SoftSymbols(i)=i1
enddo enddo
limit=1000
call decode9(i1SoftSymbols,msg) call decode9(i1SoftSymbols,limit,nlim,msg)
if(msg.ne.msg0) print*,'Decode error: ',msg0,' ',msg if(msg.ne.msg0) print*,'Decode error: ',msg0,' ',msg
endif endif
enddo 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) df3,ihsym,nzap,slimit,lstrong,c0,npts8)
! Input: ! Input:
@ -82,10 +82,11 @@ subroutine symspec(k,ntrperiod,nsps,nb,nbslider,pxdb,s,red, &
if(nwindow.ne.0) kstep1=NFFT1/2 if(nwindow.ne.0) kstep1=NFFT1/2
fac=2.0/NFFT1 fac=2.0/NFFT1
nblks=(k-k1)/kstep1 nblks=(k-k1)/kstep1
gain=10.0**(0.05*ingain)
do nblk=1,nblks do nblk=1,nblks
j=k1+1 j=k1+1
do i=1,NFFT1 do i=1,NFFT1
x0(i)=id2(k1+i) x0(i)=gain*id2(k1+i)
enddo enddo
call timf2(x0,k,NFFT1,nwindow,nb,peaklimit,x1, & call timf2(x0,k,NFFT1,nwindow,nb,peaklimit,x1, &
slimit,lstrong,px,nzap) slimit,lstrong,px,nzap)

View File

@ -113,6 +113,8 @@ MainWindow::MainWindow(QWidget *parent) :
m_NB=false; m_NB=false;
m_mode="JT9-1"; m_mode="JT9-1";
m_TRperiod=60; m_TRperiod=60;
m_inGain=0;
m_dataAvailable=false;
decodeBusy(false); decodeBusy(false);
ui->xThermo->setFillBrush(Qt::green); ui->xThermo->setFillBrush(Qt::green);
@ -159,8 +161,11 @@ MainWindow::MainWindow(QWidget *parent) :
m_monitoring=true; // Start with Monitoring ON m_monitoring=true; // Start with Monitoring ON
soundInThread.setMonitoring(m_monitoring); soundInThread.setMonitoring(m_monitoring);
m_diskData=false; m_diskData=false;
m_tol=50;
g_pWideGraph->setTol(m_tol); 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 // Create "m_worked", a dictionary of all calls in wsjt.log
QFile f("wsjt.log"); QFile f("wsjt.log");
@ -240,6 +245,8 @@ void MainWindow::writeSettings()
settings.setValue("NB",m_NB); settings.setValue("NB",m_NB);
settings.setValue("NBslider",m_NBslider); settings.setValue("NBslider",m_NBslider);
settings.setValue("TxFreq",m_txFreq); settings.setValue("TxFreq",m_txFreq);
settings.setValue("Tol",m_tol);
settings.setValue("InGain",m_inGain);
settings.endGroup(); settings.endGroup();
} }
@ -296,6 +303,9 @@ void MainWindow::readSettings()
m_saveDecoded=ui->actionSave_decoded->isChecked(); m_saveDecoded=ui->actionSave_decoded->isChecked();
m_saveAll=ui->actionSave_all->isChecked(); m_saveAll=ui->actionSave_all->isChecked();
m_ndepth=settings.value("NDepth",0).toInt(); 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); ui->actionF4_sets_Tx6->setChecked(m_kb8rq);
settings.endGroup(); settings.endGroup();
@ -340,7 +350,7 @@ void MainWindow::dataSink(int k)
nb=0; nb=0;
if(m_NB) nb=1; if(m_NB) nb=1;
trmin=m_TRperiod/60; 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); &df3, &ihsym, &nzap, &slimit, lstrong, c0, &npts8);
if(ihsym <=0) return; if(ihsym <=0) return;
QString t; QString t;
@ -380,6 +390,7 @@ void MainWindow::dataSink(int k)
} }
// This is a bit strange. Why do we need the "-3" ??? // This is a bit strange. Why do we need the "-3" ???
if(ihsym == m_hsymStop-3) { if(ihsym == m_hsymStop-3) {
m_dataAvailable=true;
jt9com_.npts8=(ihsym*m_nsps)/16; jt9com_.npts8=(ihsym*m_nsps)/16;
jt9com_.newdat=1; jt9com_.newdat=1;
jt9com_.nagain=0; jt9com_.nagain=0;
@ -731,6 +742,7 @@ void MainWindow::diskWriteFinished() //diskWriteFinished
void MainWindow::decoderFinished() //decoderFinished void MainWindow::decoderFinished() //decoderFinished
{ {
jt9com_.newdat=0;
QFile f("decoded.txt"); QFile f("decoded.txt");
f.open(QIODevice::ReadOnly); f.open(QIODevice::ReadOnly);
QTextStream in(&f); QTextStream in(&f);
@ -834,15 +846,26 @@ void MainWindow::on_DecodeButton_clicked() //Decode request
void MainWindow::freezeDecode(int n) //freezeDecode() void MainWindow::freezeDecode(int n) //freezeDecode()
{ {
static int ntol[] = {1,2,5,10,20,50,100,200,500,1000};
if(!m_decoderBusy) { if(!m_decoderBusy) {
jt9com_.newdat=0; jt9com_.newdat=0;
jt9com_.nagain=1; 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(); decode();
} }
} }
void MainWindow::decode() //decode() void MainWindow::decode() //decode()
{ {
if(!m_dataAvailable) return;
decodeBusy(true); decodeBusy(true);
ui->DecodeButton->setStyleSheet(m_pbdecoding_style1); ui->DecodeButton->setStyleSheet(m_pbdecoding_style1);
@ -855,8 +878,6 @@ void MainWindow::decode() //decode()
jt9com_.nutc=100*ihr + imin; jt9com_.nutc=100*ihr + imin;
} }
// jt9com_.newdat=1;
// jt9com_.nagain=0;
jt9com_.nfqso=g_pWideGraph->QSOfreq(); jt9com_.nfqso=g_pWideGraph->QSOfreq();
m_tol=g_pWideGraph->Tol(); m_tol=g_pWideGraph->Tol();
jt9com_.ntol=m_tol; jt9com_.ntol=m_tol;
@ -1561,3 +1582,8 @@ void MainWindow::on_actionDeepestDecode_triggered()
m_ndepth=3; m_ndepth=3;
ui->actionDeepestDecode->setChecked(true); 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_NBslider_valueChanged(int value);
void on_TxFreqSpinBox_valueChanged(int arg1); void on_TxFreqSpinBox_valueChanged(int arg1);
void on_pbTxFreq_clicked(); void on_pbTxFreq_clicked();
void on_actionSave_synced_triggered(); void on_actionSave_synced_triggered();
void on_actionSave_decoded_triggered(); void on_actionSave_decoded_triggered();
void on_actionQuickDecode_triggered(); void on_actionQuickDecode_triggered();
void on_actionMediumDecode_triggered(); void on_actionMediumDecode_triggered();
void on_actionDeepestDecode_triggered(); void on_actionDeepestDecode_triggered();
void on_inGain_valueChanged(int n);
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
@ -142,6 +138,7 @@ private:
qint32 m_nsps; qint32 m_nsps;
qint32 m_hsymStop; qint32 m_hsymStop;
qint32 m_len1; qint32 m_len1;
qint32 m_inGain;
bool m_monitoring; bool m_monitoring;
bool m_transmitting; bool m_transmitting;
@ -161,6 +158,7 @@ private:
bool m_kb8rq; bool m_kb8rq;
bool m_NB; bool m_NB;
bool m_call3Modified; bool m_call3Modified;
bool m_dataAvailable;
char m_decoded[80]; char m_decoded[80];
@ -228,10 +226,10 @@ extern int ptt(int nport, int itx, int* iptt);
extern "C" { extern "C" {
//----------------------------------------------------- C and Fortran routines //----------------------------------------------------- C and Fortran routines
void symspec_(int* k, int* ntrperiod, int* nsps, int* nb, int* m_NBslider, void symspec_(int* k, int* ntrperiod, int* nsps, int* ingain, int* nb,
float* px, float s[], float red[], float* df3, int* nhsym, int* m_NBslider, float* px, float s[], float red[],
int* nzap, float* slimit, uchar lstrong[], float c0[], float* df3, int* nhsym, int* nzap, float* slimit,
int* npts8); uchar lstrong[], float c0[], int* npts8);
void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2); void genjt9_(char* msg, char* msgsent, int itone[], int len1, int len2);

View File

@ -40,7 +40,7 @@
<rect> <rect>
<x>11</x> <x>11</x>
<y>2</y> <y>2</y>
<width>565</width> <width>571</width>
<height>423</height> <height>423</height>
</rect> </rect>
</property> </property>
@ -287,6 +287,25 @@ p, li { white-space: pre-wrap; }
</property> </property>
</widget> </widget>
</item> </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> <item>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>

View File

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

View File

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

View File

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

View File

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

View File

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