Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
obejarano committed Mar 10, 2021
2 parents 650f499 + 340e8cb commit cbc6ab7
Show file tree
Hide file tree
Showing 52 changed files with 2,748 additions and 930 deletions.
2 changes: 1 addition & 1 deletion .githooks/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

echo "Starting post-checkout hook ..."
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
CI_BUILD_STATUS_BADGE="[![Build Status](https://4489496cb62a.ngrok.io/buildStatus/icon?job=github_public_renewlab%2F${BRANCH_NAME})](https://4489496cb62a.ngrok.io/job/github_public_renewlab/job/${BRANCH_NAME}/)"
CI_BUILD_STATUS_BADGE="[![Build Status](https://falcon.ecg.rice.edu:443/buildStatus/icon?job=github_public_renewlab%2F${BRANCH_NAME})](https://falcon.ecg.rice.edu:443/job/github_public_renewlab/job/${BRANCH_NAME}/)"
echo $BRANCH_NAME
echo $CI_BUILD_STATUS_BADGE

Expand Down
23 changes: 10 additions & 13 deletions CC/Sounder/BaseRadioSet-calibrate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ void BaseRadioSet::dciqCalibrationProc(size_t channel)
double toneBBFreq = sampleRate / 7;
size_t radioSize = _cfg->n_bs_sdrs().at(0);

size_t referenceRadio = radioSize / 2;
size_t referenceRadio = _cfg->cal_ref_sdr_id(); //radioSize / 2;
Radio* refRadio = bsRadios[0][referenceRadio];
SoapySDR::Device* refDev = refRadio->dev;

Expand Down Expand Up @@ -525,24 +525,21 @@ void BaseRadioSet::collectCSI(bool& adjust)
<< std::endl;
return;
}
std::vector<std::vector<double>> pilot;
std::vector<std::complex<double>> pilot;
//std::vector<std::complex<float>> pilot_cf32;
std::vector<std::complex<int16_t>> pilot_cint16;
int type = CommsLib::LTS_SEQ;
int seqLen = 160; // Sequence length
pilot = CommsLib::getSequence(seqLen, type);
// double array to complex 32-bit float vector
double max_abs = 0;
auto lts = CommsLib::getSequence(CommsLib::LTS_SEQ);
auto lts_size = pilot.size();
for (int i = 0; i < seqLen; i++) {
std::complex<double> samp(pilot[0][i], pilot[1][i]);
max_abs = max_abs > std::abs(samp) ? max_abs : std::abs(samp);
pilot.push_back(
std::complex<double>(lts[0][i % lts_size], lts[1][i % lts_size]));
}

auto iq_ci16 = Utils::double_to_cint16(lts);
pilot_cint16.resize(seqLen);
for (int i = 0; i < seqLen; i++) {
auto re = 0.25 * pilot[0][i] / max_abs * 32767;
auto im = 0.25 * pilot[1][i] / max_abs * 32767;
pilot_cint16[i] = std::complex<int16_t>((int16_t)re, (int16_t)im);
pilot_cint16.push_back(iq_ci16[i % lts_size]);
}

// Prepend/Append vectors with prefix/postfix number of null samples
Expand Down Expand Up @@ -630,7 +627,7 @@ void BaseRadioSet::collectCSI(bool& adjust)
}
}

int ref_ant = 0;
int ref_ant = _cfg->cal_ref_sdr_id();
int ref_offset = ref_ant == 0 ? 1 : 0;
std::vector<int> offset(R);

Expand All @@ -643,7 +640,7 @@ void BaseRadioSet::collectCSI(bool& adjust)
return std::complex<double>(
cf.real() / 32768.0, cf.imag() / 32768.0);
});
int peak = CommsLib::findLTS(rx, seqLen);
int peak = CommsLib::find_pilot_seq(rx, pilot, seqLen);
offset[i] = peak < 128 ? 0 : peak - 128;
//std::cout << i << " " << offset[i] << std::endl;
if (offset[i] == 0)
Expand Down
72 changes: 72 additions & 0 deletions CC/Sounder/BaseRadioSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,76 @@ BaseRadioSet::BaseRadioSet(Config* cfg)

while (thread_count.load() > 0) {
}

auto channels = Utils::strToChannels(_cfg->bs_channel());

