RavEngine
Loading...
Searching...
No Matches
estimating_rt60.h
1/*
2Copyright 2018 Google Inc. All Rights Reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS-IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17// Function to estimate RT60s.
18
19#ifndef RESONANCE_AUDIO_GEOMETRICAL_ACOUSTICS_ESTIMATING_RT60_H_
20#define RESONANCE_AUDIO_GEOMETRICAL_ACOUSTICS_ESTIMATING_RT60_H_
21
22#include <vector>
23
24namespace vraudio {
25
26// Estimates the RT60 value from collected energy impulse responses.
27//
28// @param energy_impulse_responses Energy impulse responses.
29// @param sampling_rate Sampling rate in Hz. Used to convert indices of the
30// impulse response vector to time in seconds.
31// @return Estimated RT60 value in seconds. Returns 0.0f (meaning no reverb
32// effect at all) when the estimation fails.
33float EstimateRT60(const std::vector<float>& energy_impulse_responses,
34 float sampling_rate);
35
36} // namespace vraudio
37
38#endif // RESONANCE_AUDIO_GEOMETRICAL_ACOUSTICS_ESTIMATING_RT60_H_