summaryrefslogtreecommitdiffstats
path: root/include-gpl
diff options
context:
space:
mode:
authorChristian Daniel <cd@maintech.de>2013-08-07 23:23:25 +0200
committerChristian Daniel <cd@maintech.de>2013-08-07 23:23:25 +0200
commitfb090cdfa91ae3ead3d23969d4fad3aab7caa8b1 (patch)
tree64a72c907d1da9e89674578249989be1d240f140 /include-gpl
parent37e6f6ff29f34d7dda7450ed41ef677d7a083eb5 (diff)
improve interpolator
Diffstat (limited to 'include-gpl')
-rw-r--r--include-gpl/dsp/interpolator.h8
-rw-r--r--include-gpl/dsp/inthalfbandfilter.h2
2 files changed, 4 insertions, 6 deletions
diff --git a/include-gpl/dsp/interpolator.h b/include-gpl/dsp/interpolator.h
index 9aa86a0..bdf538e 100644
--- a/include-gpl/dsp/interpolator.h
+++ b/include-gpl/dsp/interpolator.h
@@ -8,7 +8,7 @@ class SDRANGELOVE_API Interpolator {
public:
Interpolator();
- void create(int nTaps, int phaseSteps, double sampleRate, double cutoff);
+ void create(int phaseSteps, double sampleRate, double cutoff);
bool interpolate(Real* distance, const Complex& next, bool* consumed, Complex* result)
{
@@ -39,7 +39,7 @@ private:
{
m_ptr--;
if(m_ptr < 0)
- m_ptr = m_nTaps;
+ m_ptr = m_nTaps - 1;
m_samples[m_ptr] = next;
}
@@ -53,9 +53,7 @@ private:
for(int i = 0; i < m_nTaps; i++) {
rAcc += *coeff * m_samples[sample].real();
iAcc += *coeff * m_samples[sample].imag();
- sample++;
- if(sample >= m_nTaps)
- sample = 0;
+ sample = (sample + 1) % m_nTaps;
coeff++;
}
*result = Complex(rAcc, iAcc);
diff --git a/include-gpl/dsp/inthalfbandfilter.h b/include-gpl/dsp/inthalfbandfilter.h
index 37c4519..ccc1bfa 100644
--- a/include-gpl/dsp/inthalfbandfilter.h
+++ b/include-gpl/dsp/inthalfbandfilter.h
@@ -10,7 +10,7 @@
/*
* supported filter orders: 64, 48, 32
*/
-#define HB_FILTERORDER 48
+#define HB_FILTERORDER 32
#define HB_SHIFT 14
class SDRANGELOVE_API IntHalfbandFilter {