Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(866)

Unified Diff: webrtc/modules/audio_processing/beamformer/array_util.h

Issue 1394103003: Make the nonlinear beamformer steerable (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@highfreq
Patch Set: Generalize interferer scenarios Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/beamformer/array_util.h
diff --git a/webrtc/modules/audio_processing/beamformer/array_util.h b/webrtc/modules/audio_processing/beamformer/array_util.h
index 2ac174ea8aa04800995551d03017c9d215415921..1291ba90968decdce534bbb9b3ab86a43882d2ff 100644
--- a/webrtc/modules/audio_processing/beamformer/array_util.h
+++ b/webrtc/modules/audio_processing/beamformer/array_util.h
@@ -16,7 +16,12 @@
namespace webrtc {
-// Coordinates in meters.
+// Coordinates in meters. The convention used is:
+// x: the horizontal dimension, with positive to the right from the camera's
+// perspective.
+// y: the depth dimension, with positive forward from the camera's
+// perspective.
+// z: the vertical dimension, with positive upwards.
template<typename T>
struct CartesianPoint {
CartesianPoint(T x, T y, T z) {
@@ -43,6 +48,11 @@ float Distance(CartesianPoint<T> a, CartesianPoint<T> b) {
(a.z() - b.z()) * (a.z() - b.z()));
}
+// The convention used:
+// azimuth: zero is to the right from the camera's perspective, with positive
+// angles in radians counter-clockwise.
+// elevation: zero is horizontal, with positive angles in radians upwards.
+// radius: distance from the camera in meters.
template <typename T>
struct SphericalPoint {
SphericalPoint(T azimuth, T elevation, T radius) {
@@ -58,6 +68,10 @@ struct SphericalPoint {
using SphericalPointf = SphericalPoint<float>;
+// Helper functions to transform degrees to radians and the inverse.
+float DegreesToRadians(float angle_degrees);
Andrew MacDonald 2015/10/21 03:27:43 Probably reasonable to make these templates.
aluebs-webrtc 2015/10/27 18:08:15 Done.
+float RadiansToDegrees(float angle_radians);
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_PROCESSING_BEAMFORMER_ARRAY_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698