You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if name == "main":
parser = argparse.ArgumentParser(
description="Estimates the direction of arrival of a sound source."
)
parser.add_argument(
"--method",
"-m",
choices=methods,
default=methods[0],
help="DOA method to use",
)
args = parser.parse_args()
# we use a white noise signal for the source
nfft = 256
fs = 16000
x = np.random.randn((nfft // 2 + 1) * nfft)
# create anechoic room
room = pra.AnechoicRoom(fs=fs)
# place the source at a 90 degree angle and 5 meters distance from origin
azimuth_true = np.pi / 2
colatitude_true = 30/180*np.pi
room.add_source([5 * np.cos(azimuth_true)*np.sin(colatitude_true), 5 * np.sin(azimuth_true)*np.sin(colatitude_true), np.cos(colatitude_true)], signal=x)
# place the microphone array
mic_locs = np.c_[
[0.1, 0.1, 0],
[-0.1, 0.1, 0],
[-0.1, -0.1, 0],
[0.1, -0.1, 0],
]
room.add_microphone_array(mic_locs)
# run the simulation
room.simulate()
# create frequency-domain input for DOA algorithms
X = pra.transform.stft.analysis(
room.mic_array.signals.T, nfft, nfft // 2, win=np.hanning(nfft)
)
X = np.swapaxes(X, 2, 0)
# perform DOA estimation
doa = pra.doa.algorithms[args.method](mic_locs, fs, nfft, num_src=1, max_four=4, dim=3)
doa.locate_sources(X)
# for i in dir(doa):
# print(i)
# evaluate result
print("Source is estimated at:", doa.azimuth_recon/np.pi*180)
print(doa.colatitude_recon)
print("Real source is at:", azimuth_true/np.pi*180)
print("Error:", pra.doa.circ_dist(azimuth_true, doa.azimuth_recon))
The text was updated successfully, but these errors were encountered:
error info:
self.hull = sp.ConvexHull(self.cartesian.T)
File "_qhull.pyx", line 2431, in scipy.spatial._qhull.ConvexHull.init
File "_qhull.pyx", line 353, in scipy.spatial._qhull._Qhull.init
scipy.spatial._qhull.QhullError: QH6421 qhull internal error (qh_maxsimplex): qh.MAXwidth required for qh_maxsimplex. Used to estimate determinate
While executing: | qhull i Qt
Options selected for Qhull 2019.1.r 2019/06/21:
run-id 332354054 incidence Qtriangulate _pre-merge _zero-centrum
_max-width 0 Error-roundoff 0 _one-merge 0 _near-inside 0
Visible-distance 0 U-max-coplanar 0 Width-outside 0 _wide-facet 0
_maxoutside 0
A Qhull internal error has occurred. Please send the input and output to
qhull_bug@qhull.org. If you can duplicate the error with logging ('T4z'), please
include the log file.
python code:
import argparse
import numpy as np
import pyroomacoustics as pra
methods = ["MUSIC", "FRIDA", "WAVES", "TOPS", "CSSM", "SRP", "NormMUSIC"]
if name == "main":
parser = argparse.ArgumentParser(
description="Estimates the direction of arrival of a sound source."
)
parser.add_argument(
"--method",
"-m",
choices=methods,
default=methods[0],
help="DOA method to use",
)
args = parser.parse_args()
The text was updated successfully, but these errors were encountered: