From 4774146baf8d04c487cee0f801d16251f06a4d73 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 9 Jun 2015 00:43:07 +0000 Subject: [PATCH] Echo spectrum appears OK; must test Doppler corrections in both modes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5559 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/avecho.f90 | 10 ++++------ mainwindow.cpp | 26 ++++++++++++++++++++------ mainwindow.h | 2 +- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/avecho.f90 b/lib/avecho.f90 index 2b09403ca..4a7f0a8ac 100644 --- a/lib/avecho.f90 +++ b/lib/avecho.f90 @@ -18,7 +18,6 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width) save dop0,sa,sb dop=ndop - doppler=dop sq=0. do i=1,TXLENGTH x(i)=id2(i) @@ -27,9 +26,8 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width) rms0=sqrt(sq/TXLENGTH) if(nclearave.ne.0) nsum=0 - nclearave=0 if(nsum.eq.0) then - dop0=doppler !Remember the initial Doppler + dop0=dop !Remember the initial Doppler sa=0. !Clear the average arrays sb=0. endif @@ -44,7 +42,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width) fnominal=1500.0 !Nominal audio frequency w/o doppler or dither ia=nint((fnominal+dop0-nfrit)/df) - ib=nint((f1+doppler-nfrit)/df) + ib=nint((f1+dop-nfrit)/df) if(ia.lt.600 .or. ib.lt.600) go to 900 if(ia.gt.7590 .or. ib.gt.7590) go to 900 @@ -112,8 +110,8 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width) enddo 900 continue - write(*,3001) ia,ib,nclearave,nsum,width,snr,nqual -3001 format('avecho:',4i6,2f7.1,i5) + write(*,3001) ia*df,ib*df,dop,r0,r1,nfrit,nclearave,nsum +3001 format(5f10.1,3i6) return end subroutine avecho diff --git a/mainwindow.cpp b/mainwindow.cpp index 3daf2f073..8143d762d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -833,9 +833,10 @@ void MainWindow::dataSink(qint64 frames) float dfreq=0.0; float width=0.0; echocom_.nclearave=m_nclearave; - avecho_(&jt9com_.d2[0],&m_nDop00,&nfrit,&nqual,&f1,&rms,&sigdb, + int nDop=0; + avecho_(&jt9com_.d2[0],&nDop,&nfrit,&nqual,&f1,&rms,&sigdb, &snr,&dfreq,&width); - qDebug() << "A" << echocom_.nclearave << echocom_.nsum << rms << sigdb; + qDebug() << "A" << m_nDopr << nDop; if(m_echoGraph->isVisible()) m_echoGraph->plotSpec(); m_nclearave=0; return; @@ -2142,6 +2143,8 @@ void MainWindow::guiUpdate() Q_EMIT m_config.transceiver_tx_frequency (m_dialFreqTx); } else { f=m_freqNominal + 1000*m_astroWidget->m_kHz + m_astroWidget->m_Hz; +// m_dialFreq=f; +// ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string (m_dialFreq)); Q_EMIT m_config.transceiver_frequency(f); } } @@ -2170,10 +2173,16 @@ void MainWindow::guiUpdate() if(m_astroWidget->m_bDopplerTracking) { + m_nDopr=0; if(m_DopplerMethod==1) { // All Doppler correction done here; DX station stays at nominal dial frequency. - m_nDopr=m_astroWidget->m_stepHz*qRound(double(m_nDop)/double( + if(m_mode=="Echo") { + m_nDopr=m_astroWidget->m_stepHz*qRound(double(m_nDop00)/double( m_astroWidget->m_stepHz)); + } else { + m_nDopr=m_astroWidget->m_stepHz*qRound(double(m_nDop)/double( + m_astroWidget->m_stepHz)); + } } if(m_DopplerMethod==2) { // Doppler correction to constant frequency on Moon @@ -2188,9 +2197,14 @@ void MainWindow::guiUpdate() m_dialFreqTx)); Q_EMIT m_config.transceiver_tx_frequency (m_dialFreqTx); } else { - m_dialFreq=m_freqNominal + 1000*m_astroWidget->m_kHz + - m_astroWidget->m_Hz + m_nDopr; - ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string ( + if(m_mode=="Echo" and m_DopplerMethod==1) { + m_dialFreq=m_freqNominal + 1000*m_astroWidget->m_kHz + + m_astroWidget->m_Hz; + } else { + m_dialFreq=m_freqNominal + 1000*m_astroWidget->m_kHz + + m_astroWidget->m_Hz + m_nDopr; + } + ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string ( m_dialFreq)); Q_EMIT m_config.transceiver_frequency(m_dialFreq); } diff --git a/mainwindow.h b/mainwindow.h index 6e6902a15..a7bd87282 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -335,7 +335,7 @@ private: qint32 m_nseq; qint32 m_nDop; //Doppler shift of EME DX station qint32 m_nDop00; //EME self-Doppler - qint32 m_nDopr; //Applied Doppler, rounded to nearest 1, 10 or 100 Hz + qint32 m_nDopr; //Applied Doppler (rounded to nearest 1, 10 or 100 Hz) bool m_btxok; //True if OK to transmit bool m_diskData;