Repository navigation
Conversation
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
aguirreSL
added a commit
to aguirreSL/PyTTa
that referenced
this pull request
Nov 1, 2026
…by hand Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Nov 1, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
pytta.rays, stochastic ray tracing in convex rooms (Krokstad, Strøm and Sørsdal, "Calculating the acoustical room response by the use of a ray tracing technique", J. Sound Vib. 8(1), 1968; Vorländer, Auralization, 2008), as in the ray tracing part of RAVEN, which the ITA-Toolbox drives through its simulation application:shoebox(Lx, Ly, Lz, alpha, scattering=0)andconvex_room(vertices, alpha, scattering=0): a room as planes, each with its absorption and scattering coefficients; the second takes the planes from the convex hull of the corners.trace(room, source, receiver, numRays, duration, radius, dt, c, m, seed): rays leave the source in random directions with equal energy. At each wall they lose the absorbed share and are reflected specularly or, with the probability of the scattering coefficient, in a direction drawn from Lambert's law. Air absorbs them with the power attenuation m. A sphere around the receiver counts each crossing with the energy of the ray times the chord over the volume of the sphere, so the histogram is the energy per unit area in each time bin.The rays are traced together with NumPy, and 20000 rays over 1.2 s in a room of 120 m³ take under a second. Rooms that are not convex need a test of the polygon each ray hits, which is left for a later change. Rectangular rooms by image sources are in #101.
The tests in
tests/test_rays.pycompare with results of statistical room acoustics and print the measured values:Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of
development(3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com