blob: cddedca5d614ec94a0f36544b73d9309e4e8dd6a [file] [log] [blame]
Alessio Bazzicae63d38b2018-04-19 17:56:55 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_LP_RESIDUAL_H_
12#define MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_LP_RESIDUAL_H_
13
Yves Gerey988cc082018-10-23 12:03:01 +020014#include <stddef.h>
15
Alessio Bazzicae63d38b2018-04-19 17:56:55 +020016#include "api/array_view.h"
17
18namespace webrtc {
19namespace rnn_vad {
20
21// LPC inverse filter length.
22constexpr size_t kNumLpcCoefficients = 5;
23
24// Given a frame |x|, computes a post-processed version of LPC coefficients
25// tailored for pitch estimation.
26void ComputeAndPostProcessLpcCoefficients(
27 rtc::ArrayView<const float> x,
28 rtc::ArrayView<float, kNumLpcCoefficients> lpc_coeffs);
29
30// Computes the LP residual for the input frame |x| and the LPC coefficients
31// |lpc_coeffs|. |y| and |x| can point to the same array for in-place
32// computation.
33void ComputeLpResidual(
34 rtc::ArrayView<const float, kNumLpcCoefficients> lpc_coeffs,
35 rtc::ArrayView<const float> x,
36 rtc::ArrayView<float> y);
37
38} // namespace rnn_vad
39} // namespace webrtc
40
41#endif // MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_LP_RESIDUAL_H_