diff --git a/commons.h b/commons.h index e5071b9..20c2ec3 100644 --- a/commons.h +++ b/commons.h @@ -18,6 +18,14 @@ #endif #endif +#ifndef TEST_FOX_WAVE_GEN_OFFSET +#if TEST_FOX_WAVE_GEN + #define TEST_FOX_WAVE_GEN_OFFSET 25 +#else + #define TEST_FOX_WAVE_GEN_OFFSET 0 +#endif +#endif + #ifdef __cplusplus #include extern "C" { diff --git a/lib/ft8/foxfilt.f90 b/lib/ft8/foxfilt.f90 index d97923a..15312e2 100644 --- a/lib/ft8/foxfilt.f90 +++ b/lib/ft8/foxfilt.f90 @@ -2,6 +2,7 @@ subroutine foxfilt(nslots,nfreq,width,wave) parameter (NN=79,ND=58,KK=87,NSPS=4*1920) parameter (NWAVE=NN*NSPS,NFFT=614400,NH=NFFT/2) + parameter (OFFSET=25) real wave(NWAVE) real x(NFFT) complex cx(0:NH) @@ -12,7 +13,7 @@ subroutine foxfilt(nslots,nfreq,width,wave) call four2a(x,NFFT,1,-1,0) !r2c df=48000.0/NFFT fa=nfreq - 0.5*6.25 - fb=nfreq + 7.5*6.25 + (nslots-1)*60.0 + fb=nfreq + 7.5*6.25 + (nslots-1)*(width+OFFSET) ia2=nint(fa/df) ib1=nint(fb/df) ia1=nint(ia2-width/df) diff --git a/lib/ft8/foxgen.f90 b/lib/ft8/foxgen.f90 index 335dce5..330f0cd 100644 --- a/lib/ft8/foxgen.f90 +++ b/lib/ft8/foxgen.f90 @@ -17,6 +17,7 @@ subroutine foxgen() use crc parameter (NN=79,ND=58,KK=87,NSPS=4*1920) parameter (NWAVE=NN*NSPS,NFFT=614400,NH=NFFT/2) + parameter (OFFSET=25) character*40 cmsg character*22 msg,msgsent character*6 mygrid @@ -36,8 +37,9 @@ subroutine foxgen() equivalence (x,cx),(y,cy) data icos7/4,2,5,6,1,3,0/ !Costas 7x7 tone pattern + width=50.0 bcontest=.false. - fstep=60.d0 + fstep=width+OFFSET dfreq=6.25d0 dt=1.d0/48000.d0 twopi=8.d0*atan(1.d0) @@ -127,7 +129,6 @@ subroutine foxgen() ! call plotspec(2,wave) !Plot the spectrum - width=50.0 call foxfilt(nslots,nfreq,width,wave) peak3=maxval(abs(wave)) wave=wave/peak3 diff --git a/plotter.cpp b/plotter.cpp index 4606769..e684b1a 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -457,7 +457,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() if(m_mode=="FT8"){ int fwidth=XfromFreq(m_rxFreq+bw)-XfromFreq(m_rxFreq); #if TEST_FOX_WAVE_GEN - int offset=XfromFreq(m_rxFreq+bw+10)-XfromFreq(m_rxFreq+bw); + int offset=XfromFreq(m_rxFreq+bw+TEST_FOX_WAVE_GEN_OFFSET)-XfromFreq(m_rxFreq+bw) + 4; // + 4 for the line padding #endif QPainter overPainter(&m_DialOverlayPixmap); overPainter.initFrom(this); @@ -465,22 +465,26 @@ void CPlotter::DrawOverlay() //DrawOverlay() overPainter.fillRect(0, 0, m_Size.width(), m_h, Qt::transparent); QPen thinRed(Qt::red, 1); overPainter.setPen(thinRed); - overPainter.drawLine(0, 30, 0, m_h); - overPainter.drawLine(fwidth+1, 30, fwidth+1, m_h); + overPainter.drawLine(0, 30, 0, m_h); // first slot, left line + overPainter.drawLine(fwidth + 1, 30, fwidth + 1, m_h); // first slot, right line #if TEST_FOX_WAVE_GEN if(m_turbo){ - overPainter.drawLine(offset+fwidth+1, 30, offset+fwidth+1, m_h); - overPainter.drawLine(offset+2*fwidth+1, 30, offset+2*fwidth+1, m_h); + for(int i = 1; i < TEST_FOX_WAVE_GEN_SLOTS; i++){ + overPainter.drawLine(i*(fwidth + offset), 30, i*(fwidth + offset), m_h); // n slot, left line + overPainter.drawLine(i*(fwidth + offset) + fwidth + 2, 30, i*(fwidth + offset) + fwidth + 2, m_h); // n slot, right line + } } #endif overPainter.setPen(penRed); - overPainter.drawLine(0, 26, fwidth, 26); - overPainter.drawLine(0, 28, fwidth, 28); + overPainter.drawLine(0, 26, fwidth, 26); // first slot, top bar + overPainter.drawLine(0, 28, fwidth, 28); // first slot, top bar 2 #if TEST_FOX_WAVE_GEN if(m_turbo){ - overPainter.drawLine(offset+fwidth, 26, offset+2*fwidth, 26); - overPainter.drawLine(offset+fwidth, 28, offset+2*fwidth, 28); + for(int i = 1; i < TEST_FOX_WAVE_GEN_SLOTS; i++){ + overPainter.drawLine(i*(fwidth + offset) + 1, 26, i*(fwidth + offset) + fwidth + 1, 26); // n slot, top bar + overPainter.drawLine(i*(fwidth + offset) + 1, 28, i*(fwidth + offset) + fwidth + 1, 28); // n slot, top bar 2 + } } #endif @@ -489,12 +493,14 @@ void CPlotter::DrawOverlay() //DrawOverlay() hoverPainter.setCompositionMode(QPainter::CompositionMode_Source); hoverPainter.fillRect(0, 0, m_Size.width(), m_h, Qt::transparent); hoverPainter.setPen(QPen(Qt::white)); - hoverPainter.drawLine(0, 30, 0, m_h); - hoverPainter.drawLine(fwidth+1, 30, fwidth+1, m_h); + hoverPainter.drawLine(0, 30, 0, m_h); // first slot, left line hover + hoverPainter.drawLine(fwidth, 30, fwidth, m_h); // first slot, right line hover #if TEST_FOX_WAVE_GEN if(m_turbo){ - hoverPainter.drawLine(offset+fwidth+1, 30, offset+fwidth+1, m_h); - hoverPainter.drawLine(offset+2*fwidth+1, 30, offset+2*fwidth+1, m_h); + for(int i = 1; i < TEST_FOX_WAVE_GEN_SLOTS; i++){ + hoverPainter.drawLine(i*(fwidth + offset), 30, i*(fwidth + offset), m_h); // n slot, left line + hoverPainter.drawLine(i*(fwidth + offset) + fwidth + 2, 30, i*(fwidth + offset) + fwidth + 2, m_h); // n slot, right line + } } #endif