| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 bf.interf_angles_radians_[0]); | 242 bf.interf_angles_radians_[0]); |
| 243 EXPECT_FLOAT_EQ(M_PI / 2.f + bf.away_radians_, | 243 EXPECT_FLOAT_EQ(M_PI / 2.f + bf.away_radians_, |
| 244 bf.interf_angles_radians_[1]); | 244 bf.interf_angles_radians_[1]); |
| 245 bf.AimAt(AzimuthToSphericalPoint(bf.away_radians_ / 2.f)); | 245 bf.AimAt(AzimuthToSphericalPoint(bf.away_radians_ / 2.f)); |
| 246 EXPECT_EQ(2u, bf.interf_angles_radians_.size()); | 246 EXPECT_EQ(2u, bf.interf_angles_radians_.size()); |
| 247 EXPECT_FLOAT_EQ(-bf.away_radians_ / 2.f, bf.interf_angles_radians_[0]); | 247 EXPECT_FLOAT_EQ(-bf.away_radians_ / 2.f, bf.interf_angles_radians_[0]); |
| 248 EXPECT_FLOAT_EQ(3.f * bf.away_radians_ / 2.f, bf.interf_angles_radians_[1]); | 248 EXPECT_FLOAT_EQ(3.f * bf.away_radians_ / 2.f, bf.interf_angles_radians_[1]); |
| 249 } | 249 } |
| 250 } | 250 } |
| 251 | 251 |
| 252 // TODO(peah): Reenable all bitexactness tests once the division-by-zero issue | |
| 253 // has been resolved. | |
| 254 | |
| 255 // TODO(peah): Investigate why the nonlinear_beamformer.cc causes a DCHECK in | 252 // TODO(peah): Investigate why the nonlinear_beamformer.cc causes a DCHECK in |
| 256 // this setup. | 253 // this setup. |
| 257 TEST(BeamformerBitExactnessTest, | 254 TEST(BeamformerBitExactnessTest, |
| 258 DISABLED_Stereo8kHz_ArrayGeometry1_TargetDirection1) { | 255 DISABLED_Stereo8kHz_ArrayGeometry1_TargetDirection1) { |
| 259 const float kOutputReference[] = {0.001318f, -0.001091f, 0.000990f, | 256 const float kOutputReference[] = {0.001318f, -0.001091f, 0.000990f, |
| 260 0.001318f, -0.001091f, 0.000990f}; | 257 0.001318f, -0.001091f, 0.000990f}; |
| 261 | 258 |
| 262 RunBitExactnessTest(AudioProcessing::kSampleRate8kHz, CreateArrayGeometry(1), | 259 RunBitExactnessTest(AudioProcessing::kSampleRate8kHz, CreateArrayGeometry(1), |
| 263 TargetDirection1, kOutputReference); | 260 TargetDirection1, kOutputReference); |
| 264 } | 261 } |
| 265 | 262 |
| 266 TEST(BeamformerBitExactnessTest, | 263 TEST(BeamformerBitExactnessTest, |
| 267 DISABLED_Stereo16kHz_ArrayGeometry1_TargetDirection1) { | 264 Stereo16kHz_ArrayGeometry1_TargetDirection1) { |
| 268 const float kOutputReference[] = {0.000064f, 0.000211f, 0.000075f, | 265 const float kOutputReference[] = {0.000064f, 0.000211f, 0.000075f, |
| 269 0.000064f, 0.000211f, 0.000075f}; | 266 0.000064f, 0.000211f, 0.000075f}; |
| 270 | 267 |
| 271 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(1), | 268 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(1), |
| 272 TargetDirection1, kOutputReference); | 269 TargetDirection1, kOutputReference); |
| 273 } | 270 } |
| 274 | 271 |
| 275 TEST(BeamformerBitExactnessTest, | 272 TEST(BeamformerBitExactnessTest, |
| 276 DISABLED_Stereo32kHz_ArrayGeometry1_TargetDirection1) { | 273 Stereo32kHz_ArrayGeometry1_TargetDirection1) { |
| 277 const float kOutputReference[] = {0.000183f, 0.000183f, 0.000183f, | 274 const float kOutputReference[] = {0.000183f, 0.000183f, 0.000183f, |
| 278 0.000183f, 0.000183f, 0.000183f}; | 275 0.000183f, 0.000183f, 0.000183f}; |
| 279 | 276 |
| 280 RunBitExactnessTest(AudioProcessing::kSampleRate32kHz, CreateArrayGeometry(1), | 277 RunBitExactnessTest(AudioProcessing::kSampleRate32kHz, CreateArrayGeometry(1), |
| 281 TargetDirection1, kOutputReference); | 278 TargetDirection1, kOutputReference); |
| 282 } | 279 } |
| 283 | 280 |
| 284 TEST(BeamformerBitExactnessTest, | 281 TEST(BeamformerBitExactnessTest, |
| 285 DISABLED_Stereo48kHz_ArrayGeometry1_TargetDirection1) { | 282 Stereo48kHz_ArrayGeometry1_TargetDirection1) { |
| 286 const float kOutputReference[] = {0.000155f, 0.000152f, 0.000159f, | 283 const float kOutputReference[] = {0.000155f, 0.000152f, 0.000159f, |
| 287 0.000155f, 0.000152f, 0.000159f}; | 284 0.000155f, 0.000152f, 0.000159f}; |
| 288 | 285 |
| 289 RunBitExactnessTest(AudioProcessing::kSampleRate48kHz, CreateArrayGeometry(1), | 286 RunBitExactnessTest(AudioProcessing::kSampleRate48kHz, CreateArrayGeometry(1), |
| 290 TargetDirection1, kOutputReference); | 287 TargetDirection1, kOutputReference); |
| 291 } | 288 } |
| 292 | 289 |
| 293 // TODO(peah): Investigate why the nonlinear_beamformer.cc causes a DCHECK in | 290 // TODO(peah): Investigate why the nonlinear_beamformer.cc causes a DCHECK in |
| 294 // this setup. | 291 // this setup. |
| 295 TEST(BeamformerBitExactnessTest, | 292 TEST(BeamformerBitExactnessTest, |
| 296 DISABLED_Stereo8kHz_ArrayGeometry1_TargetDirection2) { | 293 DISABLED_Stereo8kHz_ArrayGeometry1_TargetDirection2) { |
| 297 const float kOutputReference[] = {0.001144f, -0.001026f, 0.001074f, | 294 const float kOutputReference[] = {0.001144f, -0.001026f, 0.001074f, |
| 298 -0.016205f, -0.007324f, -0.015656f}; | 295 -0.016205f, -0.007324f, -0.015656f}; |
| 299 | 296 |
| 300 RunBitExactnessTest(AudioProcessing::kSampleRate8kHz, CreateArrayGeometry(1), | 297 RunBitExactnessTest(AudioProcessing::kSampleRate8kHz, CreateArrayGeometry(1), |
| 301 TargetDirection2, kOutputReference); | 298 TargetDirection2, kOutputReference); |
| 302 } | 299 } |
| 303 | 300 |
| 304 TEST(BeamformerBitExactnessTest, | 301 TEST(BeamformerBitExactnessTest, |
| 305 DISABLED_Stereo16kHz_ArrayGeometry1_TargetDirection2) { | 302 Stereo16kHz_ArrayGeometry1_TargetDirection2) { |
| 306 const float kOutputReference[] = {0.001144f, -0.001026f, 0.001074f, | 303 const float kOutputReference[] = {0.001144f, -0.001026f, 0.001074f, |
| 307 0.001144f, -0.001026f, 0.001074f}; | 304 0.001144f, -0.001026f, 0.001074f}; |
| 308 | 305 |
| 309 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(1), | 306 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(1), |
| 310 TargetDirection2, kOutputReference); | 307 TargetDirection2, kOutputReference); |
| 311 } | 308 } |
| 312 | 309 |
| 313 TEST(BeamformerBitExactnessTest, | 310 TEST(BeamformerBitExactnessTest, |
| 314 DISABLED_Stereo32kHz_ArrayGeometry1_TargetDirection2) { | 311 Stereo32kHz_ArrayGeometry1_TargetDirection2) { |
| 315 const float kOutputReference[] = {0.000732f, -0.000397f, 0.000610f, | 312 const float kOutputReference[] = {0.000732f, -0.000397f, 0.000610f, |
| 316 0.000732f, -0.000397f, 0.000610f}; | 313 0.000732f, -0.000397f, 0.000610f}; |
| 317 | 314 |
| 318 RunBitExactnessTest(AudioProcessing::kSampleRate32kHz, CreateArrayGeometry(1), | 315 RunBitExactnessTest(AudioProcessing::kSampleRate32kHz, CreateArrayGeometry(1), |
| 319 TargetDirection2, kOutputReference); | 316 TargetDirection2, kOutputReference); |
| 320 } | 317 } |
| 321 | 318 |
| 322 TEST(BeamformerBitExactnessTest, | 319 TEST(BeamformerBitExactnessTest, |
| 323 DISABLED_Stereo48kHz_ArrayGeometry1_TargetDirection2) { | 320 Stereo48kHz_ArrayGeometry1_TargetDirection2) { |
| 324 const float kOutputReference[] = {0.000106f, -0.000464f, 0.000188f, | 321 const float kOutputReference[] = {0.000106f, -0.000464f, 0.000188f, |
| 325 0.000106f, -0.000464f, 0.000188f}; | 322 0.000106f, -0.000464f, 0.000188f}; |
| 326 | 323 |
| 327 RunBitExactnessTest(AudioProcessing::kSampleRate48kHz, CreateArrayGeometry(1), | 324 RunBitExactnessTest(AudioProcessing::kSampleRate48kHz, CreateArrayGeometry(1), |
| 328 TargetDirection2, kOutputReference); | 325 TargetDirection2, kOutputReference); |
| 329 } | 326 } |
| 330 | 327 |
| 331 TEST(BeamformerBitExactnessTest, | 328 TEST(BeamformerBitExactnessTest, |
| 332 DISABLED_Stereo8kHz_ArrayGeometry2_TargetDirection2) { | 329 Stereo8kHz_ArrayGeometry2_TargetDirection2) { |
| 333 const float kOutputReference[] = {-0.000649f, 0.000576f, -0.000148f, | 330 const float kOutputReference[] = {-0.000649f, 0.000576f, -0.000148f, |
| 334 -0.000649f, 0.000576f, -0.000148f}; | 331 -0.000649f, 0.000576f, -0.000148f}; |
| 335 | 332 |
| 336 RunBitExactnessTest(AudioProcessing::kSampleRate8kHz, CreateArrayGeometry(2), | 333 RunBitExactnessTest(AudioProcessing::kSampleRate8kHz, CreateArrayGeometry(2), |
| 337 TargetDirection2, kOutputReference); | 334 TargetDirection2, kOutputReference); |
| 338 } | 335 } |
| 339 | 336 |
| 340 TEST(BeamformerBitExactnessTest, | 337 TEST(BeamformerBitExactnessTest, |
| 341 DISABLED_Stereo16kHz_ArrayGeometry2_TargetDirection2) { | 338 Stereo16kHz_ArrayGeometry2_TargetDirection2) { |
| 342 const float kOutputReference[] = {0.000808f, -0.000695f, 0.000739f, | 339 const float kOutputReference[] = {0.000808f, -0.000695f, 0.000739f, |
| 343 0.000808f, -0.000695f, 0.000739f}; | 340 0.000808f, -0.000695f, 0.000739f}; |
| 344 | 341 |
| 345 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(2), | 342 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(2), |
| 346 TargetDirection2, kOutputReference); | 343 TargetDirection2, kOutputReference); |
| 347 } | 344 } |
| 348 | 345 |
| 349 TEST(BeamformerBitExactnessTest, | 346 TEST(BeamformerBitExactnessTest, |
| 350 DISABLED_Stereo32kHz_ArrayGeometry2_TargetDirection2) { | 347 Stereo32kHz_ArrayGeometry2_TargetDirection2) { |
| 351 const float kOutputReference[] = {0.000580f, -0.000183f, 0.000458f, | 348 const float kOutputReference[] = {0.000580f, -0.000183f, 0.000458f, |
| 352 0.000580f, -0.000183f, 0.000458f}; | 349 0.000580f, -0.000183f, 0.000458f}; |
| 353 | 350 |
| 354 RunBitExactnessTest(AudioProcessing::kSampleRate32kHz, CreateArrayGeometry(2), | 351 RunBitExactnessTest(AudioProcessing::kSampleRate32kHz, CreateArrayGeometry(2), |
| 355 TargetDirection2, kOutputReference); | 352 TargetDirection2, kOutputReference); |
| 356 } | 353 } |
| 357 | 354 |
| 358 TEST(BeamformerBitExactnessTest, | 355 TEST(BeamformerBitExactnessTest, |
| 359 DISABLED_Stereo48kHz_ArrayGeometry2_TargetDirection2) { | 356 Stereo48kHz_ArrayGeometry2_TargetDirection2) { |
| 360 const float kOutputReference[] = {0.000075f, -0.000288f, 0.000156f, | 357 const float kOutputReference[] = {0.000075f, -0.000288f, 0.000156f, |
| 361 0.000075f, -0.000288f, 0.000156f}; | 358 0.000075f, -0.000288f, 0.000156f}; |
| 362 | 359 |
| 363 RunBitExactnessTest(AudioProcessing::kSampleRate48kHz, CreateArrayGeometry(2), | 360 RunBitExactnessTest(AudioProcessing::kSampleRate48kHz, CreateArrayGeometry(2), |
| 364 TargetDirection2, kOutputReference); | 361 TargetDirection2, kOutputReference); |
| 365 } | 362 } |
| 366 | 363 |
| 367 // TODO(peah): Investigate why the nonlinear_beamformer.cc causes a DCHECK in | 364 // TODO(peah): Investigate why the nonlinear_beamformer.cc causes a DCHECK in |
| 368 // this setup. | 365 // this setup. |
| 369 TEST(BeamformerBitExactnessTest, | 366 TEST(BeamformerBitExactnessTest, |
| 370 DISABLED_Stereo16kHz_ArrayGeometry3_TargetDirection1) { | 367 DISABLED_Stereo16kHz_ArrayGeometry3_TargetDirection1) { |
| 371 const float kOutputReference[] = {-0.000161f, 0.000171f, -0.000096f, | 368 const float kOutputReference[] = {-0.000161f, 0.000171f, -0.000096f, |
| 372 0.001007f, 0.000427f, 0.000977f}; | 369 0.001007f, 0.000427f, 0.000977f}; |
| 373 | 370 |
| 374 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(3), | 371 RunBitExactnessTest(AudioProcessing::kSampleRate16kHz, CreateArrayGeometry(3), |
| 375 TargetDirection1, kOutputReference); | 372 TargetDirection1, kOutputReference); |
| 376 } | 373 } |
| 377 | 374 |
| 378 } // namespace webrtc | 375 } // namespace webrtc |
| OLD | NEW |