diff --git a/libm65/symspec.f90 b/libm65/symspec.f90 index 2627f5ddd..9fe6d7a32 100644 --- a/libm65/symspec.f90 +++ b/libm65/symspec.f90 @@ -174,7 +174,7 @@ subroutine symspec(k,nfast,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & if(iqapply.ne.0) call iqfix(cy,NFFT,gainy,phasey) endif - n=ihsym + n=min(322,ihsym) do i=1,NFFT sx=real(cx(i))**2 + aimag(cx(i))**2 ss(1,n,i)=sx ! Pol = 0 diff --git a/soundin.cpp b/soundin.cpp index a7b3cfe96..e8493f4c6 100644 --- a/soundin.cpp +++ b/soundin.cpp @@ -187,7 +187,7 @@ void SoundInThread::run() //SoundInThread::run() // const PaStreamInfo* p=Pa_GetStreamInfo(inStream); bool qe = quitExecution; - int ntrz=99; + int ntr0=99; int k=0; int nsec; int ntr; @@ -203,9 +203,10 @@ void SoundInThread::run() //SoundInThread::run() ntr = nsec % m_TRperiod; // Reset buffer pointer and symbol number at start of minute - if(ntr < ntrz or !m_monitoring) { + if(ntr < ntr0 or !m_monitoring or m_TRperiod!=m_TRperiod0) { nhsym0=0; udata.bzero=true; + m_TRperiod0=m_TRperiod; } k=udata.kin; udata.iqswap=m_IQswap; @@ -228,7 +229,7 @@ void SoundInThread::run() //SoundInThread::run() } } msleep(100); - ntrz=ntr; + ntr0=ntr; } Pa_StopStream(inStream); Pa_CloseStream(inStream); @@ -346,7 +347,7 @@ void SoundInThread::inputUDP() double d8[174]; } b; - int ntrz=99; + int ntr0=99; int k=0; int nsec; int ntr; @@ -369,11 +370,12 @@ void SoundInThread::inputUDP() ntr = nsec % m_TRperiod; // Reset buffer pointer and symbol number at start of minute - if(ntr < ntrz) { + if(ntr < ntr0 or !m_monitoring or m_TRperiod!=m_TRperiod0) { k=0; nhsym0=0; + m_TRperiod0=m_TRperiod; } - ntrz=ntr; + ntr0=ntr; if(m_monitoring) { m_nrx=b.nrx; diff --git a/soundin.h b/soundin.h index 30862b568..b31420fd2 100644 --- a/soundin.h +++ b/soundin.h @@ -75,6 +75,7 @@ private: qint32 m_nDevIn; qint32 m_udpPort; qint32 m_TRperiod; + qint32 m_TRperiod0; QUdpSocket *udpSocket; };