Mercurial > hg > qm-dsp
diff dsp/rateconversion/Resampler.h @ 363:2fe2ab316c8e
Add one-shot resample function
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Sun, 13 Oct 2013 12:47:50 +0100 |
parents | 3953f3ef1b62 |
children | 7fe0da91e9c3 |
line wrap: on
line diff
--- a/dsp/rateconversion/Resampler.h Fri Oct 11 18:00:51 2013 +0100 +++ b/dsp/rateconversion/Resampler.h Sun Oct 13 12:47:50 2013 +0100 @@ -31,6 +31,13 @@ */ int getLatency() const { return m_latency; } + /** + * Carry out a one-off resample of a single block of n + * samples. The output is latency-compensated. + */ + static std::vector<double> resample + (int sourceRate, int targetRate, const double *data, int n); + private: int m_sourceRate; int m_targetRate;