summaryrefslogtreecommitdiff
path: root/gsm-receiver/src/lib/decoder/openbtsstuff/RxBurst.h
blob: 4348fb8859d1d457551c407d8d37fbb6ca833101 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef _RXBURST_H
#define _RXBURST_H

#include "GSMCommon.h"
#include "BitVector.h"

namespace GSM {

/**@name Positions of stealing bits within a normal burst, GSM 05.03 3.1.4. */
//@{
static const unsigned gHlIndex = 60;		///< index of first stealing bit, GSM 05.03 3.1.4
static const unsigned gHuIndex = 87;		///< index of second stealing bit, GSM 05.03 3.1.4
//@}

static const unsigned gSlotLen = 148;	///< number of symbols per slot, not counting guard periods


/**
	Class to represent one timeslot of channel bits with soft encoding.
*/
class RxBurst : public SoftVector {

	private:

	Time mTime;				///< timeslot and frame on which this was received
//	float mTimingError;		///< Timing error in symbol steps, <0 means early.
//	float mRSSI;			///< RSSI estimate associated with the slot, dB wrt full scale.

	public:

	/** Wrap an RxBurst around an existing float array. */
	RxBurst(float* wData, const Time &wTime)
		:SoftVector(wData,gSlotLen),mTime(wTime)
//		mTimingError(wTimingError),mRSSI(wRSSI)
	{ }


	Time time() const { return mTime; }

	void time(const Time& wTime) { mTime = wTime; }
	
//	float RSSI() const { return mRSSI; }

//	float timingError() const { return mTimingError; }

	/** Return a SoftVector alias to the first data field. */
	const SoftVector data1() const { return segment(3, 57); }

	/** Return a SoftVector alias to the second data field. */
	const SoftVector data2() const { return segment(88, 57); }

	/** Return upper stealing bit. */
	bool Hu() const { return bit(gHuIndex); }

	/** Return lower stealing bit. */
	bool Hl() const { return bit(gHlIndex); }

// 	friend std::ostream& operator<<(std::ostream& os, const RxBurst& ts);
};

// std::ostream& operator<<(std::ostream& os, const RxBurst& ts){
//   os << "time=" << ts.time();
//   os << " data=(" << (const SoftVector&)ts << ")" ;
//   return os;
// }


}
#endif
personal git repositories of Harald Welte. Your mileage may vary