aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/Resampler.h
diff options
context:
space:
mode:
authorTom Tsou <tom.tsou@ettus.com>2017-06-19 15:23:59 -0700
committerTom Tsou <tom@tsou.cc>2017-06-22 17:39:44 +0000
commitd2e5c5694e6dae078a104e7f5d05c87ed8286ea4 (patch)
tree10cf93e8d72f64f1752aa8ec7e0188a72307c7ff /Transceiver52M/Resampler.h
parenta3dce85ffca6b3eceb0bcd84719797a6443a217c (diff)
sigProcLib: Replace dynamically allocated resampling buffers
Instead use object allocated STL vectors. This simplifies code, removes the need to explicitly release buffers, and fixes a memory leak in destructor deallocation. Also, remove simplified init and release sub-calls. Maintain partition filter allocation using memalign() for SIMD alignment requirements. Change-Id: Ie836982794c10fb1b6334e40592d44b200454846
Diffstat (limited to 'Transceiver52M/Resampler.h')
-rw-r--r--Transceiver52M/Resampler.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Transceiver52M/Resampler.h b/Transceiver52M/Resampler.h
index c9f9787..caffc08 100644
--- a/Transceiver52M/Resampler.h
+++ b/Transceiver52M/Resampler.h
@@ -20,6 +20,9 @@
#ifndef _RESAMPLER_H_
#define _RESAMPLER_H_
+#include <vector>
+#include <complex>
+
class Resampler {
public:
/* Constructor for rational sample rate conversion
@@ -63,14 +66,11 @@ private:
size_t p;
size_t q;
size_t filt_len;
- size_t *in_index;
- size_t *out_path;
-
- float **partitions;
+ std::vector<size_t> in_index;
+ std::vector<size_t> out_path;
+ std::vector<std::complex<float> *> partitions;
- bool initFilters(float bw);
- void releaseFilters();
- void computePath();
+ void initFilters(float bw);
};
#endif /* _RESAMPLER_H_ */