Compare commits

...

8 Commits

Author SHA1 Message Date
Alexander Chemeris
33f03a0bb9 bump version to 0.1.10~2 2016-04-30 01:59:06 +03:00
Kirill Zakharenko
7a0615288d bump version to 0.1.10~1 2016-04-30 00:40:23 +03:00
Kirill Zakharenko
a216b5f87a debian: compile for atom arch with SSE3 optimizations 2016-04-30 00:40:23 +03:00
Alexander Chemeris
33d3b71e36 transceiver: WIP: Set default max delay to 2 samples.
Default value of 0 may be too harsh, especially given random Rx/Tx delay
in 1 SPS receive mode.
2016-04-30 00:40:23 +03:00
Alexander Chemeris
c9633bae32 transceiver: Add an option to emulate a RACH delay in random filler mode. 2016-04-30 00:40:23 +03:00
Alexander Chemeris
bbaa249e6d sigProcLib: Change number of head bits in detectRACHBurst() from 4 to 8.
To match GSM 05.02 Access Burst definition.
2016-04-30 00:40:23 +03:00
Alexander Chemeris
f0cd4bd1db transceiver: Log channel number in DEBUG output of demoded bursts. 2016-04-30 00:40:23 +03:00
Alexander Chemeris
c88385c69d makefile: Fix build from an external path.
When you build from an external path, compiler can't find convert.h
include, because it was specified relative to the current directory.
Change this to specify the include dit relative to the Makefile
location.
2016-04-29 14:05:59 +03:00
9 changed files with 59 additions and 25 deletions

View File

@@ -21,7 +21,7 @@
include $(top_srcdir)/Makefile.common
AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I./common
AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/common
AM_CXXFLAGS = -ldl -lpthread
SUBDIRS = arm x86

View File

