Exemplo n.º 1
0
Arquivo: psk.c Projeto: g0orx/pihpsdr
GtkWidget *init_psk() {
  int i;

  psk_index=0;
  detector=createPSKDet(8000);
  if(detector==NULL) {
    fprintf(stderr,"init_psk: createPSKDet return null!\n");
    return NULL;
  }
  SetRXFrequency(detector,1500);
  ResetDetector(detector);

  for(i=0;i<TEXT_LINES;i++) {
    text_label[i][0]='\0';
  }
  build_temp_text();
  psk_label=gtk_label_new(temp_text);
  gtk_label_set_single_line_mode (GTK_LABEL(psk_label), FALSE);
  gtk_label_set_width_chars (GTK_LABEL(psk_label), 80);
  gtk_label_set_lines (GTK_LABEL(psk_label), TEXT_LINES);
  gtk_label_set_line_wrap (GTK_LABEL(psk_label), TRUE);
  gtk_misc_set_alignment (GTK_MISC(psk_label), 0, 0);
  //gtk_widget_set_halign(psk_label,GTK_ALIGN_START);
  //gtk_widget_set_valign(psk_label,GTK_ALIGN_START);
  
  return psk_label;
}
Exemplo n.º 2
0
/////////////////////////////////////////////////////////////////
//       Initialize PskDet buffers and pointers
/////////////////////////////////////////////////////////////////
void CPSKDet::Init( INT Fs )
{
WORD wTemp;
INT i;
	m_Fs = Fs;
// init circular delay lines.(data stays put and the pointers move)
	for( WORD j=0; j<2048; j++)		//init inverse varicode lookup decoder table
	{
		m_VaricodeDecTbl[j] = 0;
		for( i=0; i<256;i++)
		{
			wTemp = VARICODE_TABLE[i];
			wTemp >>= 4;
			while( !(wTemp&1) )
				wTemp >>= 1;
			wTemp >>= 1;
			if( wTemp == j)
				m_VaricodeDecTbl[j] = (BYTE)i;
		}
	}
//
	ResetDetector();
	SetSampleClkAdj( 0 );

	m_SQLevel = 50;
	m_BitPhasePos = 0.0;
	m_BitAcc = 0;
	m_LastBitZero = FALSE;
	m_SampCnt = 0;
	m_OnCount = 0;
	m_OffCount = 0;
// Init a bunch of "static" variables used in various member fuctions
	m_AGCave = 0.0;
	m_VcoPhz = 0.0;
	m_PkPos = 0;
	m_NewPkPos = 5;
	m_BitPos = 0;
	m_I1 = 0.0;
	m_I0 = 0.0;
	m_Q1 = 0.0;
	m_Q0 = 0.0;
	m_DevAve = .4;
	m_z1.x = 0.0; m_z1.y = 0.0;
	m_z2.x = 0.0; m_z2.y = 0.0;
	m_FferrAve = 0.0;
	m_FferrAve = 0.0;
	m_QFreqError = 0.0;
	m_LastPkPos = 0;
	m_SQOpen = FALSE;
	m_AFCTimer = 0;
	m_AFCCaptureOn = FALSE;
	m_FastAFCMode = FALSE;
	m_NLPk = NLP_K;
}
Exemplo n.º 3
0
Arquivo: psk.c Projeto: g0orx/pihpsdr
void psk_set_frequency(int f) {
  if(detector!=NULL) {
    SetRXFrequency(detector,f);
    ResetDetector(detector);
  }
}