comparison garage-resampler/Resampler.h @ 1:af48ddb3542a

Add one-shot resample function
author Chris Cannam
date Sun, 13 Oct 2013 12:47:50 +0100
parents 8dd4134043a1
children bda8d2e803ee
comparison
equal deleted inserted replaced
0:8dd4134043a1 1:af48ddb3542a
29 * the filter. (That is, the output will be delayed by this number 29 * the filter. (That is, the output will be delayed by this number
30 * of samples relative to the input.) 30 * of samples relative to the input.)
31 */ 31 */
32 int getLatency() const { return m_latency; } 32 int getLatency() const { return m_latency; }
33 33
34 /**
35 * Carry out a one-off resample of a single block of n
36 * samples. The output is latency-compensated.
37 */
38 static std::vector<double> resample
39 (int sourceRate, int targetRate, const double *data, int n);
40
34 private: 41 private:
35 int m_sourceRate; 42 int m_sourceRate;
36 int m_targetRate; 43 int m_targetRate;
37 int m_gcd; 44 int m_gcd;
38 int m_filterLength; 45 int m_filterLength;