aboutsummaryrefslogtreecommitdiffstats
path: root/AlignSample.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-11 21:10:16 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-11 21:10:16 +0100
commit134a1d2029bfc9a93903fdf8ff9ac3adde87f0a5 (patch)
tree4759745e4401aba0734326a607fafcf1c47a5c14 /AlignSample.cpp
parent05886065ea52559de5800850f728432c826f33b6 (diff)
downloadodr-dpd-134a1d2029bfc9a93903fdf8ff9ac3adde87f0a5.tar.gz
odr-dpd-134a1d2029bfc9a93903fdf8ff9ac3adde87f0a5.tar.bz2
odr-dpd-134a1d2029bfc9a93903fdf8ff9ac3adde87f0a5.zip
Add pointcloud display
Diffstat (limited to 'AlignSample.cpp')
-rw-r--r--AlignSample.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/AlignSample.cpp b/AlignSample.cpp
index b6afc2a..50b818e 100644
--- a/AlignSample.cpp
+++ b/AlignSample.cpp
@@ -210,6 +210,31 @@ CorrelationResult AlignSample::crosscorrelate(size_t len)
return result;
}
+std::pair<std::vector<complexf>, std::vector<complexf> > AlignSample::get_samples(
+ size_t len, size_t rx_delay)
+{
+ std::pair<std::vector<complexf>, std::vector<complexf> > rval;
+
+ std::lock_guard<std::mutex> lock(m_mutex);
+ if (align() and
+ m_rxsamples.size() > len + rx_delay
+ and m_txsamples.size() > len) {
+
+ rval.first.reserve(len);
+ rval.second.reserve(len);
+
+ std::copy(m_rxsamples.begin() + rx_delay,
+ m_rxsamples.begin() + rx_delay + len,
+ std::back_inserter(rval.first));
+
+ std::copy(m_txsamples.begin(),
+ m_txsamples.begin() + len,
+ std::back_inserter(rval.second));
+ }
+
+ return rval;
+}
+
void AlignSample::consume(size_t samples)
{
std::lock_guard<std::mutex> lock(m_mutex);