summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgsm-tvoid/src/lib/gsm.i45
-rwxr-xr-xgsm-tvoid/src/lib/gsm_burst.cc279
-rwxr-xr-xgsm-tvoid/src/lib/gsm_burst.h37
-rwxr-xr-xgsm-tvoid/src/lib/gsm_burst_cf.cc3
-rwxr-xr-xgsm-tvoid/src/lib/gsm_burst_ff.cc6
-rwxr-xr-xgsm-tvoid/src/lib/gsm_burst_ff.h4
-rwxr-xr-xgsm-tvoid/src/lib/gsm_constants.h1
7 files changed, 257 insertions, 118 deletions
diff --git a/gsm-tvoid/src/lib/gsm.i b/gsm-tvoid/src/lib/gsm.i
index cb4db43..d990e8b 100755
--- a/gsm-tvoid/src/lib/gsm.i
+++ b/gsm-tvoid/src/lib/gsm.i
@@ -1,17 +1,15 @@
/* -*- c++ -*- */
-
-%feature("autodoc", "1"); // generate python docstrings
-
-%include "exception.i"
+//%feature("autodoc", "1"); // generate python docstrings
+//%include "exception.i"
%import "gnuradio.i" // the common stuff
%{
#include "gnuradio_swig_bug_workaround.h" // mandatory bug fix
-#include "gsm_constants.h"
-#include "gsm_burst.h"
+//#include "gsm_constants.h"
+//#include "gsm_burst.h"
#include "gsm_burst_ff.h"
#include "gsm_burst_cf.h"
-#include <stdexcept>
+//#include <stdexcept>
%}
@@ -22,9 +20,10 @@
#define PRINT_BITS 0x00000001
#define PRINT_ALL_BITS 0x00000002
#define PRINT_CORR_BITS 0x00000004
+#define PRINT_STATE 0x00000008
#define PRINT_ALL_TYPES 0x00000FF0
-#define PRINT_KNOWN 0x00000008
+#define PRINT_KNOWN 0x00000FE0
#define PRINT_UNKNOWN 0x00000010
#define PRINT_TS0 0x00000020
#define PRINT_FCCH 0x00000040
@@ -32,6 +31,9 @@
#define PRINT_DUMMY 0x00000100
#define PRINT_NORMAL 0x00000200
+#define PRINT_GSM_DECODE 0x00000400
+
+#define PRINT_HEX 0x00001000
//Timing/clock options
#define QB_NONE 0x00000000
@@ -51,8 +53,9 @@ enum EQ_TYPE {
EQ_VITERBI
};
-class gsm_burst
-{
+//GR_SWIG_BLOCK_MAGIC(gsm,burst);
+
+class gsm_burst {
public:
~gsm_burst ();
@@ -68,35 +71,37 @@ public:
long d_normal_count;
long d_dummy_count;
long d_unknown_count;
+ long d_total_count;
int sync_state();
- float freq_offset();
+ float last_freq_offset(void);
+ double mean_freq_offset(void);
+
+ //Methods
+ void full_reset(void);
protected:
gsm_burst();
};
-GR_SWIG_BLOCK_MAGIC(gsm,burst_ff);
+GR_SWIG_BLOCK_MAGIC(gsm,burst_ff);
gsm_burst_ff_sptr gsm_make_burst_ff ();
-class gsm_burst_ff : public gr_block, public gsm_burst
-{
-//public:
+class gsm_burst_ff : public gr_block, public gsm_burst {
private:
gsm_burst_ff ();
};
-
GR_SWIG_BLOCK_MAGIC(gsm,burst_cf);
-
gsm_burst_cf_sptr gsm_make_burst_cf (float);
-class gsm_burst_cf : public gr_block, public gsm_burst
-{
-//public:
+class gsm_burst_cf : public gr_block, public gsm_burst {
private:
gsm_burst_cf (float);
};
+
+
+
diff --git a/gsm-tvoid/src/lib/gsm_burst.cc b/gsm-tvoid/src/lib/gsm_burst.cc
index 5415b2f..67d0886 100755
--- a/gsm-tvoid/src/lib/gsm_burst.cc
+++ b/gsm-tvoid/src/lib/gsm_burst.cc
@@ -3,44 +3,26 @@
#include "config.h"
#endif
+#include "gsm_burst.h"
#include <gr_math.h>
#include <stdio.h>
#include <math.h>
#include <memory.h>
-#include <gsm_burst.h>
#include <assert.h>
#include "system.h"
#include "gsmstack.h"
-gsm_burst::gsm_burst (void) :
- d_bbuf_pos(0),
- d_burst_start(MAX_CORR_DIST),
- d_sample_count(0),
- d_last_burst_s_count(0),
- d_corr_pattern(0),
- d_corr_pat_size(0),
- d_corr_max(0.0),
- d_corr_maxpos(0),
- d_corr_center(0),
- d_sync_state(WAIT_FCCH),
- d_ts(0),
- d_burst_count(0),
- d_freq_offset(0.0),
- d_sync_loss_count(0),
- d_fcch_count(0),
- d_part_sch_count(0),
- d_sch_count(0),
- d_normal_count(0),
- d_dummy_count(0),
- d_unknown_count(0),
+
+gsm_burst::gsm_burst () :
d_clock_options(DEFAULT_CLK_OPTS),
d_print_options(0),
d_equalizer_type(EQ_FIXED_DFE)
-
{
-
+
// M_PI = M_PI; //4.0 * atan(1.0);
+ full_reset();
+
//encode sync bits
float tsync[N_SYNC_BITS];
@@ -48,14 +30,14 @@ gsm_burst::gsm_burst (void) :
tsync[i] = 2.0*SYNC_BITS[i] - 1.0;
}
- fprintf(stdout," Sync: ");
+ fprintf(stderr," Sync: ");
print_bits(tsync,N_SYNC_BITS);
- fprintf(stdout,"\n");
+ fprintf(stderr,"\n");
diff_encode(tsync,corr_sync,N_SYNC_BITS);
- fprintf(stdout,"DSync: ");
+ fprintf(stderr,"DSync: ");
print_bits(corr_sync,N_SYNC_BITS);
- fprintf(stdout,"\n\n");
+ fprintf(stderr,"\n\n");
for (int i=0; i < 10; i++) {
@@ -64,9 +46,9 @@ gsm_burst::gsm_burst (void) :
}
diff_encode(tsync,corr_train_seq[i],N_TRAIN_BITS);
- fprintf(stdout,"TSC%d: ",i);
+ fprintf(stderr,"TSC%d: ",i);
print_bits(corr_train_seq[i],N_TRAIN_BITS);
- fprintf(stdout,"\n");
+ fprintf(stderr,"\n");
}
/* Initialize GSM Stack */
@@ -77,6 +59,55 @@ gsm_burst::~gsm_burst ()
{
}
+void gsm_burst::sync_reset(void)
+{
+ d_sync_state = WAIT_FCCH;
+ d_last_good = 0;
+ d_last_sch = 0;
+ d_burst_count = 0;
+}
+
+//TODO: check this for thread safeness
+void gsm_burst::full_reset(void)
+{
+ sync_reset();
+
+ d_sync_loss_count=0;
+ d_fcch_count=0;
+ d_part_sch_count=0;
+ d_sch_count=0;
+ d_normal_count=0;
+ d_dummy_count=0;
+ d_unknown_count=0;
+ d_total_count=0;
+
+ d_freq_offset=0.0;
+ d_freq_off_sum=0.0;
+ d_freq_off_weight=0;
+
+ d_ts=0;
+
+ d_bbuf_pos=0;
+ d_burst_start=MAX_CORR_DIST;
+ d_sample_count=0;
+ d_last_burst_s_count=0;
+ d_corr_pattern=0;
+ d_corr_pat_size=0;
+ d_corr_max=0.0;
+ d_corr_maxpos=0;
+ d_corr_center=0;
+ d_last_sync_state=WAIT_FCCH;
+
+}
+
+double gsm_burst::mean_freq_offset(void)
+{
+ if (d_freq_off_weight)
+ return d_freq_off_sum / d_freq_off_weight;
+ else
+ return 0.0;
+}
+
void gsm_burst::diff_encode(const float *in,float *out,int length,float lastbit) {
for (int i=0; i < length; i++) {
@@ -94,15 +125,55 @@ void gsm_burst::diff_decode(const float *in,float *out,int length,float lastbit)
}
}
+void gsm_burst::diff_decode_burst(void) {
+ char lastbit = 0;
+
+ //slice
+ for (int i = 0; i < USEFUL_BITS; i++) {
+ d_decoded_burst[i] = d_burst_buffer[d_burst_start + i] > 0 ? 0 : 1;
+ }
+
+ //diff decode
+ for (int i=0; i < USEFUL_BITS; i++) {
+ d_decoded_burst[i] ^= lastbit;
+ lastbit = d_decoded_burst[i];
+ }
+
+}
+
+void gsm_burst::print_hex(const unsigned char *data,int length)
+{
+ unsigned char tbyte;
+ int i,bitpos=0;
+
+ assert(data);
+ assert(length >= 0);
+
+
+
+ while (bitpos < length) {
+ tbyte = 0;
+ for (i=0; (i < 8) && (bitpos < length); i++) {
+ tbyte <<= 1;
+ tbyte |= data[bitpos++];
+ }
+ if (i<8)
+ tbyte <<= 8 - i;
+
+ fprintf(stdout,"%2.2X ",tbyte);
+ }
+}
+
void gsm_burst::print_bits(const float *data,int length)
{
assert(data);
assert(length >= 0);
for (int i=0; i < length; i++)
- data[i] < 0 ? fprintf(stdout,"+") : fprintf(stdout,".");
+ data[i] < 0 ? fprintf(stderr,"+") : fprintf(stderr,".");
}
+
void gsm_burst::soft2hardbit(char *dst, const float *data, int len)
{
for (int i=0; i < len; i++)
@@ -120,7 +191,7 @@ void gsm_burst::print_burst(void)
int print = 0;
- //fprintf(stdout,"p=%8.8X ", d_print_options);
+ //fprintf(stderr,"p=%8.8X ", d_print_options);
if ( PRINT_EVERYTHING == d_print_options )
print = 1;
@@ -146,28 +217,32 @@ void gsm_burst::print_burst(void)
print_bits(d_burst_buffer + d_burst_start,USEFUL_BITS);
}
- fprintf(stdout," ");
+ fprintf(stderr," ");
}
- /*
- * Pass information to GSM stack. GSM stack will try to extract
- * information (fn, layer 2 messages, ...)
- */
-
- char buf[156];
- /* In hardbits include the 3 trial bits */
- /* FIXME: access burst has 8 trail bits? what is d_burst_start
- * set to? make sure we start at the right position here.
- */
- soft2hardbit(buf, d_burst_buffer + d_burst_start - 3, 156);
- /* GS_process will differentially decode the data and then
- * extract SCH infos (and later bcch infos).
- */
- GS_process(&d_gs_ctx, d_ts, d_burst_type, buf);
+ if ( PRINT_GSM_DECODE == d_print_options ) {
+
+ /*
+ * Pass information to GSM stack. GSM stack will try to extract
+ * information (fn, layer 2 messages, ...)
+ */
+
+ char buf[156];
+ /* In hardbits include the 3 trial bits */
+ /* FIXME: access burst has 8 trail bits? what is d_burst_start
+ * set to? make sure we start at the right position here.
+ */
+ soft2hardbit(buf, d_burst_buffer + d_burst_start - 3, 156);
+ /* GS_process will differentially decode the data and then
+ * extract SCH infos (and later bcch infos).
+ */
+ GS_process(&d_gs_ctx, d_ts, d_burst_type, buf);
+ }
+
if (print) {
- fprintf(stdout,"%d/%d/%+d/%lu/%lu ",
+ fprintf(stderr,"%d/%d/%+d/%lu/%lu ",
d_sync_state,
d_ts,
d_burst_start - MAX_CORR_DIST,
@@ -176,38 +251,38 @@ void gsm_burst::print_burst(void)
switch (d_burst_type) {
case FCCH:
- fprintf(stdout,"[FCCH] foff:%g cnt:%lu",d_freq_offset,d_fcch_count);
+ fprintf(stderr,"[FCCH] foff:%g cnt:%lu",d_freq_offset,d_fcch_count);
break;
case PARTIAL_SCH:
bursts_since_sch = d_burst_count - d_last_sch;
- fprintf(stdout,"[P-SCH] cor:%.2f last:%d cnt: %lu",
+ fprintf(stderr,"[P-SCH] cor:%.2f last:%d cnt: %lu",
d_corr_max,bursts_since_sch,d_sch_count);
break;
case SCH:
bursts_since_sch = d_burst_count - d_last_sch;
- fprintf(stdout,"[SCH] cor:%.2f last:%d cnt: %lu",
+ fprintf(stderr,"[SCH] cor:%.2f last:%d cnt: %lu",
d_corr_max,bursts_since_sch,d_sch_count);
break;
case DUMMY:
- fprintf(stdout,"[DUMMY] cor:%.2f",d_corr_max);
+ fprintf(stderr,"[DUMMY] cor:%.2f",d_corr_max);
break;
case ACCESS:
- fprintf(stdout,"[ACCESS]"); //We don't detect this yet
+ fprintf(stderr,"[ACCESS]"); //We don't detect this yet
break;
case NORMAL:
- fprintf(stdout,"[NORM] clr:%d cor:%.2f",d_color_code,d_corr_max);
+ fprintf(stderr,"[NORM] clr:%d cor:%.2f",d_color_code,d_corr_max);
break;
case UNKNOWN:
- fprintf(stdout,"[?]");
+ fprintf(stderr,"[?]");
break;
default:
- fprintf(stdout,"[oops! default]");
+ fprintf(stderr,"[oops! default]");
break;
}
- fprintf(stdout,"\n");
+ fprintf(stderr,"\n");
//print the correlation pattern for visual inspection
@@ -224,20 +299,39 @@ void gsm_burst::print_burst(void)
pat_indent = d_corr_center - MAX_CORR_DIST; //useful bits will already be offset
for (int i = 0; i < pat_indent; i++)
- fprintf(stdout," ");
+ fprintf(stderr," ");
- fprintf(stdout," "); //extra space for skipped bit
+ fprintf(stderr," "); //extra space for skipped bit
print_bits(d_corr_pattern+1,d_corr_pat_size-1); //skip first bit (diff encoding)
- fprintf(stdout,"\t\toffset:%d, max: %.2f \n",d_corr_maxpos,d_corr_max);
+ fprintf(stderr,"\t\toffset:%d, max: %.2f \n",d_corr_maxpos,d_corr_max);
}
}
+
+ //Print Burst data in hex
+ if ( d_print_options & PRINT_HEX ) {
+ fprintf(stdout,"%d,%d,",d_ts,d_burst_type);
+ diff_decode_burst();
+ print_hex(d_decoded_burst,USEFUL_BITS);
+ fprintf(stdout,"\n");
+ }
+
+ //Print State related messages
+ if ( d_print_options & PRINT_STATE ) {
+ if ( (SYNCHRONIZED == d_sync_state) && (SYNCHRONIZED != d_last_sync_state) ) {
+ fprintf(stderr,"====== SYNC GAINED (FOff: %g Corr: %.2f, Color: %d ) ======\n",d_freq_offset,d_corr_max,d_color_code);
+ }
+ else if ( (SYNCHRONIZED != d_sync_state) && (SYNCHRONIZED == d_last_sync_state) ) {
+ fprintf(stderr,"====== SYNC LOST (%ld) ======\n",d_sync_loss_count);
+ }
+ }
+
}
void gsm_burst::shift_burst(int shift_bits)
{
- //fprintf(stdout,"sft:%d\n",shift_bits);
+ //fprintf(stderr,"sft:%d\n",shift_bits);
assert(shift_bits >= 0);
assert(shift_bits < BBUF_SIZE );
@@ -273,6 +367,14 @@ void gsm_burst::calc_freq_offset(void)
float p_off = mean - (M_PI / 2);
d_freq_offset = p_off * 1625000.0 / (12.0 * M_PI);
+
+ //maintain a 100 weight mean
+ if (d_freq_off_weight < 100)
+ d_freq_off_weight++;
+ else
+ d_freq_off_sum *= 99.0/100.0;
+
+ d_freq_off_sum += d_freq_offset;
}
// This will look for a series of positive phase differences comprising
@@ -292,10 +394,12 @@ BURST_TYPE gsm_burst::get_fcch_burst(void)
if (d_burst_buffer[i] > 0) {
if ( ! hit_count++ )
start_pos = i;
- } else {
+ }
+ else {
if (hit_count >= FCCH_HITS_NEEDED) {
break;
- } else if ( ++miss_count > FCCH_MAX_MISSES ) {
+ }
+ else if ( ++miss_count > FCCH_MAX_MISSES ) {
start_pos = -1;
hit_count = miss_count = 0;
}
@@ -310,11 +414,13 @@ BURST_TYPE gsm_burst::get_fcch_burst(void)
d_bbuf_pos = 0; //load buffer from start
return FCCH;
- } else {
+ }
+ else {
//TODO: don't shift a tiny amount
shift_burst(start_pos - MAX_CORR_DIST);
}
- } else {
+ }
+ else {
//Didn't find anything
d_burst_start = MAX_CORR_DIST;
d_bbuf_pos = 0; //load buffer from start
@@ -344,7 +450,7 @@ void gsm_burst::equalize(void)
}
break;
default:
- fprintf(stdout,"!EQ");
+ fprintf(stderr,"!EQ");
case EQ_NONE:
break;
}
@@ -408,7 +514,8 @@ BURST_TYPE gsm_burst::get_sch_burst(void)
} else {
type = SCH;
}
- } else {
+ }
+ else {
d_burst_start = MAX_CORR_DIST;
}
@@ -434,7 +541,8 @@ BURST_TYPE gsm_burst::get_norm_burst(void)
d_burst_start = MAX_CORR_DIST;
d_corr_maxpos = 0; //we don't want to affect timing
- } else {
+ }
+ else {
equalize();
eq=1;
@@ -451,7 +559,8 @@ BURST_TYPE gsm_burst::get_norm_burst(void)
if ( NORM_CORR_THRESHOLD < correlate_pattern(corr_train_seq[TS_DUMMY],N_TRAIN_BITS,MAX_CORR_DIST+TRAIN_POS,MAX_CORR_DIST) ) {
type = DUMMY;
- } else {
+ }
+ else {
//Match normal training sequences
//TODO: start with current color code
for (int i=0; i < 8; i++) {
@@ -493,7 +602,8 @@ int gsm_burst::get_burst(void)
d_sync_state = WAIT_SCH_ALIGN;
d_bbuf_pos = 0; //load buffer from start
- } else {
+ }
+ else {
got_burst = 0;
}
@@ -565,7 +675,21 @@ int gsm_burst::get_burst(void)
break;
}
+ if (UNKNOWN != d_burst_type) {
+ d_last_good = d_burst_count;
+ }
+
+
+ //Check for loss of sync
+ int bursts_since_good = d_burst_count - d_last_good;
+ if (bursts_since_good > MAX_SYNC_WAIT) {
+ d_sync_loss_count++;
+ sync_reset();
+ }
+
if (got_burst) {
+ d_total_count++;
+
//print info
print_burst();
@@ -574,19 +698,10 @@ int gsm_burst::get_burst(void)
d_bbuf_pos += MAX_CORR_DIST - d_burst_start;
}
- //Check for loss of sync
- int bursts_since_sch = d_burst_count - d_last_sch;
- if (bursts_since_sch > MAX_SYNC_WAIT) {
- d_sync_loss_count++;
- d_sync_state = WAIT_FCCH;
- d_last_sch = 0;
- d_burst_count = 0;
- fprintf(stdout,"====== SYNC LOST (%ld) ======\n",d_sync_loss_count); //TODO: move this to the print routine
- }
-
+ d_last_sync_state = d_sync_state;
+
d_ts = (++d_ts)%8; //next TS
return got_burst;
}
-
diff --git a/gsm-tvoid/src/lib/gsm_burst.h b/gsm-tvoid/src/lib/gsm_burst.h
index 951cef2..def20e0 100755
--- a/gsm-tvoid/src/lib/gsm_burst.h
+++ b/gsm-tvoid/src/lib/gsm_burst.h
@@ -6,19 +6,23 @@
// everything but I/O & clocking & sync_state?
// What about handling complex&diff&bin data?
-#include <gsm_constants.h>
+#include "gsm_constants.h"
#include <gr_math.h>
+//#include <Python.h> //for callback testing
+#include <gr_feval.h>
#include "gsmstack.h"
+
//Console printing options
#define PRINT_NOTHING 0x00000000
#define PRINT_EVERYTHING 0x7FFFFFFF //7 for SWIG overflow check work around
#define PRINT_BITS 0x00000001
#define PRINT_ALL_BITS 0x00000002
#define PRINT_CORR_BITS 0x00000004
+#define PRINT_STATE 0x00000008
#define PRINT_ALL_TYPES 0x00000FF0
-#define PRINT_KNOWN 0x00000008
+#define PRINT_KNOWN 0x00000FE0
#define PRINT_UNKNOWN 0x00000010
#define PRINT_TS0 0x00000020
#define PRINT_FCCH 0x00000040
@@ -26,6 +30,10 @@
#define PRINT_DUMMY 0x00000100
#define PRINT_NORMAL 0x00000200
+#define PRINT_GSM_DECODE 0x00000400
+
+#define PRINT_HEX 0x00001000
+
//Timing/clock options
#define QB_NONE 0x00000000
#define QB_QUARTER 0x00000001 //only for internal clocked versions
@@ -46,7 +54,7 @@
// G T D1 TS D2 T G
// Start ^
-#define MAX_SYNC_WAIT 176 //Bursts between SCH before reverting to WAIT_FCCH. (TODO: 88 should be max?)
+#define MAX_SYNC_WAIT 32 //Number of missed bursts before reverting to WAIT_FCCH.
#define MAX_CORR_DIST 7 // 4 + 3 = 1/2 GUARD + TAIL
#define SCH_CORR_THRESHOLD 0.80
@@ -80,11 +88,11 @@ protected:
unsigned long d_sample_count; //sample count at end (TODO:beginning) of BBUF (bit count if external clock)
unsigned long d_last_burst_s_count; //sample count from previous burst
+ unsigned char d_decoded_burst[USEFUL_BITS]; //Differentially Decoded burst buffer {0,1}
+
///// Sync/training sequence correlation
- //TODO: need all sync patterns
float corr_sync[N_SYNC_BITS]; //encoded sync bits for correlation
float corr_train_seq[10][N_TRAIN_BITS];
-// float d_corr[50];
const float *d_corr_pattern;
int d_corr_pat_size;
float d_corr_max;
@@ -96,13 +104,18 @@ protected:
///// Burst information
SYNC_STATE d_sync_state;
+ SYNC_STATE d_last_sync_state;
BURST_TYPE d_burst_type;
unsigned d_ts; //timeslot 0-7
+ unsigned long d_last_good; //Burst count of last good burst
unsigned long d_burst_count; //Bursts received starting w/ initial FCCH reset after lost sync
unsigned long d_last_sch; //Burst count of last SCH
- float d_freq_offset;
int d_color_code;
+ float d_freq_offset;
+ double d_freq_off_sum;
+ double d_freq_off_weight;
+
//////// Methods
int get_burst(void);
BURST_TYPE get_fcch_burst(void);
@@ -113,15 +126,18 @@ protected:
void calc_freq_offset(void);
void equalize(void);
float correlate_pattern(const float *,const int,const int,const int);
+ void diff_decode_burst(void);
+
+ void sync_reset(void);
void print_bits(const float *data,int length);
+ void print_hex(const unsigned char *data,int length);
void soft2hardbit(char *dst, const float *data, int len);
void print_burst(void);
void diff_encode(const float *in,float *out,int length,float lastbit = 1.0);
void diff_decode(const float *in,float *out,int length,float lastbit = 1.0);
-
public:
~gsm_burst ();
@@ -134,6 +150,7 @@ public:
long d_normal_count;
long d_dummy_count;
long d_unknown_count;
+ long d_total_count;
////// Options
unsigned long d_clock_options;
@@ -141,11 +158,11 @@ public:
EQ_TYPE d_equalizer_type;
int sync_state() { return d_sync_state;}
- float freq_offset() {return d_freq_offset;}
+ float last_freq_offset() {return d_freq_offset;}
+ double mean_freq_offset(void);
//Methods
- //TODO: reset state (e.g. channel change)
- //void reset(void);
+ void full_reset(void);
};
diff --git a/gsm-tvoid/src/lib/gsm_burst_cf.cc b/gsm-tvoid/src/lib/gsm_burst_cf.cc
index 8954b3f..a91c569 100755
--- a/gsm-tvoid/src/lib/gsm_burst_cf.cc
+++ b/gsm-tvoid/src/lib/gsm_burst_cf.cc
@@ -78,7 +78,8 @@ int gsm_burst_cf::general_work (int noutput_items,
d_clock_counter -= GSM_SYMBOL_PERIOD; //reset clock for next sample, keep the remainder
- float mu = 1.0 - d_clock_counter / GSM_SYMBOL_PERIOD;
+ //float mu = 1.0 - d_clock_counter / GSM_SYMBOL_PERIOD;
+ float mu = d_clock_counter / GSM_SYMBOL_PERIOD;
gr_complex sample = d_interp->interpolate (&in[ii], mu); //FIXME: this seems noisy, make sure it is being used correctly
gr_complex conjprod = sample * conj(d_last_sample);
diff --git a/gsm-tvoid/src/lib/gsm_burst_ff.cc b/gsm-tvoid/src/lib/gsm_burst_ff.cc
index e31b3a9..2980829 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 (void)
+gsm_burst_ff_sptr gsm_make_burst_ff ()
{
- return gsm_burst_ff_sptr (new gsm_burst_ff );
+ return gsm_burst_ff_sptr (new gsm_burst_ff());
}
static const int MIN_IN = 1; // minimum number of input streams
@@ -20,7 +20,7 @@ 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 () :
- gr_block ( "burst_ff",
+ 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 c9a05f4..30c10dc 100755
--- a/gsm-tvoid/src/lib/gsm_burst_ff.h
+++ b/gsm-tvoid/src/lib/gsm_burst_ff.h
@@ -8,13 +8,13 @@ class gsm_burst_ff;
typedef boost::shared_ptr<gsm_burst_ff> gsm_burst_ff_sptr;
-gsm_burst_ff_sptr gsm_make_burst_ff(void);
+gsm_burst_ff_sptr gsm_make_burst_ff();
class gsm_burst_ff : public gr_block, public gsm_burst
{
private:
- friend gsm_burst_ff_sptr gsm_make_burst_ff(void);
+ friend gsm_burst_ff_sptr gsm_make_burst_ff();
gsm_burst_ff();
public:
diff --git a/gsm-tvoid/src/lib/gsm_constants.h b/gsm-tvoid/src/lib/gsm_constants.h
index 3cc771e..c404b57 100755
--- a/gsm-tvoid/src/lib/gsm_constants.h
+++ b/gsm-tvoid/src/lib/gsm_constants.h
@@ -90,6 +90,7 @@ static const unsigned char train_seq[10][N_TRAIN_BITS] = {
{0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1} // DUMMY
};
+//Dummy burst 0xFB 76 0A 4E 09 10 1F 1C 5C 5C 57 4A 33 39 E9 F1 2F A8
static const unsigned char dummy_burst[] = {
1, 1, 1, 1, 1, 0, 1, 1, 0, 1,
1, 1, 0, 1, 1, 0, 0, 0, 0, 0,
personal git repositories of Harald Welte. Your mileage may vary