improve SINC resampler coefficients
- we increase the interpolation precision from 4 to 7 bits
this doesn't increase CPU power required, it only increases the
size of the filter table but significantly reduces the noise
introduced by the quantization of the impulse response.
- the parameters of the filter are set such that aliasing is
rejected at 80 dB below 20 KHz. Because we don't use a lot of
coefficient (to save compute power), there are quite a bit of
attenuation in the pass-band: starting at 9KHz for the
down-sampler (48 to 44.1), and starting at 13 KHz for the
up-sampler (44.1 to 48) -- the transition band is about 15 KHz.
Change-Id: I855548d2aab8a0fb0d2a2da3a364b6842d7d3838
diff --git a/services/audioflinger/AudioResamplerSinc.h b/services/audioflinger/AudioResamplerSinc.h
index 25fc025..48bc747 100644
--- a/services/audioflinger/AudioResamplerSinc.h
+++ b/services/audioflinger/AudioResamplerSinc.h
@@ -71,7 +71,7 @@
// ----------------------------------------------------------------------------
static const int32_t RESAMPLE_FIR_NUM_COEF = 8;
- static const int32_t RESAMPLE_FIR_LERP_INT_BITS = 4;
+ static const int32_t RESAMPLE_FIR_LERP_INT_BITS = 7;
struct Constants {
// we have 16 coefs samples per zero-crossing