blob: 2935f2591a832f87719c7a783808ada6809ca8f7 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_PROCESSING_NS_MAIN_SOURCE_DEFINES_H_
12#define MODULES_AUDIO_PROCESSING_NS_MAIN_SOURCE_DEFINES_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
Yves Gerey665174f2018-06-19 15:03:05 +020014#define BLOCKL_MAX 160 // max processing block length: 160
15#define ANAL_BLOCKL_MAX 256 // max analysis block length: 256
16#define HALF_ANAL_BLOCKL 129 // half max analysis block length + 1
17#define NUM_HIGH_BANDS_MAX 2 // max number of high bands: 2
niklase@google.com470e71d2011-07-07 08:21:25 +000018
Yves Gerey665174f2018-06-19 15:03:05 +020019#define QUANTILE (float)0.25
niklase@google.com470e71d2011-07-07 08:21:25 +000020
Yves Gerey665174f2018-06-19 15:03:05 +020021#define SIMULT 3
22#define END_STARTUP_LONG 200
23#define END_STARTUP_SHORT 50
24#define FACTOR (float)40.0
25#define WIDTH (float)0.01
niklase@google.com470e71d2011-07-07 08:21:25 +000026
niklase@google.com470e71d2011-07-07 08:21:25 +000027// Length of fft work arrays.
Yves Gerey665174f2018-06-19 15:03:05 +020028#define IP_LENGTH \
29 (ANAL_BLOCKL_MAX >> 1) // must be at least ceil(2 + sqrt(ANAL_BLOCKL_MAX/2))
niklase@google.com470e71d2011-07-07 08:21:25 +000030#define W_LENGTH (ANAL_BLOCKL_MAX >> 1)
31
Yves Gerey665174f2018-06-19 15:03:05 +020032// PARAMETERS FOR NEW METHOD
33#define DD_PR_SNR (float)0.98 // DD update of prior SNR
34#define LRT_TAVG (float)0.50 // tavg parameter for LRT (previously 0.90)
35#define SPECT_FL_TAVG \
36 (float)0.30 // tavg parameter for spectral flatness measure
37#define SPECT_DIFF_TAVG \
38 (float)0.30 // tavg parameter for spectral difference measure
39#define PRIOR_UPDATE (float)0.10 // update parameter of prior model
40#define NOISE_UPDATE (float)0.90 // update parameter for noise
41#define SPEECH_UPDATE (float)0.99 // update parameter when likely speech
42#define WIDTH_PR_MAP \
43 (float)4.0 // width parameter in sigmoid map for prior model
44#define LRT_FEATURE_THR (float)0.5 // default threshold for LRT feature
45#define SF_FEATURE_THR \
46 (float)0.5 // default threshold for Spectral Flatness feature
47#define SD_FEATURE_THR \
48 (float)0.5 // default threshold for Spectral Difference feature
Jonas Olssona4d87372019-07-05 19:08:33 +020049#define PROB_RANGE \
50 (float)0.20 // probability threshold for noise state in
Yves Gerey665174f2018-06-19 15:03:05 +020051 // speech/noise likelihood
52#define HIST_PAR_EST 1000 // histogram size for estimation of parameters
53#define GAMMA_PAUSE (float)0.05 // update for conservative noise estimate
niklase@google.com470e71d2011-07-07 08:21:25 +000054//
Yves Gerey665174f2018-06-19 15:03:05 +020055#define B_LIM (float)0.5 // threshold in final energy gain factor calculation
56#endif // MODULES_AUDIO_PROCESSING_NS_MAIN_SOURCE_DEFINES_H_