| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
| 11 // | 11 // |
| 12 // Specifies helper classes for intelligibility enhancement. | 12 // Specifies helper classes for intelligibility enhancement. |
| 13 // | 13 // |
| 14 | 14 |
| 15 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_ | 15 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_ |
| 16 #define WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_ | 16 #define WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS_H_ |
| 17 | 17 |
| 18 #include <complex> | 18 #include <complex> |
| 19 | 19 |
| 20 #include "webrtc/base/scoped_ptr.h" | 20 #include "webrtc/base/scoped_ptr.h" |
| 21 | 21 |
| 22 namespace webrtc { | 22 namespace webrtc { |
| 23 | 23 |
| 24 namespace intelligibility { | 24 namespace intelligibility { |
| 25 | 25 |
| 26 // Return |current| changed towards |target|, with the change being at most | 26 // Return |current| changed towards |target|, with the change being at most |
| 27 // |limit|. | 27 // |limit|. |
| 28 float UpdateFactor(float target, float current, float limit); | 28 float UpdateFactor(float target, float current, float limit); |
| 29 | 29 |
| 30 // std::isfinite for complex numbers. | |
| 31 bool cplxfinite(std::complex<float> c); | |
| 32 | |
| 33 // std::isnormal for complex numbers. | |
| 34 bool cplxnormal(std::complex<float> c); | |
| 35 | |
| 36 // Apply a small fudge to degenerate complex values. The numbers in the array | 30 // Apply a small fudge to degenerate complex values. The numbers in the array |
| 37 // were chosen randomly, so that even a series of all zeroes has some small | 31 // were chosen randomly, so that even a series of all zeroes has some small |
| 38 // variability. | 32 // variability. |
| 39 std::complex<float> zerofudge(std::complex<float> c); | 33 std::complex<float> zerofudge(std::complex<float> c); |
| 40 | 34 |
| 41 // Incremental mean computation. Return the mean of the series with the | 35 // Incremental mean computation. Return the mean of the series with the |
| 42 // mean |mean| with added |data|. | 36 // mean |mean| with added |data|. |
| 43 std::complex<float> NewMean(std::complex<float> mean, | 37 std::complex<float> NewMean(std::complex<float> mean, |
| 44 std::complex<float> data, | 38 std::complex<float> data, |
| 45 int count); | 39 int count); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 const float change_limit_; | 149 const float change_limit_; |
| 156 rtc::scoped_ptr<float[]> target_; | 150 rtc::scoped_ptr<float[]> target_; |
| 157 rtc::scoped_ptr<float[]> current_; | 151 rtc::scoped_ptr<float[]> current_; |
| 158 }; | 152 }; |
| 159 | 153 |
| 160 } // namespace intelligibility | 154 } // namespace intelligibility |
| 161 | 155 |
| 162 } // namespace webrtc | 156 } // namespace webrtc |
| 163 | 157 |
| 164 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS
_H_ | 158 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_INTELLIGIBILITY_INTELLIGIBILITY_UTILS
_H_ |
| OLD | NEW |