sorted out squelch, now moved to the freedv api
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 24 Jun 2015 03:22:26 +0000 (03:22 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Wed, 24 Jun 2015 03:22:26 +0000 (03:22 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2215 01035d8c-6547-0410-b346-abe4f91aad63

fdmdv2-dev/README.txt
fdmdv2-dev/src/fdmdv2_main.cpp

index ea5a5c88a005c17dc3503c720bbc87011d27f70f..49eab1e144a02c5228407af3d0f73159a59aa097 100644 (file)
@@ -185,13 +185,13 @@ TODO
     [X] resync issue
     [X] equalise power on 700 and 1600
     [X] research real and complex PAPR
-    [ ] Squelch control on 1600 mode will not open up squelch to 0  (appears to be around 2 dB)
-    [ ] waterfall and spectrum in analog mode
+    [X] waterfall and spectrum in analog mode
+    [X] The waterfall in analog mode appears to quit working sometimes?
+    [ ] Squelch control on 1600 mode will not open up squelch to 0 (appears to be around 2 dB)
     [ ] On TX, intermittently PTT will cause signal to be heard in speakers.  Toggle PTT or 
         Stop/Start toggle and then starts working.
     [ ] There is a .dll missing otherwise FreeDV will not excite.  We tested it on xp, win7, 8, 8.1 and 10.   
         Needs ilbusb0.dll  the 32bit one on all releases. 
-    [ ] The waterfall in analog mode appears to quit working sometimes?
     [ ] I am not sure the "checksum" is still working when enabled (1600 mode)
 
 [ ] FreeDV 700 improvements
index 1356faa6d2b08c64ea952076b5c14741e34cadb6..9c8fdb3f0b9e52c0f3b77294aefe39183dea8be6 100644 (file)
@@ -1203,7 +1203,7 @@ void MainFrame::OnPaint(wxPaintEvent& WXUNUSED(event))
 void MainFrame::OnCmdSliderScroll(wxScrollEvent& event)
 {
     char sqsnr[15];
-    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0;
+    g_SquelchLevel = (float)m_sliderSQ->GetValue()/2.0;   
     sprintf(sqsnr, "%4.1f", g_SquelchLevel); // 0.5 dB steps
     wxString sqsnr_string(sqsnr);
     m_textSQ->SetLabel(sqsnr_string);
@@ -2922,6 +2922,13 @@ void txRxProcessing()
 
         resample_for_plot(g_plotDemodInFifo, in8k_short, n8k, samplerate);
 
+        // send latest squelch level to FreeDV API, as it handles squelch internally
+
+        if (g_SquelchActive)
+            g_pfreedv->snr_squelch_thresh = g_SquelchLevel;
+        else
+            g_pfreedv->snr_squelch_thresh = -100.0;
+
         // Get some audio to send to headphones/speaker.  If in analog
         // mode we pass thru the "from radio" audio to the
         // headphones/speaker.
@@ -2952,7 +2959,7 @@ void txRxProcessing()
             per_frame_rx_processing(cbData->rxoutfifo, cbData->rxinfifo);
             memset(out8k_short, 0, sizeof(short)*N8);
             fifo_read(cbData->rxoutfifo, out8k_short, N8);
-       }
+        }
 
 
         // Optional Spk Out EQ Filtering, need mutex as filter can change at run time
@@ -2964,13 +2971,6 @@ void txRxProcessing()
         }
         g_mutexProtectingCallbackData.Unlock();
 
-        // note squelch automatically disabled in analog mode
-
-        if (g_SquelchActive && (g_SquelchLevel > g_snr) && !g_analog) {
-            //printf("g_SquelchLevel: %f g_snr: %f\n", g_SquelchLevel, g_snr);
-            memset(out8k_short, 0, sizeof(short)*N8);
-        }
-
         resample_for_plot(g_plotSpeechOutFifo, out8k_short, N8, FS);
 
         g_mutexProtectingCallbackData.Lock();
@@ -3224,6 +3224,7 @@ void per_frame_rx_processing(
         
         nin = freedv_nin(g_pfreedv);
         g_State = g_pfreedv->sync;
+        //fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
 
         // compute rx spectrum