diff --git a/WSJT-X_Users_Guide_v1.2.docx b/WSJT-X_Users_Guide_v1.2.docx index 9de0ce293..1fc2f6578 100644 Binary files a/WSJT-X_Users_Guide_v1.2.docx and b/WSJT-X_Users_Guide_v1.2.docx differ diff --git a/lib/symspec.f90 b/lib/symspec.f90 index 3a85f2a10..fe075a45e 100644 --- a/lib/symspec.f90 +++ b/lib/symspec.f90 @@ -1,4 +1,4 @@ -subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8) +subroutine symspec(k,ntrperiod,nsps,ingain,nflatten,pxdb,s,df3,ihsym,npts8) ! Input: ! k pointer to the most recent new data @@ -20,7 +20,6 @@ subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8) include 'constants.f90' real*4 w3(MAXFFT3) real*4 s(NSMAX) - real*4 scale(NSMAX) real*4 ssum(NSMAX) real*4 xc(0:MAXFFT3-1) complex cx(0:MAXFFT3/2) @@ -28,7 +27,7 @@ subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8) common/jt9com/ss(184,NSMAX),savg(NSMAX),id2(NMAX),nutc,ndiskdat, & ntr,mousefqso,newdat,npts8a,nfa,nfsplit,nfb,ntol,kin,nzhsym, & nsave,nagain,ndepth,ntxmode,nmode,junk(5) - data rms/999.0/,k0/99999999/,nfft3z/0/,slope0/0.0/ + data rms/999.0/,k0/99999999/,nfft3z/0/ equivalence (xc,cx) save @@ -41,23 +40,14 @@ subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8) go to 900 !Wait for enough samples to start endif - if(nfft3.ne.nfft3z .or. slope.ne.slope0) then -! Compute new window and adjust scale factor + if(nfft3.ne.nfft3z) then +! Compute new window pi=4.0*atan(1.0) do i=1,nfft3 w3(i)=2.0*(sin(i*pi/nfft3))**2 !Window for nfft3 spectrum enddo nfft3z=nfft3 nh=NSMAX/2 - if(abs(slope+0.1).gt.0.05) then - do i=1,NSMAX - x=slope*float(i)/nh - 1.0 + 2.6 - scale(i)=10.0**x - enddo - else - scale=1.0 - endif - slope0=slope endif if(k.lt.k0) then !Start a new data block @@ -109,10 +99,9 @@ subroutine symspec(k,ntrperiod,nsps,ingain,slope,pxdb,s,df3,ihsym,npts8) s(i)=gain*sx enddo - s=scale*s - savg=scale*ssum/ihsym + savg=ssum/ihsym - if(abs(slope+0.1).lt.0.01) then + if(nflatten.ne.0) then call flat3(s,iz,nfa,nfb,3,1.0,s) call flat3(savg,iz,nfa,nfb,3,1.0,savg) savg=7.0*savg diff --git a/mainwindow.cpp b/mainwindow.cpp index 591e6c766..1db1c4bdc 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -699,9 +699,9 @@ void MainWindow::dataSink(qint64 frames) static int nzap=0; static int trmin; static int npts8; + static int nflatten=0; static float px=0.0; static float df3; - static float slope; if(m_diskData) { jt9com_.ndiskdat=1; @@ -711,12 +711,12 @@ void MainWindow::dataSink(qint64 frames) // Get power, spectrum, and ihsym trmin=m_TRperiod/60; - slope=0.0; - slope=(float)m_wideGraph->getSlope(); int k (frames - 1); jt9com_.nfa=m_wideGraph->nStartFreq(); jt9com_.nfb=m_wideGraph->getFmax(); - symspec_(&k,&trmin,&m_nsps,&m_inGain,&slope,&px,s,&df3,&ihsym,&npts8); + nflatten=0; + if(m_wideGraph->flatten()) nflatten=1; + symspec_(&k,&trmin,&m_nsps,&m_inGain,&nflatten,&px,s,&df3,&ihsym,&npts8); if(ihsym <=0) return; QString t; m_pctZap=nzap*100.0/m_nsps; diff --git a/mainwindow.h b/mainwindow.h index 1bb456d91..466087fb0 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -426,7 +426,7 @@ extern int ptt(int nport, int ntx, int* iptt, int* nopen); extern "C" { //----------------------------------------------------- C and Fortran routines -void symspec_(int* k, int* ntrperiod, int* nsps, int* ingain, float* slope, +void symspec_(int* k, int* ntrperiod, int* nsps, int* ingain, int* nflatten, float* px, float s[], float* df3, int* nhsym, int* npts8); void genjt9_(char* msg, int* ichk, char* msgsent, int itone[], diff --git a/widegraph.cpp b/widegraph.cpp index 32533095c..dc198e3fb 100644 --- a/widegraph.cpp +++ b/widegraph.cpp @@ -26,6 +26,9 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : connect(ui->widePlot, SIGNAL(setFreq1(int,int)),this, SLOT(setFreq2(int,int))); + connect (ui->cbFlatten, SIGNAL(toggled(bool)),this, + SLOT(on_cbFlatten_toggled(bool))); + //Restore user's settings m_settings->beginGroup("WideGraph"); restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); @@ -35,6 +38,8 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : ui->gainSpinBox->setValue(ui->widePlot->getPlotGain()); int n = m_settings->value("FreqSpan",2).toInt(); int w = m_settings->value("PlotWidth",1000).toInt(); + m_bFlatten=m_settings->value("Flatten",true).toBool(); + ui->cbFlatten->setChecked(m_bFlatten); ui->widePlot->m_w=w; ui->freqSpanSpinBox->setValue(n); ui->widePlot->setNSpan(n); @@ -46,8 +51,6 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : if(ui->widePlot->m_bCumulative) ui->spec2dComboBox->setCurrentIndex(1); int nbpp=m_settings->value("BinsPerPixel",2).toInt(); ui->widePlot->setBinsPerPixel(nbpp); - m_slope=m_settings->value("Slope",0.0).toDouble(); - ui->slopeSpinBox->setValue(m_slope); ui->widePlot->setStartFreq(m_settings->value("StartFreq",0).toInt()); ui->fStartSpinBox->setValue(ui->widePlot->startFreq()); m_waterfallPalette=m_settings->value("WaterfallPalette","Default").toString(); @@ -95,10 +98,10 @@ void WideGraph::saveSettings() m_settings->setValue ("Current", ui->widePlot->m_bCurrent); m_settings->setValue ("Cumulative", ui->widePlot->m_bCumulative); m_settings->setValue ("BinsPerPixel", ui->widePlot->binsPerPixel ()); - m_settings->setValue ("Slope", m_slope); m_settings->setValue ("StartFreq", ui->widePlot->startFreq ()); m_settings->setValue ("WaterfallPalette", m_waterfallPalette); m_settings->setValue ("Fmin", m_fMin); + m_settings->setValue("Flatten",m_bFlatten); m_settings->endGroup (); } @@ -288,26 +291,11 @@ void WideGraph::on_fMinSpinBox_valueChanged(int n) setRxRange(m_fMin); } -void WideGraph::on_slopeSpinBox_valueChanged(double d) -{ - m_slope=d; -} - -void WideGraph::setSlope(double d) -{ - m_slope=d; - ui->slopeSpinBox->setValue(d); -} - void WideGraph::setLockTxFreq(bool b) { m_lockTxFreq=b; ui->widePlot->m_lockTxFreq=b; } -double WideGraph::getSlope() -{ - return m_slope; -} void WideGraph::setFreq2(int rxFreq, int txFreq) { @@ -364,3 +352,14 @@ void WideGraph::on_paletteComboBox_activated(const QString &palette) m_waterfallPalette=palette; readPalette("Palettes/" + palette + ".pal"); } + +void WideGraph::on_cbFlatten_toggled(bool b) +{ + m_bFlatten=b; + +} + +bool WideGraph::flatten() +{ + return m_bFlatten; +} diff --git a/widegraph.h b/widegraph.h index 695aca373..82c7d6abe 100644 --- a/widegraph.h +++ b/widegraph.h @@ -33,11 +33,10 @@ public: void setTxFreq(int n); void setMode(QString mode); void setModeTx(QString modeTx); - void setSlope(double d); void setLockTxFreq(bool b); - double getSlope(); double fGreen(); void readPalette(QString fileName); + bool flatten(); signals: void freezeDecode2(int n); @@ -61,9 +60,9 @@ private slots: void on_gainSpinBox_valueChanged(int arg1); void on_spec2dComboBox_currentIndexChanged(const QString &arg1); void on_fMinSpinBox_valueChanged(int n); - void on_slopeSpinBox_valueChanged(double d); void on_fStartSpinBox_valueChanged(int n); void on_paletteComboBox_activated(const QString &palette); + void on_cbFlatten_toggled(bool b); private: QScopedPointer ui; @@ -72,7 +71,6 @@ private: qint32 m_rxFreq; qint32 m_txFreq; - double m_slope; double m_dialFreq; qint32 m_waterfallAvg; @@ -84,6 +82,7 @@ private: qint32 m_fMax; bool m_lockTxFreq; + bool m_bFlatten; QString m_mode; QString m_modeTx; diff --git a/widegraph.ui b/widegraph.ui index 5c8363990..fbc4f09e7 100644 --- a/widegraph.ui +++ b/widegraph.ui @@ -52,18 +52,34 @@ - - - - Palette + + + + <html><head/><body><p>Select data for spectral display</p></body></html> - - Qt::AlignCenter + + 1 + + + Current + + + + + Cumulative + + - - + + + + + 0 + 0 + + 80 @@ -77,78 +93,21 @@ - <html><head/><body><p>Constant offset applied to spectra</p></body></html> - - - + Number of FFTs averaged (controls waterfall scrolling rate) - Zero + N Avg - -100 - - - 100 - - - - - - - - 80 - 0 - - - - - 38 - 16777215 - - - - <html><head/><body><p>Gain (dB) applied to spectra before display</p></body></html> - - - Gain - - - -20 + 1 20 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + 0 @@ -162,13 +121,45 @@ - Frequency (Hz) at left edge of waterfall + Select waterfall palette + + + + + + + Palette + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 110 + 0 + + + + Decode JT65 below this frequency, JT9 above - Hz + JT9 - Start + JT65 + + + 0 5000 @@ -176,6 +167,9 @@ 100 + + 3000 + @@ -221,8 +215,8 @@ - - + + 0 @@ -231,21 +225,18 @@ - 110 + 80 0 - Decode JT65 below this frequency, JT9 above + Frequency (Hz) at left edge of waterfall - JT9 + Hz - JT65 - - - 0 + Start 5000 @@ -253,66 +244,36 @@ 100 - - 3000 - - - - - - 0 - 0 - + + + + Qt::Horizontal - + - 80 - 0 + 40 + 20 - - Select waterfall palette - - + - - - + + + + Qt::Horizontal + + - 80 - 0 + 40 + 20 - - Correction applied to flatted displayed spectra - - - Slope - - - 1 - - - -2.000000000000000 - - - 2.000000000000000 - - - 0.100000000000000 - - + - - - - - 0 - 0 - - + + 80 @@ -326,37 +287,55 @@ - Number of FFTs averaged (controls waterfall scrolling rate) + <html><head/><body><p>Gain (dB) applied to spectra before display</p></body></html> - N Avg + Gain - 1 + -20 20 - - + + + + + 80 + 0 + + + + + 38 + 16777215 + + - <html><head/><body><p>Select data for spectral display</p></body></html> + <html><head/><body><p>Constant offset applied to spectra</p></body></html> - - 1 + + + + + Zero + + + -100 + + + 100 + + + + + + + Flatten - - - Current - - - - - Cumulative - -