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

ReverberationRoom class for ISO 354 #27

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

ahms5
Copy link
Member

@ahms5 ahms5 commented Dec 17, 2024

current draft Idea:
open questions:

  • how to tell the user about failing conditions?
    • text output
    • waring
    • error

=== current draft

class AbsorptionCalculator:
    def __init__(self, surface_area, volume, longest_dimension):

    def from_dimensions(dimensions):
    # caclualte from room dimensions based on a rectangualr room.

    def validate_dimensions(self):
        """
        Validates the room dimensions and volume against ISO 354 standards.


        - The volume of the room shall be greater than 150 m^3.
        - The volume of the room shall be less than 500 m^3.
        - The length of the longest straight line which fits within the
          boundary of the room shall be less than 1.9 times the cubic root of
          the volume of the room.
        """
        pass  # Implementation here

    def check_source_receiver_(self):
        """
        Checks if the boundary materials meet reflectivity requirements.
        Returns:
        - dict: Validation results including pass/fail and material suggestions.
        """
        pass  # Implementation here

    def check_diffuseness_emty_room(
            self, reverberation_time, speed_of_sound, attenuation_factor):
        """Check weather the conditions for the equivalent absorption area
        are fulfilled. required: maximum_equivalent_absorption_area
        """
    def validate_microphone_and_source_placement(self, microphone_positions, source_positions):
        """
        Validates the placement of microphones and sound sources.

        Parameters:
        - microphone_positions (list): List of (x, y, z) coordinates for microphones.
        - source_positions (list): List of (x, y, z) coordinates for sound sources.
        """
        pass  # Implementation here


    def maximum_equivalent_absorption_area(self):
        """Calculate the maximum equivalent absorption area according to ISO.
        A correction for the volume of the room is applied if the volume is not
        200 m^3.
        Returns
        -------
        equivalent_absorption_area : pf.FrequencyData
            The equivalent absorption area
        """
        equivalent_absorption_area = pf.FrequencyData(
            [
                100, 125, 160, 200, 250, 315, 400, 500, 630,
                800, 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000,
            ],
            [
                6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5, 6.5,
                6.5, 7.0, 7.5, 8.0, 9.5, 10.5, 12.0, 13.0, 14.0,
            ])
        if np.abs(self.volume - 200) > 5:
            equivalent_absorption_area = equivalent_absorption_area * (
                self.volume/200)**(2/3)

        return equivalent_absorption_area

    def calculate(self, reverberation_time, speed_of_sound, attenuation_factor, sample_area):
        """calcualte absorption coefficient. reverberation_time, speed_of_sound, attenuation_factor with sample""

@ahms5 ahms5 added the v0.1.0 label Dec 17, 2024
@ahms5 ahms5 requested a review from mberz January 7, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Open Discussion
Development

Successfully merging this pull request may close these issues.

1 participant