Home | History | Annotate | Download | only in source
      1 /*
      2  *  Copyright (c) 2011 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 
     12 /*
     13  * This header file includes the VAD internal calls for Downsampling and FindMinimum.
     14  * Specific function calls are given below.
     15  */
     16 
     17 #ifndef WEBRTC_VAD_SP_H_
     18 #define WEBRTC_VAD_SP_H_
     19 
     20 #include "vad_core.h"
     21 
     22 /****************************************************************************
     23  * WebRtcVad_Downsampling(...)
     24  *
     25  * Downsamples the signal a factor 2, eg. 32->16 or 16->8
     26  *
     27  * Input:
     28  *      - signal_in     : Input signal
     29  *      - in_length     : Length of input signal in samples
     30  *
     31  * Input & Output:
     32  *      - filter_state  : Filter state for first all-pass filters
     33  *
     34  * Output:
     35  *      - signal_out    : Downsampled signal (of length len/2)
     36  */
     37 void WebRtcVad_Downsampling(WebRtc_Word16* signal_in,
     38                             WebRtc_Word16* signal_out,
     39                             WebRtc_Word32* filter_state,
     40                             int in_length);
     41 
     42 /****************************************************************************
     43  * WebRtcVad_FindMinimum(...)
     44  *
     45  * Find the five lowest values of x in 100 frames long window. Return a mean
     46  * value of these five values.
     47  *
     48  * Input:
     49  *      - feature_value : Feature value
     50  *      - channel       : Channel number
     51  *
     52  * Input & Output:
     53  *      - inst          : State information
     54  *
     55  * Output:
     56  *      return value    : Weighted minimum value for a moving window.
     57  */
     58 WebRtc_Word16 WebRtcVad_FindMinimum(VadInstT* inst, WebRtc_Word16 feature_value, int channel);
     59 
     60 #endif // WEBRTC_VAD_SP_H_
     61