@@ -71,7 +71,7 @@ TransceiverState::~TransceiverState()
}
}
bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc)
bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc, unsigned rach_delay)
{
signalVector *burst;
@@ -91,7 +91,7 @@ bool TransceiverState::init(int filler, size_t sps, float scale, size_t rtsc)
burst = generateEdgeBurst(rtsc);
break;
case Transceiver::FILLER_ACCESS_RAND:
burst = genRandAccessBurst(sps, n);
burst = genRandAccessBurst(rach_delay, sps, n);
break;
case Transceiver::FILLER_ZERO:
default:
@@ -122,7 +122,7 @@ Transceiver::Transceiver(int wBasePort,
mTransmitLatency(wTransmitLatency), mRadioInterface(wRadioInterface),
rssiOffset(wRssiOffset),
mSPSTx(tx_sps), mSPSRx(rx_sps), mChans(chans), mOn(false),
mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(0), mMaxExpectedDelayNB(0),
mTxFreq(0.0), mRxFreq(0.0), mTSC(0), mMaxExpectedDelayAB(2*rx_sps), mMaxExpectedDelayNB(2*rx_sps),
mWriteBurstToDiskMask(0)
{
txFullScale = mRadioInterface->fullScaleInputValue();
@@ -160,7 +160,7 @@ Transceiver::~Transceiver()
* are still expected to report clock indications through control channel
* activity.
*/
bool Transceiver::init(int filler, size_t rtsc)
bool Transceiver::init(int filler, size_t rtsc, unsigned rach_delay)
{
int d_srcport, d_dstport, c_srcport, c_dstport;
@@ -216,7 +216,7 @@ bool Transceiver::init(int filler, size_t rtsc)
if (i && filler == FILLER_DUMMY)
filler = FILLER_ZERO;
mStates[i].init(filler, mSPSTx, txFullScale, rtsc);
mStates[i].init(filler, mSPSTx, txFullScale, rtsc, rach_delay);
}
return true;
@@ -912,10 +912,11 @@ void Transceiver::driveReceiveRadio()
}
}
void Transceiver::logRxBurst(SoftVector *burst, GSM::Time time, double dbm,
void Transceiver::logRxBurst(size_t chan, SoftVector *burst, GSM::Time time, double dbm,
double rssi, double noise, double toa)
{
LOG(DEBUG) << std::fixed << std::right
<< " chan: " << chan
<< " time: " << time
<< " RSSI: " << std::setw(5) << std::setprecision(1) << rssi
<< "dBFS/" << std::setw(6) << -dbm << "dBm"
@@ -948,7 +949,7 @@ void Transceiver::driveReceiveFIFO(size_t chan)
nbits = gSlotLen * 3;
dBm = RSSI + rssiOffset;
logRxBurst(rxBurst, burstTime, dBm, RSSI, noise, TOA);
logRxBurst(chan, rxBurst, burstTime, dBm, RSSI, noise, TOA);
TOAint = (int) (TOA * 256.0 + 0.5); // round to closest integer

View File

@@ -54,7 +54,7 @@ struct TransceiverState {
~TransceiverState();
/* Initialize a multiframe slot in the filler table */
bool init(int filler, size_t sps, float scale, size_t rtsc);
bool init(int filler, size_t sps, float scale, size_t rtsc, unsigned rach_delay);
int chanType[8];
@@ -107,7 +107,7 @@ public:
~Transceiver();
/** Start the control loop */
bool init(int filler, size_t rtsc);
bool init(int filler, size_t rtsc, unsigned rach_delay);
/** attach the radioInterface receive FIFO */
bool receiveFIFO(VectorFIFO *wFIFO, size_t chan)
@@ -276,7 +276,7 @@ protected:
/** set priority on current thread */
void setPriority(float prio = 0.5) { mRadioInterface->setPriority(prio); }
void logRxBurst(SoftVector *burst, GSM::Time time, double dbm,
void logRxBurst(size_t chan, SoftVector *burst, GSM::Time time, double dbm,
double rssi, double noise, double toa);
};

View File

@@ -75,6 +75,7 @@ struct trx_config {
unsigned rx_sps;
unsigned chans;
unsigned rtsc;
unsigned rach_delay;
bool extref;
Transceiver::FillerType filler;
bool diversity;
@@ -270,7 +271,7 @@ Transceiver *makeTransceiver(struct trx_config *config, RadioInterface *radio)
trx = new Transceiver(config->port, config->addr.c_str(),
config->tx_sps, config->rx_sps, config->chans,
GSM::Time(3,0), radio, config->rssi_offset);
if (!trx->init(config->filler, config->rtsc)) {
if (!trx->init(config->filler, config->rtsc, config->rach_delay)) {
LOG(ALERT) << "Failed to initialize transceiver";
delete trx;
return NULL;
@@ -322,8 +323,8 @@ static void print_help()
" -c Number of ARFCN channels (default=1)\n"
" -f Enable C0 filler table\n"
" -o Set baseband frequency offset (default=auto)\n"
" -r Random burst test mode with TSC\n"
" -A Random burst test mode with Access Bursts\n"
" -r Random Normal Burst test mode with TSC\n"
" -A Random Access Burst test mode with delay\n"
" -R RSSI to dBm offset in dB (default=0)\n"
" -S Swap channels (UmTRX only)\n",
"EMERG, ALERT, CRT, ERR, WARNING, NOTICE, INFO, DEBUG");
@@ -338,6 +339,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->rx_sps = DEFAULT_RX_SPS;
config->chans = DEFAULT_CHANS;
config->rtsc = 0;
config->rach_delay = 0;
config->extref = false;
config->filler = Transceiver::FILLER_ZERO;
config->diversity = false;
@@ -346,7 +348,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->swap_channels = false;
config->edge = false;
while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:AR:Se")) != -1) {
while ((option = getopt(argc, argv, "ha:l:i:p:c:dxfo:s:r:A:R:Se")) != -1) {
switch (option) {
case 'h':
print_help();
@@ -387,6 +389,7 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
config->filler = Transceiver::FILLER_NORM_RAND;
break;
case 'A':
config->rach_delay = atoi(optarg);
config->filler = Transceiver::FILLER_ACCESS_RAND;
break;
case 'R':
@@ -425,6 +428,12 @@ static void handle_options(int argc, char **argv, struct trx_config *config)
print_help();
exit(0);
}
if (config->rach_delay > 68) {
printf("RACH delay is too big %i\n\n", config->rach_delay);
print_help();
exit(0);
}
}
int main(int argc, char *argv[])

View File

@@ -1017,30 +1017,36 @@ signalVector *genRandNormalBurst(int tsc, int sps, int tn)
/*
* Generate a random GSM access burst.
*/
signalVector *genRandAccessBurst(int sps, int tn)
signalVector *genRandAccessBurst(int delay, int sps, int tn)
{
if ((tn < 0) || (tn > 7))
return NULL;
if ((sps != 1) && (sps != 4))
return NULL;
if (delay > 68)
return NULL;
int i = 0;
BitVector *bits = new BitVector(88);
BitVector *bits = new BitVector(88+delay);
signalVector *burst;
/* delay */
for (; i < delay; i++)
(*bits)[i] = 0;
/* head and synch bits */
for (int n = 0; i < 49; i++, n++)
for (int n = 0; i < 49+delay; i++, n++)
(*bits)[i] = gRACHBurst[n];
/* Random bits */
for (; i < 85; i++)
for (; i < 85+delay; i++)
(*bits)[i] = rand() % 2;
/* Tail bits */
for (; i < 88; i++)
for (; i < 88+delay; i++)
(*bits)[i] = 0;
int guard = 68 + !(tn % 4);
int guard = 68-delay + !(tn % 4);
burst = modulateBurst(*bits, guard, sps);
delete bits;
@@ -1858,7 +1864,7 @@ int detectGeneralBurst(signalVector &rxBurst,
*
* Correlation window parameters:
* target: Tail bits + RACH length (reduced from 41 to a multiple of 4)
* head: Search 4 symbols before target
* head: Search 8 symbols before target
* tail: Search 4 symbols + maximum expected delay
*/
int detectRACHBurst(signalVector &rxBurst,
@@ -1872,7 +1878,7 @@ int detectRACHBurst(signalVector &rxBurst,
CorrelationSequence *sync;
target = 8 + 40;
head = 4;
head = 8;
tail = 4 + maxTOA;
sync = gRACHSequence;

View File

@@ -123,7 +123,7 @@ signalVector *generateEmptyBurst(int sps, int tn);
signalVector *genRandNormalBurst(int tsc, int sps, int tn);
/** Generate an access GSM burst with random payload - 4 or 1 SPS */
signalVector *genRandAccessBurst(int sps, int tn);
signalVector *genRandAccessBurst(int delay, int sps, int tn);
/** Generate a dummy GSM burst - 4 or 1 SPS */
signalVector *generateDummyBurst(int sps, int tn);

View File

@@ -1,5 +1,5 @@
if !ARCH_ARM
AM_CFLAGS = -Wall -std=gnu99 -march=native -I../common
AM_CFLAGS = -Wall -std=gnu99 -march=native -I${srcdir}/../common
noinst_LTLIBRARIES = libarch.la

15
debian/changelog vendored
View File

@@ -1,3 +1,18 @@
osmo-trx (0.1.10~2) trusty; urgency=medium
* c88385c makefile: Fix build from an external path.
* 0479562 EDGE: Fix demodulation slicer input
* d2b0703 uhd: Correct timing alignment in 8-PSK and GMSK downlink bursts
-- Alexander Chemeris <Alexander.Chemeris@gmail.com> Sat, 30 Apr 2016 01:57:45 +0300
osmo-trx (0.1.10~1) trusty; urgency=medium
* some EDGE support in master
* fairwaves/rach-filler branch
-- Kirill Zakharenko <earwin@gmail.com> Sun, 27 Mar 2016 19:37:39 +0100
osmo-trx (0.1.9) trusty; urgency=medium
* Ask Ivan, really

3
debian/rules vendored
View File

@@ -5,6 +5,9 @@ DEB_BUILD_HARDENING=1
%:
dh $@ --with autoreconf
override_dh_auto_configure:
dh_auto_configure -- --without-sse CFLAGS="-DHAVE_SSE3 -march=atom -mtune=atom -O2" CXXFLAGS="-DHAVE_SSE3 -march=atom -mtune=atom -O2"
override_dh_shlibdeps:
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info