Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reverberation time with low degrees of absorption #280

Open
Atriplex82 opened this issue Oct 28, 2022 · 2 comments
Open

reverberation time with low degrees of absorption #280

Atriplex82 opened this issue Oct 28, 2022 · 2 comments

Comments

@Atriplex82
Copy link

Hello,
while trying to simulate a room, I noticed the measured reverberation time differs from the one calculated with Sabine. When setting the coeffs of the walls to 0.5 the reverberation time seems plausible. Why is that?

Here's the code:

import numpy as np
from scipy.io import wavfile
import IPython
import pyroomacoustics as pra

# Define the materials array
ceiling_mat = {
    "coeffs": [0.45, 0.50, 0.5, 0.4, 0.35, 0.35],
    "center_freqs": [125, 250, 500, 1000, 2000, 4000],
}
floor_mat = {
    "coeffs": [0.16, 0.24, 0.56, 0.69, 0.81 , 0.78 ],
    "center_freqs": [125, 250, 500, 1000, 2000, 4000],
}
wall_mat = {
    "coeffs": [0.02, 0.02, 0.03, 0.03, 0.04, 0.06],
    #"coeffs": [0.5, 0.5, 0.5, 0.5, 0.5, 0.5],
    "center_freqs": [125, 250, 500, 1000, 2000, 4000],
}


height = 3.75

corners = np.array([[0,0], [0,8], [7,8], [7,0],]).T  # [x,y]

mat = pra.make_materials(*[(wall_mat,) for i in range(corners.shape[1])])

room = pra.Room.from_corners(
    corners,
    materials=mat,
    max_order=-1,
    ray_tracing=True,
    air_absorption=True,)

me = pra.make_materials(floor=floor_mat, ceiling=ceiling_mat)
room.extrude(height, materials=me)

# Set the ray tracing parameters
room.set_ray_tracing(time_thres=10,)

# specify signal source
fs, signal = wavfile.read("german_speech_8000.wav")

# add source and set the signal to WAV file content
room.add_source([1., 1., 0.5], signal=signal)

# add microphone 
room.add_microphone([6.0, 6.0, 0.5])

room.simulate()

rt60_tgt = room.rt60_theory()
room_dim = [8, 7, 3.75]
e_absorption, max_order = pra.inverse_sabine(rt60_tgt, room_dim)
print("absorption_mean:",np.mean([ceiling_mat["coeffs"],floor_mat["coeffs"],wall_mat["coeffs"]]))
print("absorption_theory:",e_absorption)
print("max_order_ism:",max_order)
print("RT60_theory:",rt60_tgt)
print("RT60_measure:",room.measure_rt60()[0, 0] )

,thanks

@fakufaku
Copy link
Collaborator

fakufaku commented Dec 7, 2022

Hi @Atriplex82 , sorry for the late reply! Yes, I have also noticed discrepancy between Sabine's formula and measured RT60. I think this may come from deviation between the hypothesis used to derive Sabine's formula and actual simulation.

@Atriplex82
Copy link
Author

Could it be that, it's beacause Sabine's formula needs a diffuse sound field? By setting medium sized scattering coefficients (I hope I did that correctly) the reverberation time decreases significantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants