diff options
Diffstat (limited to 'gsm-tvoid/src/lib')
-rwxr-xr-x | gsm-tvoid/src/lib/gsm.i | 16 | ||||
-rwxr-xr-x | gsm-tvoid/src/lib/gsm_burst.cc | 9 | ||||
-rwxr-xr-x | gsm-tvoid/src/lib/gsm_burst.h | 20 | ||||
-rwxr-xr-x | gsm-tvoid/src/lib/gsm_burst_cf.cc | 7 | ||||
-rwxr-xr-x | gsm-tvoid/src/lib/gsm_burst_cf.h | 6 | ||||
-rwxr-xr-x | gsm-tvoid/src/lib/gsm_burst_ff.cc | 7 | ||||
-rwxr-xr-x | gsm-tvoid/src/lib/gsm_burst_ff.h | 6 |
7 files changed, 48 insertions, 23 deletions
diff --git a/gsm-tvoid/src/lib/gsm.i b/gsm-tvoid/src/lib/gsm.i index d990e8b..9d653ac 100755 --- a/gsm-tvoid/src/lib/gsm.i +++ b/gsm-tvoid/src/lib/gsm.i @@ -43,6 +43,9 @@ #define CLK_CORR_TRACK 0x00000010 //adjust timing based on correlation offsets +#define BURST_CB_ADJ_OFFSET 1 +#define BURST_CB_TUNE 2 + //EQ options enum EQ_TYPE { EQ_NONE, @@ -73,6 +76,8 @@ public: long d_unknown_count; long d_total_count; + long next_arfcn; + int sync_state(); float last_freq_offset(void); double mean_freq_offset(void); @@ -80,25 +85,26 @@ public: //Methods void full_reset(void); + protected: - gsm_burst(); + gsm_burst(gr_feval_ll *); }; GR_SWIG_BLOCK_MAGIC(gsm,burst_ff); -gsm_burst_ff_sptr gsm_make_burst_ff (); +gsm_burst_ff_sptr gsm_make_burst_ff (gr_feval_ll *); class gsm_burst_ff : public gr_block, public gsm_burst { private: - gsm_burst_ff (); + gsm_burst_ff (gr_feval_ll *); }; GR_SWIG_BLOCK_MAGIC(gsm,burst_cf); -gsm_burst_cf_sptr gsm_make_burst_cf (float); +gsm_burst_cf_sptr gsm_make_burst_cf (gr_feval_ll *,float); class gsm_burst_cf : public gr_block, public gsm_burst { private: - gsm_burst_cf (float); + gsm_burst_cf (gr_feval_ll *,float); }; diff --git a/gsm-tvoid/src/lib/gsm_burst.cc b/gsm-tvoid/src/lib/gsm_burst.cc index 67d0886..4203f26 100755 --- a/gsm-tvoid/src/lib/gsm_burst.cc +++ b/gsm-tvoid/src/lib/gsm_burst.cc @@ -13,12 +13,15 @@ #include "gsmstack.h" -gsm_burst::gsm_burst () : +gsm_burst::gsm_burst (gr_feval_ll *t) : + p_tuner(t), d_clock_options(DEFAULT_CLK_OPTS), d_print_options(0), d_equalizer_type(EQ_FIXED_DFE) { +// fprintf(stderr,"gsm_burst: enter constructor (t=%8.8x)\n",(unsigned int)t); + // M_PI = M_PI; //4.0 * atan(1.0); full_reset(); @@ -643,6 +646,10 @@ int gsm_burst::get_burst(void) d_fcch_count++; calc_freq_offset(); + if (p_tuner) { + p_tuner->calleval(BURST_CB_ADJ_OFFSET); + } + d_ts = 0; break; case PARTIAL_SCH: diff --git a/gsm-tvoid/src/lib/gsm_burst.h b/gsm-tvoid/src/lib/gsm_burst.h index def20e0..f1fb26e 100755 --- a/gsm-tvoid/src/lib/gsm_burst.h +++ b/gsm-tvoid/src/lib/gsm_burst.h @@ -8,7 +8,6 @@ #include "gsm_constants.h" #include <gr_math.h> -//#include <Python.h> //for callback testing #include <gr_feval.h> #include "gsmstack.h" @@ -73,13 +72,17 @@ enum EQ_TYPE { EQ_VITERBI }; +#define BURST_CB_ADJ_OFFSET 1 +#define BURST_CB_TUNE 2 + + class gsm_burst; class gsm_burst { protected: - gsm_burst(); + gsm_burst(gr_feval_ll *t); //Burst Buffer: Storage for burst data float d_burst_buffer[BBUF_SIZE]; @@ -116,6 +119,8 @@ protected: double d_freq_off_sum; double d_freq_off_weight; + gr_feval_ll *p_tuner; + //////// Methods int get_burst(void); BURST_TYPE get_fcch_burst(void); @@ -157,12 +162,17 @@ public: unsigned long d_print_options; EQ_TYPE d_equalizer_type; - int sync_state() { return d_sync_state;} - float last_freq_offset() {return d_freq_offset;} - double mean_freq_offset(void); //Methods void full_reset(void); + + int sync_state() { return d_sync_state;} + + //Frequency + float last_freq_offset() {return d_freq_offset;} + double mean_freq_offset(void); + + long next_arfcn; }; diff --git a/gsm-tvoid/src/lib/gsm_burst_cf.cc b/gsm-tvoid/src/lib/gsm_burst_cf.cc index a91c569..08ff7ba 100755 --- a/gsm-tvoid/src/lib/gsm_burst_cf.cc +++ b/gsm-tvoid/src/lib/gsm_burst_cf.cc @@ -9,9 +9,9 @@ #include <stdio.h> #include <gri_mmse_fir_interpolator_cc.h> -gsm_burst_cf_sptr gsm_make_burst_cf (float sample_rate) +gsm_burst_cf_sptr gsm_make_burst_cf (gr_feval_ll *t,float sample_rate) { - return gsm_burst_cf_sptr (new gsm_burst_cf (sample_rate)); + return gsm_burst_cf_sptr (new gsm_burst_cf (t,sample_rate)); } static const int MIN_IN = 1; // minimum number of input streams @@ -19,7 +19,8 @@ static const int MAX_IN = 1; // maximum number of input streams static const int MIN_OUT = 1; // minimum number of output streams static const int MAX_OUT = 1; // maximum number of output streams -gsm_burst_cf::gsm_burst_cf (float sample_rate) : +gsm_burst_cf::gsm_burst_cf (gr_feval_ll *t, float sample_rate) : + gsm_burst(t), gr_block ( "burst_cf", gr_make_io_signature (MIN_IN, MAX_IN, sizeof (gr_complex)), gr_make_io_signature (MIN_OUT, MAX_OUT, USEFUL_BITS * sizeof (float))), diff --git a/gsm-tvoid/src/lib/gsm_burst_cf.h b/gsm-tvoid/src/lib/gsm_burst_cf.h index 33f61f6..2b806e0 100755 --- a/gsm-tvoid/src/lib/gsm_burst_cf.h +++ b/gsm-tvoid/src/lib/gsm_burst_cf.h @@ -8,7 +8,7 @@ class gsm_burst_cf; typedef boost::shared_ptr<gsm_burst_cf> gsm_burst_cf_sptr; -gsm_burst_cf_sptr gsm_make_burst_cf(float); +gsm_burst_cf_sptr gsm_make_burst_cf(gr_feval_ll *,float); class gri_mmse_fir_interpolator_cc; @@ -16,8 +16,8 @@ class gsm_burst_cf : public gr_block, public gsm_burst { private: - friend gsm_burst_cf_sptr gsm_make_burst_cf(float); - gsm_burst_cf(float); + friend gsm_burst_cf_sptr gsm_make_burst_cf(gr_feval_ll *,float); + gsm_burst_cf(gr_feval_ll *,float); //clocking parameters float d_relative_sample_rate; diff --git a/gsm-tvoid/src/lib/gsm_burst_ff.cc b/gsm-tvoid/src/lib/gsm_burst_ff.cc index 2980829..d73e73d 100755 --- a/gsm-tvoid/src/lib/gsm_burst_ff.cc +++ b/gsm-tvoid/src/lib/gsm_burst_ff.cc @@ -9,9 +9,9 @@ #include <stdio.h> #include <gri_mmse_fir_interpolator_cc.h> -gsm_burst_ff_sptr gsm_make_burst_ff () +gsm_burst_ff_sptr gsm_make_burst_ff (gr_feval_ll *t) { - return gsm_burst_ff_sptr (new gsm_burst_ff()); + return gsm_burst_ff_sptr (new gsm_burst_ff(t)); } static const int MIN_IN = 1; // minimum number of input streams @@ -19,7 +19,8 @@ static const int MAX_IN = 1; // maximum number of input streams static const int MIN_OUT = 1; // minimum number of output streams static const int MAX_OUT = 1; // maximum number of output streams -gsm_burst_ff::gsm_burst_ff () : +gsm_burst_ff::gsm_burst_ff (gr_feval_ll *t) : + gsm_burst(t), gr_block( "burst_ff", gr_make_io_signature (MIN_IN, MAX_IN, sizeof (float)), gr_make_io_signature (MIN_OUT, MAX_OUT, USEFUL_BITS * sizeof (float))) diff --git a/gsm-tvoid/src/lib/gsm_burst_ff.h b/gsm-tvoid/src/lib/gsm_burst_ff.h index 30c10dc..8ca61ef 100755 --- a/gsm-tvoid/src/lib/gsm_burst_ff.h +++ b/gsm-tvoid/src/lib/gsm_burst_ff.h @@ -8,14 +8,14 @@ class gsm_burst_ff; typedef boost::shared_ptr<gsm_burst_ff> gsm_burst_ff_sptr; -gsm_burst_ff_sptr gsm_make_burst_ff(); +gsm_burst_ff_sptr gsm_make_burst_ff(gr_feval_ll *); class gsm_burst_ff : public gr_block, public gsm_burst { private: - friend gsm_burst_ff_sptr gsm_make_burst_ff(); - gsm_burst_ff(); + friend gsm_burst_ff_sptr gsm_make_burst_ff(gr_feval_ll *); + gsm_burst_ff(gr_feval_ll *t); public: ~gsm_burst_ff (); |