Mercurial > hg > qm-dsp
diff tests/TestResampler.cpp @ 156:edb86e0d850c
Lower filter cutoff to below target Nyquist when downsampling
author | Chris Cannam |
---|---|
date | Fri, 01 Nov 2013 12:07:08 +0000 |
parents | 23558405a7d1 |
children | 17a7d6bb9af6 |
line wrap: on
line diff
--- a/tests/TestResampler.cpp Tue Oct 22 08:58:28 2013 +0100 +++ b/tests/TestResampler.cpp Fri Nov 01 12:07:08 2013 +0000 @@ -197,9 +197,9 @@ outSpectrum[i] /= outrate; } - // Don't compare bins any higher than 99% of Nyquist freq of lower sr + // Don't compare bins any higher than 96% of Nyquist freq of lower sr int lengthOfInterest = (inrate < outrate ? inrate : outrate) / 2; - lengthOfInterest = lengthOfInterest - (lengthOfInterest / 100); + lengthOfInterest = lengthOfInterest - (lengthOfInterest / 25); for (int i = 0; i < lengthOfInterest; ++i) { BOOST_CHECK_SMALL(inSpectrum[i] - outSpectrum[i], 1e-7);