for (size_t i = 0; i < bsRadios.at(c).size(); i++) {
auto dev = bsRadios.at(c).at(i)->dev;
std::cout << _cfg->bs_sdr_ids().at(c).at(i) << ": Front end "
<< dev->getHardwareInfo()["frontend"] << std::endl;
for (auto ch : channels) {
if (ch < dev->getNumChannels(SOAPY_SDR_RX)) {
printf("RX Channel %zu\n", ch);
printf("Actual RX sample rate: %fMSps...\n",
(dev->getSampleRate(SOAPY_SDR_RX, ch) / 1e6));
printf("Actual RX frequency: %fGHz...\n",
(dev->getFrequency(SOAPY_SDR_RX, ch) / 1e9));
printf("Actual RX gain: %f...\n",
(dev->getGain(SOAPY_SDR_RX, ch)));
if (!kUseUHD) {
printf("Actual RX LNA gain: %f...\n",
(dev->getGain(SOAPY_SDR_RX, ch, "LNA")));
printf("Actual RX PGA gain: %f...\n",
(dev->getGain(SOAPY_SDR_RX, ch, "PGA")));
printf("Actual RX TIA gain: %f...\n",
(dev->getGain(SOAPY_SDR_RX, ch, "TIA")));
if (dev->getHardwareInfo()["frontend"].find("CBRS")
!= std::string::npos) {
printf("Actual RX LNA1 gain: %f...\n",
(dev->getGain(SOAPY_SDR_RX, ch, "LNA1")));
printf("Actual RX LNA2 gain: %f...\n",
(dev->getGain(SOAPY_SDR_RX, ch, "LNA2")));
}
}
printf("Actual RX bandwidth: %fM...\n",
(dev->getBandwidth(SOAPY_SDR_RX, ch) / 1e6));
printf("Actual RX antenna: %s...\n",
(dev->getAntenna(SOAPY_SDR_RX, ch).c_str()));
}
}

for (auto ch : channels) {
if (ch < dev->getNumChannels(SOAPY_SDR_TX)) {
printf("TX Channel %zu\n", ch);
printf("Actual TX sample rate: %fMSps...\n",
(dev->getSampleRate(SOAPY_SDR_TX, ch) / 1e6));
printf("Actual TX frequency: %fGHz...\n",
(dev->getFrequency(SOAPY_SDR_TX, ch) / 1e9));
printf("Actual TX gain: %f...\n",
(dev->getGain(SOAPY_SDR_TX, ch)));
if (!kUseUHD) {
printf("Actual TX PAD gain: %f...\n",
(dev->getGain(SOAPY_SDR_TX, ch, "PAD")));
printf("Actual TX IAMP gain: %f...\n",
(dev->getGain(SOAPY_SDR_TX, ch, "IAMP")));
if (dev->getHardwareInfo()["frontend"].find("CBRS")
!= std::string::npos) {
printf("Actual TX PA1 gain: %f...\n",
(dev->getGain(SOAPY_SDR_TX, ch, "PA1")));
printf("Actual TX PA2 gain: %f...\n",
(dev->getGain(SOAPY_SDR_TX, ch, "PA2")));
printf("Actual TX PA3 gain: %f...\n",
(dev->getGain(SOAPY_SDR_TX, ch, "PA3")));
}
}
printf("Actual TX bandwidth: %fM...\n",
(dev->getBandwidth(SOAPY_SDR_TX, ch) / 1e6));
printf("Actual TX antenna: %s...\n",
(dev->getAntenna(SOAPY_SDR_TX, ch).c_str()));
}
}
std::cout << std::endl;
}
// Measure Sync Delays now!
if (kUseUHD == false) {
sync_delays(c);
Expand Down Expand Up @@ -191,6 +261,8 @@ BaseRadioSet::BaseRadioSet(Config* cfg)
char sym_type = fw_frame.at(s);
if (sym_type == 'P')
fw_frame.replace(s, 1, "R"); // uplink pilots
else if (sym_type == 'N')
fw_frame.replace(s, 1, "R"); // uplink data
else if (sym_type == 'U')
fw_frame.replace(s, 1, "R"); // uplink data
else if (sym_type == 'D')
Expand Down
2 changes: 1 addition & 1 deletion CC/Sounder/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.10)
project(Sounder)

if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
Expand Down
Loading

0 comments on commit cbc6ab7

Please sign in to comment.