MCPcopy Create free account
hub / github.com/alibaba/MNN / hamming_window

Function hamming_window

tools/audio/source/audio.cpp:291–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

289}
290
291VARP hamming_window(int n_fft, bool periodic, float alpha, float beta) {
292 auto window = _Input({n_fft}, NHWC);
293 auto window_ptr = window->writeMap<float>();
294 int N = periodic ? n_fft : n_fft - 1;
295 for (int n = 0; n < n_fft; ++n) {
296 window_ptr[n] = alpha - beta * std::cos(2.0 * M_PI * n / N);
297 }
298 return window;
299}
300
301VARP hann_window(int n_fft, bool periodic) {
302 auto window = _Input({n_fft}, NHWC);

Callers 2

spectrogramFunction · 0.70
audio_test.cppFile · 0.50

Calls 2

_InputFunction · 0.85
cosFunction · 0.50

Tested by

no test coverage detected