From dcd2d1200fef466ef0fc48d54b3c9fc54e87425b Mon Sep 17 00:00:00 2001 From: Dimitri Diakopoulos Date: Tue, 26 Jul 2016 09:48:09 -0700 Subject: [PATCH] comment about the linear resample function --- include/libnyquist/WavEncoder.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/libnyquist/WavEncoder.h b/include/libnyquist/WavEncoder.h index 76358b6..8aedfb6 100644 --- a/include/libnyquist/WavEncoder.h +++ b/include/libnyquist/WavEncoder.h @@ -33,6 +33,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace nqr { + // This is a naieve implementation of a resampling filter where a lerp is used as a bad low-pass. + // It very far from the ideal case and should be used with caution (or not at all) on signals that matter. + // It is included here to upsample 44.1k to 48k for the purposes of microphone input => Opus, where the the + // nominal frequencies of speech are particularly far from Nyquist. static inline void linear_resample(const double rate, const std::vector & input, std::vector & output, size_t samplesToProcess) { double virtualReadIndex = 0;