| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| 33 // Verifies that the correct ERLE estimates are achieved. | 33 // Verifies that the correct ERLE estimates are achieved. |
| 34 TEST(ErleEstimator, Estimates) { | 34 TEST(ErleEstimator, Estimates) { |
| 35 std::array<float, kFftLengthBy2Plus1> X2; | 35 std::array<float, kFftLengthBy2Plus1> X2; |
| 36 std::array<float, kFftLengthBy2Plus1> E2; | 36 std::array<float, kFftLengthBy2Plus1> E2; |
| 37 std::array<float, kFftLengthBy2Plus1> Y2; | 37 std::array<float, kFftLengthBy2Plus1> Y2; |
| 38 | 38 |
| 39 ErleEstimator estimator; | 39 ErleEstimator estimator(1.f, 8.f, 1.5f); |
| 40 | 40 |
| 41 // Verifies that the ERLE estimate is properley increased to higher values. | 41 // Verifies that the ERLE estimate is properley increased to higher values. |
| 42 X2.fill(500 * 1000.f * 1000.f); | 42 X2.fill(500 * 1000.f * 1000.f); |
| 43 E2.fill(1000.f * 1000.f); | 43 E2.fill(1000.f * 1000.f); |
| 44 Y2.fill(10 * E2[0]); | 44 Y2.fill(10 * E2[0]); |
| 45 for (size_t k = 0; k < 200; ++k) { | 45 for (size_t k = 0; k < 200; ++k) { |
| 46 estimator.Update(X2, Y2, E2); | 46 estimator.Update(X2, Y2, E2); |
| 47 } | 47 } |
| 48 VerifyErle(estimator.Erle(), 8.f, 1.5f); | 48 VerifyErle(estimator.Erle(), 8.f, 1.5f); |
| 49 | 49 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 64 // Verifies that the ERLE estimate is is not updated for low-level render | 64 // Verifies that the ERLE estimate is is not updated for low-level render |
| 65 // signals. | 65 // signals. |
| 66 X2.fill(1000.f * 1000.f); | 66 X2.fill(1000.f * 1000.f); |
| 67 Y2.fill(10 * E2[0]); | 67 Y2.fill(10 * E2[0]); |
| 68 for (size_t k = 0; k < 200; ++k) { | 68 for (size_t k = 0; k < 200; ++k) { |
| 69 estimator.Update(X2, Y2, E2); | 69 estimator.Update(X2, Y2, E2); |
| 70 } | 70 } |
| 71 VerifyErle(estimator.Erle(), 1.f, 1.f); | 71 VerifyErle(estimator.Erle(), 1.f, 1.f); |
| 72 } | 72 } |
| 73 } // namespace webrtc | 73 } // namespace webrtc |
| OLD | NEW |