From: drowe67 Date: Wed, 24 Jun 2015 03:22:26 +0000 (+0000) Subject: sorted out squelch, now moved to the freedv api X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=570c573c653dd23d201bd8fc9c7e3e9e9c409e8d;p=freetel-svn-tracking.git sorted out squelch, now moved to the freedv api git-svn-id: https://svn.code.sf.net/p/freetel/code@2215 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2-dev/README.txt b/fdmdv2-dev/README.txt index ea5a5c88..49eab1e1 100644 --- a/fdmdv2-dev/README.txt +++ b/fdmdv2-dev/README.txt @@ -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 diff --git a/fdmdv2-dev/src/fdmdv2_main.cpp b/fdmdv2-dev/src/fdmdv2_main.cpp index 1356faa6..9c8fdb3f 100644 --- a/fdmdv2-dev/src/fdmdv2_main.cpp +++ b/fdmdv2-dev/src/fdmdv2_main.cpp @@ -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