misc cleanup

This commit is contained in:
tvoid 2008-04-15 22:37:40 -06:00
parent 3bf064f2a0
commit e4e5a96c7b
5 changed files with 26 additions and 37 deletions

View File

@ -737,7 +737,7 @@ int gsm_burst::get_burst(void)
//haven't started counting
// get some good syncs before trying again
if ((SCH == d_burst_type) && (++wait_count > 5)) {
fprintf(stdout,"restarting good_count\n");
//fprintf(stdout,"restarting good_count\n");
good_count = wait_count = 0;
//tune away
if (p_tuner) {

View File

@ -76,6 +76,7 @@ enum EQ_TYPE {
EQ_ADAPTIVE_LINEAR,
EQ_FIXED_DFE,
EQ_ADAPTIVE_DFE,
EQ_ADAPT_TRAINING,
EQ_VITERBI
};

View File

@ -39,6 +39,10 @@ gsm_burst_cf::gsm_burst_cf (gr_feval_ll *t, float sample_rate) :
// fprintf(stderr,"Sample interval : %e\n",d_sample_interval);
// fprintf(stderr,"Relative sample rate : %g\n",d_omega);
//set_relative_rate( mm.d_omega / 156);
set_relative_rate( 1.0 / (mm.d_omega * 156) );
set_history(4); //need history for interpolator
@ -51,9 +55,11 @@ gsm_burst_cf::~gsm_burst_cf ()
void gsm_burst_cf::forecast (int noutput_items, gr_vector_int &ninput_items_required)
{
unsigned ninputs = ninput_items_required.size ();
for (unsigned i = 0; i < ninputs; i++)
ninput_items_required[i] = noutput_items * (int)ceil(mm.d_omega) * BBUF_SIZE + history();
unsigned ninputs = ninput_items_required.size ();
for (unsigned i = 0; i < ninputs; i++) {
ninput_items_required[i] = noutput_items * (int)ceil(mm.d_omega) * TS_BITS;
//fprintf(stderr,"forecast[%d]: %d = %d\n",i,noutput_items,ninput_items_required[i]);
}
}
int gsm_burst_cf::general_work (int noutput_items,
@ -70,7 +76,7 @@ int gsm_burst_cf::general_work (int noutput_items,
int do_output = num_outputs > 0 ? 1 : 0;
int ninput = ninput_items[0];
//fprintf(stderr,"#i=%d/#o=%d",n_input,noutput_items);
//fprintf(stderr,"#i=%d/#o=%d",ninput,noutput_items);
int ni = ninput - d_interp->ntaps() - 16; // interpolator need -4/+3 samples NTAPS = 8 , - 16 for safety margin

View File

@ -13,7 +13,7 @@
#define USEFUL_BITS 142 //(2*DATA_BITS + N_TRAIN_BITS )
#define FCCH_BITS USEFUL_BITS
#define TS_BITS (TAIL_BITS+USEFUL_BITS+TAIL_BITS+GUARD_BITS) //a full TS
#define TS_BITS (TAIL_BITS+USEFUL_BITS+TAIL_BITS+GUARD_BITS) //a full TS (156)
#define TS_PER_FRAME 8
#define FRAME_BITS (TS_PER_FRAME * TS_BITS + 2) // +2 for extra 8*0.25 guard bits
#define FCCH_POS TAIL_BITS

View File

@ -39,7 +39,6 @@ class burst_callback(gr.feval_ll):
def eval(self, x):
#print "burst_callback: eval(",x,")\n";
try:
#TODO: rework so this will work on file input
if gsm.BURST_CB_SYNC_OFFSET == x:
#print "burst_callback: SYNC_OFFSET\n";
if self.fg.options.tuning.count("o"):
@ -176,7 +175,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
parser.add_option("-D", "--decoder", type="string", default="c",
help="Select decoder block to use. (c)omplex,(f)loat [default=%default]")
parser.add_option("-E", "--equalizer", type="string", default="none",
help="Type of equalizer to use. none, fixed-dfe [default=%default]")
help="Type of equalizer to use. none, fixed-dfe, fixed-linear [default=%default]")
parser.add_option("-t", "--timing", type="string", default="cn",
help="Type of timing techniques to use. [default=%default] \n" +
"(n)one, (c)orrelation track, (q)uarter bit, (f)ull04 ")
@ -214,7 +213,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
parser.add_option("-g", "--gain", type="eng_float", default=None,
help="Set gain in dB (default is midpoint)")
parser.add_option("-c", "--channel", type="int", default=1,
help="Tune to GSM ARFCN. Overrides --freq")
help="Tune to GSM ARFCN.")
parser.add_option("-r", "--region", type="string", default="u",
help="Frequency bands to use for channels. (u)s or (e)urope [default=%default]")
@ -227,7 +226,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
help="Emtpy ARFCN [default=%default]")
(options, args) = parser.parse_args()
if (len(args) != 0) or (not (options.channel or options.inputfile)):
if (len(args) != 0):
parser.print_help()
sys.exit(1)
@ -235,6 +234,9 @@ class app_flow_graph(stdgui.gui_flow_graph):
# print "datafile option cannot be used with USRP options."
# sys.exit(1)
if options.test_hop_speed:
options.tuning = 'h' #hopping only, no offset
options.channel = options.hopgood
self.options = options
self.scopes = options.scopes
@ -299,7 +301,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
elif options.print_console.count('C'):
popts |= gsm.PRINT_BITS | gsm.PRINT_CORR_BITS
print "Print flags: 0x%8.8x\n" %(popts)
#print "Print flags: 0x%8.8x\n" %(popts)
self.burst.d_print_options = popts
@ -370,6 +372,10 @@ class app_flow_graph(stdgui.gui_flow_graph):
####################
def setup_filter(self):
#test w/o filter (for buffer latency)
#self.filter = self.source
#return
options = self.options
# configure channel filter
@ -406,27 +412,6 @@ class app_flow_graph(stdgui.gui_flow_graph):
self.burst = gsm.burst_ff(self.burst_cb)
self.connect(self.filter, self.demod, self.clocker, self.burst)
####################
def setup_f_flowgraph2(self):
#This version uses a complex clock recovery prior to demod
#one advantage is the availability of clock error output in the cc version
#configure clock recovery
gain_mu = 0.01
gain_omega = .25 * gain_mu * gain_mu # critically damped
self.clocker = gr.clock_recovery_mm_cc( self.sps,
gain_omega,
0.5, #mu
gain_mu,
0.3) #omega_relative_limit,
# configure demodulator
# adjust the phase gain for sampling rate
self.demod = gr.quadrature_demod_cf(self.sps);
self.burst = gsm.burst_ff(self.burst_cb)
self.connect(self.filter, self.clocker, self.demod, self.burst)
####################
def setup_c_flowgraph(self):
#use the sink version if burst scope not selected
@ -476,7 +461,7 @@ class app_flow_graph(stdgui.gui_flow_graph):
options = self.options
# equalizer
eq_types = {'none': gsm.EQ_NONE, 'fixed-dfe': gsm.EQ_FIXED_DFE}
eq_types = {'none': gsm.EQ_NONE, 'fixed-dfe': gsm.EQ_FIXED_DFE, 'fixed-linear': gsm.EQ_FIXED_LINEAR }
self.burst.d_equalizer_type = eq_types[options.equalizer]
# timing
@ -501,12 +486,10 @@ class app_flow_graph(stdgui.gui_flow_graph):
self.burst.d_hop_good_arfcn = options.hopgood
self.burst.d_hop_bad_arfcn = options.hopbad
options.tuning = 'h' #hopping only, no offset
print "!!!!! Enabling Hop Speed Testing (good=%d, bad=%d) !!!!!" % (options.hopgood,options.hopbad)
self.burst.d_test_options = testopts
print "Test Options: 0x%8.8x" % (self.burst.d_test_options)
#print "Test Options: 0x%8.8x" % (self.burst.d_test_options)
@ -547,7 +530,6 @@ class app_flow_graph(stdgui.gui_flow_graph):
self.setup_c_flowgraph()
elif options.decoder.count("f"):
self.setup_f_flowgraph()
#self.setup_f_flowgraph2()
self.configure_burst_decoder()