From: drowe67 Date: Tue, 16 Jun 2015 06:39:57 +0000 (+0000) Subject: tx doing something, not tested yet X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=53a94a91e676f68be09efc00a34fff5c17c00d44;p=freetel-svn-tracking.git tx doing something, not tested yet git-svn-id: https://svn.code.sf.net/p/freetel/code@2197 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/fdmdv2-dev/README.txt b/fdmdv2-dev/README.txt index 33bc19bf..18e6f378 100644 --- a/fdmdv2-dev/README.txt +++ b/fdmdv2-dev/README.txt @@ -139,27 +139,25 @@ TODO ==== [ ] FreeDV 700 mode - [ ] integrate freedv API + [X] interp of 8k to 7500Hz for analog bypass. + [X] integrate freedv API [X] varicode, codec, modem states [X] tx and rx freq shifts - [ ] generic, mode indep, sync, snr, scatter? + [X] generic, mode indep, sync, snr, scatter? + [ ] text working on 700 [ ] add 700 to freedv API - [ ] modem signal spectrum and stats consistent with fdmdv + [X] modem signal spectrum and stats consistent with fdmdv + [X] rx from file works + [ ] tx works [ ] clipper a check box, so we can see difference in spectrum [ ] cohpsk snr est - [ ] freedv api - [ ] normalise output pwr across modes? - + or maybe peak output? - + option? - [X] support for both varicodes [ ] test mode - + get error patterns working again, both modes - + how to plot error histogram + [ ] get error patterns working again, both 700 and 1600 + [ ] how to plot error histogram [ ] file sample replay at 7500Hz work OK? - [X] interp of 8k to 7500Hz for analog bypass. [ ] interp 7500 to 8k for spectrum plotting - [ ] filter around clipping - + to tcohpsk first + [ ] bpf filter after clipping + [ ] tcohpsk first [ ] Small fixes [X] Playfile bug [X] running again diff --git a/fdmdv2-dev/src/fdmdv2_main.cpp b/fdmdv2-dev/src/fdmdv2_main.cpp index 230450fa..1aa76fdd 100644 --- a/fdmdv2-dev/src/fdmdv2_main.cpp +++ b/fdmdv2-dev/src/fdmdv2_main.cpp @@ -871,21 +871,19 @@ void MainFrame::OnTimer(wxTimerEvent &evt) g_snr = m_snrBeta*g_snr + (1.0 - m_snrBeta)*g_stats.snr_est; float snr_limited = g_snr; + if (snr_limited < -5.0) snr_limited = -5.0; + if (snr_limited > 20.0) snr_limited = 20.0; - if (snr_limited < -9.0) snr_limited = -9.0; // stop text box overflow char snr[15]; - if (wxGetApp().m_snrSlow) - sprintf(snr, "%4.1f", snr_limited); - else - sprintf(snr, "%d", (int)(snr_limited+0.5)); // round to nearest dB + sprintf(snr, "%d", (int)(snr_limited+0.5)); // round to nearest dB + + //printf("snr_est: %f m_snrBeta: %f g_snr: %f snr_limited: %f\n", g_stats.snr_est, m_snrBeta, g_snr, snr_limited); + wxString snr_string(snr); m_textSNR->SetLabel(snr_string); + m_gaugeSNR->SetValue((int)(snr_limited+5)); - if (snr_limited < 0.0) snr_limited = 0; - if (snr_limited > 20.0) snr_limited = 20.0; - m_gaugeSNR->SetValue((int)(snr_limited)); - //printf("snr_limited: %f\n", snr_limited); - + // Level Gauge ----------------------------------------------------------------------- float tooHighThresh; @@ -1194,7 +1192,7 @@ void MainFrame::setsnrBeta(bool snrSlow) { if(snrSlow) { - m_snrBeta = 0.9; // make this closer to 1.0 to smooth SNR est further + m_snrBeta = 0.95; // make this closer to 1.0 to smooth SNR est further } else { @@ -2728,13 +2726,13 @@ int resample(SRC_STATE *src, ) { SRC_DATA src_data; - float input[N48*2]; - float output[N48*2]; + float input[N48*4]; + float output[N48*4]; int ret; assert(src != NULL); - assert(length_input_short <= N48*2); - assert(length_output_short <= N48*2); + assert(length_input_short <= N48*4); + assert(length_output_short <= N48*4); src_short_to_float_array(input_short, input, length_input_short); @@ -2794,10 +2792,10 @@ void txRxProcessing() // signals in in48k/out48k are at a maximum sample rate of 48k, could be 44.1kHz // depending on sound hardware. - short in8k_short[N8]; - short in48k_short[N48]; - short out8k_short[N8]; - short out48k_short[N48]; + short in8k_short[4*N8]; + short in48k_short[4*N48]; + short out8k_short[4*N8]; + short out48k_short[4*N48]; int nout; //wxLogDebug("start infifo1: %5d outfifo1: %5d\n", fifo_n(cbData->infifo1), fifo_n(cbData->outfifo1)); @@ -2926,7 +2924,7 @@ void txRxProcessing() g_mutexProtectingCallbackData.Unlock(); int nsam = g_soundCard2SampleRate * g_pfreedv->n_speech_samples/FS; - assert(nsam <= 2*N48); + assert(nsam <= 4*N48); // infifo2 is written to by another sound card so it may // over or underflow, but we don't realy care. It will @@ -3135,7 +3133,6 @@ void per_frame_rx_processing( nin = freedv_nin(g_pfreedv); g_State = g_pfreedv->sync; - g_snr = g_pfreedv->snr_est; // compute rx spectrum & get demod stats, and update GUI plot data diff --git a/fdmdv2-dev/src/topFrame.cpp b/fdmdv2-dev/src/topFrame.cpp index 78be910f..54ea80ab 100644 --- a/fdmdv2-dev/src/topFrame.cpp +++ b/fdmdv2-dev/src/topFrame.cpp @@ -113,7 +113,7 @@ TopFrame::TopFrame(wxWindow* parent, wxWindowID id, const wxString& title, const //------------------------------ // S/N ratio Guage (vert. bargraph) //------------------------------ - m_gaugeSNR = new wxGauge(this, wxID_ANY, 20, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL); + m_gaugeSNR = new wxGauge(this, wxID_ANY, 25, wxDefaultPosition, wxSize(15,135), wxGA_SMOOTH|wxGA_VERTICAL); m_gaugeSNR->SetToolTip(_("Displays signal to noise ratio in dB.")); snrSizer->Add(m_gaugeSNR, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 10);