Repository navigation
Conversation
Two-microphone transfer function method of ISO 10534-2: transfer function from the two microphone positions, reflection factor (Equation 17, with the calibration factor of 7.5.2), absorption coefficient, specific impedance ratio, speed of sound from temperature and the working frequency range of a circular tube. Tests synthesize H12 with Equation (D.7) for a rigid, an anechoic and a complex termination and recover r exactly. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 the module
pytta.iso10534for impedance tube measurements by the two-microphone transfer function method of ISO 10534-2:1998, asita_kundt_*in the ITA-Toolbox:transfer_function(mic1, mic2): H12 = P2 / P1 from the recordings or impulse responses at the two microphone positions (microphone 1 further from the sample).reflection_factor(H12, f, x1, s, c0, calibration=None): Equation (17), r = (H12 - HI) / (HR - H12) exp(2 j k x1), with HI and HR of Annex D, and an optional calibration factor Hc (7.5.2) that divides H12.absorption(r)andimpedance_ratio(r): Equations (18) and (19).speed_of_sound(temperature): Equation (5).frequency_range(d, s, c0): the working range of a circular tube from Equations (2) and (4) and the 5 % spacing rule.The standard uses an exp(+j w t) time convention, the same as
numpy.fft, so H12 from the FFT of the two signals enters the equations as it is.The tests in
tests/test_iso10534.pysynthesize H12 with Equation (D.7) for a rigid termination (r = 1), an anechoic one (r = 0) and a complex r with a phase that varies with frequency, and recover r, alpha and Z exactly. They also check the transfer function of two delayed impulses, the speed of sound at 293 K and the frequency range of a 100 mm tube.The switching technique of 7.5.1 is not included as a function; its corrected H12 can be passed to
reflection_factor.Checked with Python 3.12, numpy 1.26 and scipy 1.17. The existing tests behave as on
development: the 7 failures there (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