aboutsummaryrefslogtreecommitdiffstats
path: root/src/transient_detector.cpp
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2024-07-09 21:55:23 +0000
committerDaniil Cherednik <dan.cherednik@gmail.com>2024-07-09 22:08:38 +0000
commitf1c9056c40e22b6aea21da5281e469b93a334778 (patch)
tree8d6658c4fdbf4d25d3a593fba14b93ac158a4cd0 /src/transient_detector.cpp
parent73619bbbcd1f0c3d6ff3cada2b06379031f856b7 (diff)
parentc4b19af8391640f143aaf446658354dcf01432d1 (diff)
downloadatracdenc-f1c9056c40e22b6aea21da5281e469b93a334778.tar.gz
Merge branch 'master' into at3plus-dev
Diffstat (limited to 'src/transient_detector.cpp')
-rw-r--r--src/transient_detector.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/transient_detector.cpp b/src/transient_detector.cpp
index 8e4c072..ca96cd4 100644
--- a/src/transient_detector.cpp
+++ b/src/transient_detector.cpp
@@ -51,18 +51,18 @@ void TTransientDetector::HPFilter(const TFloat* in, TFloat* out) {
-3.36639e-17 * 2.0, -0.0438162 * 2.0, -1.54175e-17 * 2.0, 0.0931738 * 2.0,
-5.52212e-17 * 2.0, -0.313819 * 2.0
};
- memcpy(HPFBuffer.data() + PrevBufSz, in, BlockSz * sizeof(double));
- const double* inBuf = HPFBuffer.data();
+ memcpy(HPFBuffer.data() + PrevBufSz, in, BlockSz * sizeof(TFloat));
+ const TFloat* inBuf = HPFBuffer.data();
for (size_t i = 0; i < BlockSz; ++i) {
- double s = inBuf[i + 10];
- double s2 = 0;
+ TFloat s = inBuf[i + 10];
+ TFloat s2 = 0;
for (size_t j = 0; j < ((FIRLen - 1) / 2) - 1 ; j += 2) {
s += fircoef[j] * (inBuf[i + j] + inBuf[i + FIRLen - j]);
s2 += fircoef[j + 1] * (inBuf[i + j + 1] + inBuf[i + FIRLen - j - 1]);
}
out[i] = (s + s2)/2;
}
- memcpy(HPFBuffer.data(), in + (BlockSz - PrevBufSz), PrevBufSz * sizeof(double));
+ memcpy(HPFBuffer.data(), in + (BlockSz - PrevBufSz), PrevBufSz * sizeof(TFloat));
}