int g_testFrames;
int g_test_frame_sync_state;
int g_test_frame_count;
-int g_total_bits;
-int g_total_bit_errors;
int g_channel_noise;
+int g_resyncs;
float g_sig_pwr_av = 0.0;
struct FIFO *g_error_pattern_fifo;
short *g_error_hist, *g_error_histn;
struct FIFO *g_rxDataOutFifo;
// tx/rx processing states
-int g_State;
+int g_State, g_prev_State;
paCallBackData *g_rxUserdata;
// FIFOs used for plotting waveforms
g_testFrames = 0;
g_test_frame_sync_state = 0;
- g_total_bit_errors = 0;
- g_total_bits = 0;
+ g_resyncs = 0;
wxGetApp().m_testFrames = false;
g_modal = false;
// sync LED (Colours don't work on Windows) ------------------------
+ //fprintf(stderr, "g_State: %d m_rbSync->GetValue(): %d\n", g_State, m_rbSync->GetValue());
if (g_State) {
+ if (g_prev_State == 0) {
+ g_resyncs++;
+ }
m_rbSync->SetForegroundColour( wxColour( 0, 255, 0 ) ); // green
- m_rbSync->SetValue(true);
+ m_rbSync->SetValue(true);
}
else {
m_rbSync->SetForegroundColour( wxColour( 255, 0, 0 ) ); // red
m_rbSync->SetValue(false);
}
+ g_prev_State = g_State;
// send Callsign ----------------------------------------------------
g_channel_noise = wxGetApp().m_channel_noise;
if (g_State) {
- char bits[80], errors[80], ber[80];
+ char bits[80], errors[80], ber[80], resyncs[80];
// update stats on main page
sprintf(errors, "Errs: %d", freedv_get_total_bit_errors(g_pfreedv)); wxString errors_string(errors); m_textErrors->SetLabel(errors_string);
float b = (float)freedv_get_total_bit_errors(g_pfreedv)/(1E-6+freedv_get_total_bits(g_pfreedv));
sprintf(ber, "BER: %4.3f", b); wxString ber_string(ber); m_textBER->SetLabel(ber_string);
+ sprintf(resyncs, "Resyncs: %d", g_resyncs); wxString resyncs_string(resyncs); m_textResyncs->SetLabel(resyncs_string);
// update error pattern plots if supported
m_panelWaterfall->setFs(freedv_get_modem_sample_rate(g_pfreedv));
}
- g_State = 0;
+ g_State = g_prev_State = 0;
g_stats.snr_est = 0;
event.Skip();
{
freedv_set_total_bits(g_pfreedv, 0);
freedv_set_total_bit_errors(g_pfreedv, 0);
+ g_resyncs = 0;
int i;
for(i=0; i<2*g_Nc; i++) {
g_error_hist[i] = 0;
}
modem_stats_open(&g_stats);
- g_State = 0;
+ g_State = g_prev_State = 0;
g_snr = 0.0;
g_half_duplex = wxGetApp().m_boolHalfDuplex;
nin = freedv_nin(g_pfreedv);
g_State = freedv_get_sync(g_pfreedv);
+
//fprintf(g_logfile, "g_State: %d g_stats.sync: %d snr: %f \n", g_State, g_stats.sync, f->snr);
// grab extended stats so we can plot spectrum, scatter diagram etc
m_textBER = new wxStaticText(this, wxID_ANY, wxT("BER: 0.0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
sbSizer_ber->Add(m_textBER, 0, wxALIGN_LEFT, 1);
+ m_textResyncs = new wxStaticText(this, wxID_ANY, wxT("Resyncs: 0"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
+ sbSizer_ber->Add(m_textResyncs, 0, wxALIGN_LEFT, 1);
+
leftSizer->Add(sbSizer_ber,0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 3);
//------------------------------