diff --git a/modules/audio_processing/aec3/decimator.cc b/modules/audio_processing/aec3/decimator.cc index 0ebc7db0bb..3f350582b4 100644 --- a/modules/audio_processing/aec3/decimator.cc +++ b/modules/audio_processing/aec3/decimator.cc @@ -20,11 +20,11 @@ const std::vector kLowPassFilterDS2 = { {{-1.f, 0.f}, {0.13833231f, 0.40743176f}, 0.22711796393486466f}, {{-1.f, 0.f}, {0.13833231f, 0.40743176f}, 0.22711796393486466f}}; -// signal.butter(2, 750/8000.0, 'lowpass', analog=False) +// signal.ellip(6, 1, 40, 1800/8000, btype='lowpass', analog=False) const std::vector kLowPassFilterDS4 = { - {{-1.f, 0.f}, {0.79396855f, 0.17030506f}, 0.017863192751682862f}, - {{-1.f, 0.f}, {0.79396855f, 0.17030506f}, 0.017863192751682862f}, - {{-1.f, 0.f}, {0.79396855f, 0.17030506f}, 0.017863192751682862f}}; + {{-0.08873842f, 0.99605496f}, {0.75916227f, 0.23841065f}, 0.26250696827f}, + {{0.62273832f, 0.78243018f}, {0.74892112f, 0.5410152f}, 0.26250696827f}, + {{0.71107693f, 0.70311421f}, {0.74895534f, 0.63924616f}, 0.26250696827f}}; // signal.cheby1(1, 6, [1000/8000, 2000/8000], btype='bandpass', analog=False) const std::vector kBandPassFilterDS8 = { diff --git a/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc b/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc index 38f31c9ea6..8dd3bc638b 100644 --- a/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc +++ b/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc @@ -93,12 +93,14 @@ TEST(EchoPathDelayEstimator, DelayEstimation) { } if (estimated_delay_samples) { - // Due to the internal down-sampling done inside the delay estimator - // the estimated delay cannot be expected to be exact to the true delay. - EXPECT_NEAR(delay_samples, - estimated_delay_samples->delay - - (config.delay.api_call_jitter_blocks + 1) * 64, - config.delay.down_sampling_factor); + // Allow estimated delay to be off by one sample in the down-sampled + // domain. + size_t delay_ds = delay_samples / down_sampling_factor; + size_t estimated_delay_ds = + (estimated_delay_samples->delay - + (config.delay.api_call_jitter_blocks + 1) * 64) / + down_sampling_factor; + EXPECT_NEAR(delay_ds, estimated_delay_ds, 1); } else { ADD_FAILURE(); }