Repository navigation
Conversation
…260-1) fractional_octave_frequencies computed the band edges from the nominal mid-band frequency, up to 0.95 % off the exact one, which put the 16 kHz octave filter outside the class 1 limits of IEC 61260-1 at its upper edge. The edges now follow Eq. 2, 4 and 5 of the standard, and the nominal frequency stays as the label. The nominal table read 0.6, 3. for 0.63. 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.
Summary
fractional_octave_frequenciescomputed the edges of each band from its nominal mid-band frequency (125 Hz, 16 kHz) where IEC 61260-1:2014 takes them from the exact one (125.89 Hz, 15 848.9 Hz). The filters ofOctFilterwere therefore centred up to 0.95 % away from where the standard places them, and the octave filter at 16 kHz fell outside the class 1 limits at its upper edge. This pull request takes the edges from the exact mid-band frequency and keeps the nominal one as the label of the band.What the standard asks
For filter sets with an odd denominator b, IEC 61260-1:2014 sets the exact mid-band frequency to f_m = f_r G^(x/b), with G = 10^(3/10) and f_r = 1000 Hz (Eq. 2). The band edges are f_1 = f_m G^(-1/(2b)) and f_2 = f_m G^(+1/(2b)) (Eq. 4 and 5), and the nominal frequencies of Annex E only label the bands (5.5).
What was found
The geometric centres of the edges were the nominal frequencies, with these offsets from the exact ones in octave bands:
Evaluated around the exact mid-band frequencies, the order 4 octave filters of
OctFiltermeet the class 1 limits of Table 1 in every band from 31.5 Hz to 8 kHz. At 16 kHz the relative attenuation just above the upper band edge was 0.97 dB, where Table 1 asks for at least 1.2 dB. The one-third octave filters meet the limits of Table F.1 in every band from 25 Hz to 20 kHz, before and after this change.The table of nominal frequencies also read
0.6, 3., 0.8where Annex E gives 0.63 and 0.8, which mislabelled the band of 0.63 Hz.The change
fractional_octave_frequenciesthe edges come from the exact mid-band frequencyrefFreq * base**(x * factor / nthOct), and the nominal frequency nearest to it stays in the middle column as the label.OctFilter,RoomAnalysisand the other users of the edges get the exact bands without further change.Unchanged
For an even denominator (1/6, 1/12, 1/24 octave) the standard places the mid-band frequencies at f_r G^((2x+1)/(2b)) (Eq. 3), so that 1000 Hz is an edge and not a centre, while PyTTa uses G^(x/b) for every denominator. Following Eq. 3 would change the numbering of the bands in
freq_to_bandand in everything that counts bands, which is a decision for the maintainers, so this pull request leaves it as it is.Tests
The tests in
tests/test_band_edges.pycheck the rule and the class 1 limits:The first two fail without this change. On a branch that merges all my open pull requests, the 309 tests pass with this change. 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