tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

lp_residual.h (1411B)


      1 /*
      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 
     14 #include <stddef.h>
     15 
     16 #include "api/array_view.h"
     17 
     18 namespace webrtc {
     19 namespace rnn_vad {
     20 
     21 // Linear predictive coding (LPC) inverse filter length.
     22 constexpr int kNumLpcCoefficients = 5;
     23 
     24 // Given a frame `x`, computes a post-processed version of LPC coefficients
     25 // tailored for pitch estimation.
     26 void ComputeAndPostProcessLpcCoefficients(
     27    ArrayView<const float> x,
     28    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.
     33 void ComputeLpResidual(ArrayView<const float, kNumLpcCoefficients> lpc_coeffs,
     34                       ArrayView<const float> x,
     35                       ArrayView<float> y);
     36 
     37 }  // namespace rnn_vad
     38 }  // namespace webrtc
     39 
     40 #endif  // MODULES_AUDIO_PROCESSING_AGC2_RNN_VAD_LP_RESIDUAL_H_