OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 ~AgcAudioProc(); | 30 ~AgcAudioProc(); |
31 | 31 |
32 int ExtractFeatures(const int16_t* audio_frame, | 32 int ExtractFeatures(const int16_t* audio_frame, |
33 int length, | 33 int length, |
34 AudioFeatures* audio_features); | 34 AudioFeatures* audio_features); |
35 | 35 |
36 static const int kDftSize = 512; | 36 static const int kDftSize = 512; |
37 | 37 |
38 private: | 38 private: |
39 void PitchAnalysis(double* pitch_gains, double* pitch_lags_hz, int length); | 39 void PitchAnalysis(double* pitch_gains, double* pitch_lags_hz, int length); |
40 void SubframeCorrelation(double* corr, int lenght_corr, int subframe_index); | 40 void SubframeCorrelation(double* corr, int length_corr, int subframe_index); |
41 void GetLpcPolynomials(double* lpc, int length_lpc); | 41 void GetLpcPolynomials(double* lpc, int length_lpc); |
42 void FindFirstSpectralPeaks(double* f_peak, int length_f_peak); | 42 void FindFirstSpectralPeaks(double* f_peak, int length_f_peak); |
43 void Rms(double* rms, int length_rms); | 43 void Rms(double* rms, int length_rms); |
44 void ResetBuffer(); | 44 void ResetBuffer(); |
45 | 45 |
46 // To compute spectral peak we perform LPC analysis to get spectral envelope. | 46 // To compute spectral peak we perform LPC analysis to get spectral envelope. |
47 // For every 30 ms we compute 3 spectral peak there for 3 LPC analysis. | 47 // For every 30 ms we compute 3 spectral peak there for 3 LPC analysis. |
48 // LPC is computed over 15 ms of windowed audio. For every 10 ms sub-frame | 48 // LPC is computed over 15 ms of windowed audio. For every 10 ms sub-frame |
49 // we need 5 ms of past signal to create the input of LPC analysis. | 49 // we need 5 ms of past signal to create the input of LPC analysis. |
50 static const int kNumPastSignalSamples = kSampleRateHz / 200; | 50 static const int kNumPastSignalSamples = kSampleRateHz / 200; |
(...skipping 23 matching lines...) Expand all Loading... |
74 double old_lag_; | 74 double old_lag_; |
75 | 75 |
76 rtc::scoped_ptr<PitchAnalysisStruct> pitch_analysis_handle_; | 76 rtc::scoped_ptr<PitchAnalysisStruct> pitch_analysis_handle_; |
77 rtc::scoped_ptr<PreFiltBankstr> pre_filter_handle_; | 77 rtc::scoped_ptr<PreFiltBankstr> pre_filter_handle_; |
78 rtc::scoped_ptr<PoleZeroFilter> high_pass_filter_; | 78 rtc::scoped_ptr<PoleZeroFilter> high_pass_filter_; |
79 }; | 79 }; |
80 | 80 |
81 } // namespace webrtc | 81 } // namespace webrtc |
82 | 82 |
83 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_AUDIO_PROC_H_ | 83 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AGC_AGC_AUDIO_PROC_H_ |
OLD | NEW |