aboutsummaryrefslogtreecommitdiffstats
path: root/AlignSample.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-11 22:01:36 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-11-11 22:01:36 +0100
commit5bf73ca209108e2ce8f3919d453050d957212779 (patch)
tree8db7f8c9372e2d80caca1ed5dc38626433118876 /AlignSample.cpp
parent134a1d2029bfc9a93903fdf8ff9ac3adde87f0a5 (diff)
downloadodr-dpd-5bf73ca209108e2ce8f3919d453050d957212779.tar.gz
odr-dpd-5bf73ca209108e2ce8f3919d453050d957212779.tar.bz2
odr-dpd-5bf73ca209108e2ce8f3919d453050d957212779.zip
Fix correlation, add keys for usrp gain
Diffstat (limited to 'AlignSample.cpp')
-rw-r--r--AlignSample.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/AlignSample.cpp b/AlignSample.cpp
index 50b818e..4f5a8eb 100644
--- a/AlignSample.cpp
+++ b/AlignSample.cpp
@@ -186,7 +186,7 @@ CorrelationResult AlignSample::crosscorrelate(size_t len)
tx_fft_plan.execute();
for (size_t i = 0; i < len; i++) {
- ifft_in[i] = rx_fft_out[i] * std::conj(tx_fft_out[i]);
+ ifft_in[i] = tx_fft_out[i] * std::conj(rx_fft_out[i]);
}
ifft_plan.execute();
@@ -195,18 +195,6 @@ CorrelationResult AlignSample::crosscorrelate(size_t len)
result.correlation[i] = ifft_out[i];
}
-#if 0
- // Calculate correlation
- for (size_t offset = 0; offset < max_offset; offset++) {
- complexf xcorr(0, 0);
-
- for (size_t i = 0; i < len; i++) {
- xcorr += rxsamps[i]/rx_power_f * std::conj(txsamps[i+offset])/tx_power_f;
- }
- result.correlation[offset] = xcorr;
- }
-#endif
-
return result;
}