diff --git a/Modulator/Modulator.cpp b/Modulator/Modulator.cpp index 3a33c42f1..f267022e0 100644 --- a/Modulator/Modulator.cpp +++ b/Modulator/Modulator.cpp @@ -92,20 +92,8 @@ void Modulator::start (unsigned symbolsLength, double framesPerSymbol, if(delay_ms >= mstr) m_silentFrames = m_ic + 0.001*(delay_ms-mstr)*m_frameRate; } - // Special case for FST280: -// qDebug() << "aa" << m_ic << m_silentFrames << m_symbolsLength << m_nsps; - if(m_nsps==800 or m_nsps==1680 or m_nsps==3888 or m_nsps==8200 or m_nsps==21168) { - m_ic = m_ic + 48000 - 2*m_nsps + 9600; //The 9600 is empirical - m_silentFrames = m_silentFrames - 2*m_nsps; - } - if(m_silentFrames<0) { - m_ic = m_ic - m_silentFrames; - m_silentFrames = 0; - } -// qDebug() << "bb" << m_ic << m_silentFrames; -// qDebug() << "cc" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") -// << delay_ms << mstr << m_silentFrames << m_ic; - +// qDebug() << "aa" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") +// << delay_ms << mstr << m_silentFrames << m_ic << m_symbolsLength; initialize (QIODevice::ReadOnly, channel); Q_EMIT stateChanged ((m_state = (synchronize && m_silentFrames) ? @@ -317,14 +305,18 @@ qint64 Modulator::readData (char * data, qint64 maxSize) m_amp=32767.0; sample=qRound(m_amp*foxcom_.wave[m_ic]); } - +/* + if((m_ic<1000 or (4*m_symbolsLength*m_nsps - m_ic) < 1000) and (m_ic%10)==0) { + qDebug() << "cc" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") << m_ic << sample; + } +*/ samples = load(postProcessSample(sample), samples); ++framesGenerated; ++m_ic; } // qDebug() << "dd" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") -// << m_ic << m_amp << foxcom_.wave[m_ic]; +// << m_ic << i1 << foxcom_.wave[m_ic] << framesGenerated; if (m_amp == 0.0) { // TODO G4WJS: compare double with zero might not be wise if (icw[0] == 0) { diff --git a/lib/fst240/gen_fst240wave.f90 b/lib/fst240/gen_fst240wave.f90 index 3005968b2..43170638d 100644 --- a/lib/fst240/gen_fst240wave.f90 +++ b/lib/fst240/gen_fst240wave.f90 @@ -8,13 +8,11 @@ subroutine gen_fst240wave(itone,nsym,nsps,nwave,fsample,hmod,f0, & real, allocatable :: dphi(:) integer hmod integer itone(nsym) -! integer*8 count0,count1,clkfreq logical first data first/.true./ data nsps0/-99/ save first,twopi,dt,tsym,nsps0,ctab -! call system_clock(count0,clkfreq) if(first) then twopi=8.0*atan(1.0) do i=0,NTAB-1 @@ -68,7 +66,7 @@ subroutine gen_fst240wave(itone,nsym,nsps,nwave,fsample,hmod,f0, & enddo ! Compute the ramp-up and ramp-down symbols - kshift=nsps-nint(fsample) + kshift=nsps if(icmplx.eq.0) then wave(1:nsps)=0.0 wave(nsps+1:nsps+nsps/4)=wave(nsps+1:nsps+nsps/4) * & @@ -89,10 +87,11 @@ subroutine gen_fst240wave(itone,nsym,nsps,nwave,fsample,hmod,f0, & cwave=cshift(cwave,kshift) endif -! call system_clock(count1,clkfreq) -! tt=float(count1-count0)/float(clkfreq) -! write(*,3001) tt -!3001 format('Tgen:',f8.3) - +! do i=1,nwave +! write(71,3071) i,i/48000.0,wave(i) +!3071 format(i10,2f15.9) +! enddo + wave(nsps*nsym:)=0. !Kill a stray spike ?? + return end subroutine gen_fst240wave diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 269fdc75f..e7042b59a 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3542,7 +3542,7 @@ void MainWindow::guiUpdate() if(m_TRperiod==30) txDuration=1.0 + 160*1680/12000.0; if(m_TRperiod==60) txDuration=1.0 + 160*3888/12000.0; if(m_TRperiod==120) txDuration=1.0 + 160*8200/12000.0; - if(m_TRperiod==300) txDuration=1.0 + 160*21168/12000.0; + if(m_TRperiod==300) txDuration=1.0 + 160*21504/12000.0; } if(m_modeTx=="ISCAT" or m_mode=="MSK144" or m_bFast9) { txDuration=m_TRperiod-0.25; // ISCAT, JT9-fast, MSK144 @@ -3886,14 +3886,13 @@ void MainWindow::guiUpdate() if(m_TRperiod==30) nsps=1680; if(m_TRperiod==60) nsps=3888; if(m_TRperiod==120) nsps=8200; - if(m_TRperiod==300) nsps=21168; + if(m_TRperiod==300) nsps=21504; nsps=4*nsps; //48000 Hz sampling - int nsym=164; + int nsym=160; float fsample=48000.0; float dfreq=hmod*fsample/nsps; float f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq; -// int nwave=(nsym+2)*nsps; - int nwave=48000 + 166*nsps; + int nwave=(nsym+2)*nsps; int icmplx=0; gen_fst240wave_(const_cast(itone),&nsym,&nsps,&nwave, &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave); @@ -7170,7 +7169,7 @@ void MainWindow::transmit (double snr) if(m_TRperiod==30) nsps=1680; if(m_TRperiod==60) nsps=3888; if(m_TRperiod==120) nsps=8200; - if(m_TRperiod==300) nsps=21168; + if(m_TRperiod==300) nsps=21504; int hmod=int(pow(2.0,double(m_nSubMode))); double dfreq=hmod*12000.0/nsps; double f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq;