Coder Social home page Coder Social logo

pra_utils's People

Contributors

enceladus2000 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

pra_utils's Issues

Inconsistent results with ComplexRoom add_obstacle method.

add_obstacle() is supposed to add a small polyhedral reflecting object inside an existing parent room. Thus, the child object is supposed to contribute impulses accordingly, however, this does not work properly all the time.

The following is the code to reproduce this issue:

from pra_utils.core import *
import pyroomacoustics as pra
import matplotlib.pyplot as plt

room_abs = 0.9 # vary from 0.1 to 0.9

room_material = pra.Material(room_abs, None)
obstacle_material = pra.Material(0.1, None)

room = ComplexRoom.make_polygon(
		material=room_material,
		centre=[0,0,0], 
		radius=10/np.sqrt(2), 
		height=10, 
		N=4, 
		rpy=[0,0,np.pi/4],
		reverse_normals=False,
		max_order=2,
	)

obstacle = ComplexRoom.make_polygon(
		material=obstacle_material,
		centre=[0,0,0], 
		radius=1/np.sqrt(2), 
		height=1, 
		N=4, 
		rpy=[0,0,np.pi/4],
		reverse_normals=True,
	)

room.add_obstacle(obstacle)

x = 2.
source_pos = [x,0,0.]
mic_pos = [x,0, .1]
room.add_source(source_pos)
room.add_microphone(mic_pos)
room.compute_rir()

# plot room
room.plot(show_normals={'length': 0.4}, img_order=1)
plt.show()

# plot rir
N = len(room.rir[0][0])
dist = np.linspace(0, (N/room.fs)*343/2, N)
plt.plot(dist, room.rir[0][0])
plt.show()

When room_abs (the parent room's walls' absorption coefficient) is 0.1, we see the expected impulse from the object - the first large impulse corresponds to the direct path, while the ones after the 2nd spike are from the parent room's walls:

0_1 obstacle_marked

However, when we set room_abs to 0.9, we should expect the 2nd spike to be the same; instead we see it has disappeared all together:
0_9 obstacle

Why is this happening? This is especially problematic because we're trying to make the parent room's walls anechoic.

matplotlib deprecation warning

MatplotlibDeprecationWarning: Axes3D(fig) adding itself to the figure is deprecated since 3.4. Pass the keyword argument auto_add_to_figure=False and use fig.add_axes(ax) to suppress this warning. The default value of auto_add_to_figure will change to False in mpl3.5 and True values will no longer work in 3.6. This is consistent with other Axes classes. ax = a3.Axes3D(fig)

pip install fails on WSL2

Problem description:

When running pip install -e /path/to/pra_utils, pip seems to get stuck and fails to install the package.

Environment:

WSL2 Ubuntu 20.04
Python 3.8.10
VCXSRV gui client (for gui applications)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.