/* * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/
#define _USE_MATH_DEFINES
#include"common_audio/window_generator.h"
#include <cmath> #include <complex>
#include"rtc_base/checks.h"
using std::complex;
namespace {
// Modified Bessel function of order 0 for complex inputs.
complex<float> I0(complex<float> x) {
complex<float> y = x / 3.75f;
y *= y; return 1.0f + y * (3.5156229f +
y * (3.0899424f +
y * (1.2067492f +
y * (0.2659732f +
y * (0.360768e-1f + y * 0.45813e-2f)))));
}
} // namespace
namespace webrtc {
void WindowGenerator::Hanning(int length, float* window) {
RTC_CHECK_GT(length, 1);
RTC_CHECK(window != nullptr); for (int i = 0; i < length; ++i) {
window[i] =
0.5f * (1 - cosf(2 * static_cast<float>(M_PI) * i / (length - 1)));
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.