Compare commits

...

7 Commits

Author SHA1 Message Date
Tom Tsou
1535052873 mcbts: Fix maximum number in channels in multicarrier config
Maximum number of carriers is fixed to 3 channels on a single
physical RF channel.

Fixes: Coverity CID 149353t
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-10-04 12:06:35 -07:00
Tom Tsou
49792aa1f7 sigproc: Remove non-functional TSC check
Remove unsigned compare against less-than-zero.

Fixes: Coverity CID 149352
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-10-04 12:00:45 -07:00
Tom Tsou
e5c36f6abb sigproc: Remove non-functional length check
Remove unsigned comparision against less than zero.

Fixes: Coverity CID 149351
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-10-04 11:59:05 -07:00
Tom Tsou
bbefe9eaff sigproc: Fix boolean return value check
Fix always-false condition due to integer instead of boolean
return value check.

Fixes: Coverity CID 149345
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-10-04 11:56:33 -07:00
Tom Tsou
5e3e23c337 sigproc: Remove logically dead code path
Burst detection core always operates at 1 sample-per-symbol.

Fixes: Coverity CID 149343
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-10-04 11:52:38 -07:00
Tom Tsou
8a2a0f0e17 sigproc: Coverity fix for unchecked return value
Check return value on burst downsampling. Return NULL on downsampling
failure (invalid bounds check).

Fixes: Coverity CID 149332
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-10-04 11:45:42 -07:00
Tom Tsou
1cc9505011 uhd: Set default Rx sampling to 4 sps
Matching Tx and Rx sample rates reduces run-to-run timing
variability due to DDC/DUC timing ambiguity within the UHD
FPGA. Make this the default setting.

Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-08-11 15:17:55 -07:00
4 changed files with 24 additions and 17 deletions

View File

@@ -185,13 +185,13 @@ int Resampler::rotate(const float *in, size_t in_len, float *out, size_t out_len
n, 1, 1, 0);
}
return out_len;
return 0;
}
bool Resampler::init(float bw)
{
/* Filterbank filter internals */
if (initFilters(bw) < 0)
if (!initFilters(bw))
return false;
/* Precompute filterbank paths */

View File

@@ -47,7 +47,7 @@ public:
* @param in_len input buffer length
* @param out continuous buffer of output complex float values
* @param out_len output buffer length
* @return number of samples outputted, negative on error
* @return 0 on success and negative on error
*
* Input and output vector lengths must of be equal multiples of the
* rational conversion rate denominator and numerator respectively.

View File

@@ -43,11 +43,10 @@
/*
* Samples-per-symbol for uplink (receiver) path
* Do not modify this value. EDGE configures 4 sps automatically on
* B200/B210 devices only. Use of 4 sps on the receive path for other
* configurations is not supported.
* 4 - Provides better timing precision (avoids FPGA DDC timing ambiguity)
* 1 - Reduces processor load, but increases timing ambiguity
*/
#define DEFAULT_RX_SPS 1
#define DEFAULT_RX_SPS 4
/* Default configuration parameters
* Note that these values are only used if the particular key does not
@@ -61,6 +60,9 @@
#define DEFAULT_DIVERSITY false
#define DEFAULT_CHANS 1
/* Max number of channels in multi-carrier configuration */
#define MAX_MCHANS 3
struct trx_config {
std::string log_level;
std::string addr;
@@ -168,7 +170,7 @@ bool trx_setup_config(struct trx_config *config)
if (!config->chans)
config->chans = DEFAULT_CHANS;
if (config->mcbts && ((config->chans < 0) || (config->chans > 5))) {
if (config->mcbts && (config->chans > MAX_MCHANS)) {
std::cout << "Unsupported number of channels" << std::endl;
return false;
}

View File

@@ -1729,8 +1729,10 @@ bool energyDetect(signalVector &rxBurst,
signalVector::const_iterator windowItr = rxBurst.begin(); //+rxBurst.size()/2 - 5*windowLength/2;
float energy = 0.0;
if (windowLength < 0) windowLength = 20;
if (windowLength > rxBurst.size()) windowLength = rxBurst.size();
if (windowLength > rxBurst.size())
windowLength = rxBurst.size();
for (unsigned i = 0; i < windowLength; i++) {
energy += windowItr->norm2();
windowItr+=4;
@@ -1790,10 +1792,6 @@ static int detectBurst(signalVector &burst,
/* Normalize our channel gain */
*amp = *amp / sync->gain;
/* Compenate for residual rotation with dual Laurent pulse */
if (sps == 4)
*amp = *amp * complex(0.0, 1.0);
/* Compensate for residuate time lag */
*toa = *toa - sync->toa;
@@ -1911,7 +1909,7 @@ int analyzeTrafficBurst(signalVector &rxBurst, unsigned tsc, float thresh,
int rc, target, head, tail;
CorrelationSequence *sync;
if ((tsc < 0) || (tsc > 7))
if (tsc > 7)
return -SIGERR_UNSUPPORTED;
target = 3 + 58 + 16 + 5;
@@ -1945,15 +1943,22 @@ int detectEdgeBurst(signalVector &rxBurst, unsigned tsc, float thresh,
signalVector *downsampleBurst(signalVector &burst)
{
int rc;
signalVector *in, *out;
in = new signalVector(DOWNSAMPLE_IN_LEN, dnsampler->len());
out = new signalVector(DOWNSAMPLE_OUT_LEN);
memcpy(in->begin(), burst.begin(), DOWNSAMPLE_IN_LEN * 2 * sizeof(float));
dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN,
(float *) out->begin(), DOWNSAMPLE_OUT_LEN);
rc = dnsampler->rotate((float *) in->begin(), DOWNSAMPLE_IN_LEN,
(float *) out->begin(), DOWNSAMPLE_OUT_LEN);
delete in;
if (rc < 0) {
delete out;
return NULL;
}
return out;
};