Repository navigation
Release v4.0.0
4.0.0 is the release where phonometry says what it is: a library of acoustics
in which every method is implemented from the text of its governing standard
and checked in CI against that standard's own tables and worked examples, with
a public API reorganised so that a name says what it is, in what unit, and
where it lives. It breaks on purpose and keeps no compatibility shims. Almost
every change fails at the import or at the call, and
Upgrading from 3.3 to 4.0
is the map, including the few places where the obvious fix is the wrong one;
each breaking item below points to its section there. Every rename returns
what its predecessor returned, and the numbers that did move are listed under
Changed and Fixed. phonometry 4.0.0 needs Python 3.12 or later (3.3.0 needed
3.13) and NumPy 2.0.2 or later.
The latest 4.x release is the supported one: 3.x and the 4.0.0rc1
pre-release get no further fixes. After 4.0.0, a name a release renames
keeps working, with a DeprecationWarning that names its replacement, until
the next major release.
Highlights
- One address per name. The root publishes the 21 domain packages and four
other names; everything else is imported from the package that owns it. - A name carries its unit, and a condition is written by name. Units sit
in the names (temperature_c,static_pressure_kpa,thickness_m,
duration_s), and every condition with a default and every flag is
keyword-only. - Answers are records and verdicts are objects. No tuple of different
quantities to unpack, and a verdict sayspassesand refuses to be a
bool. - A choice means one thing. Every fixed option is a
Literal, matched as
it is written, checked on every path and, in a record, when the record is
built; a type checker and the running code accept the same spellings. - Measurement audio is an input like any other.
io.readreturns a
calibratedSignalthat the filters, levels and estimators take as it is. - Simulations run on a GPU, on another machine and straight into a video,
and an elastic solver joins the acoustic one. - Many more standards, in building and room acoustics, sound power,
calibration, vibration, environmental noise, noise control and hearing. - Published catalogues of materials, read cell by cell from the books, and
catalogues of your own from JSON or a spreadsheet.
Breaking changes
Imports and packages
- Imports move down one level. The root exports the 21 subpackages,
Signal,ReportMetadata,PhonometryWarningand__version__: write
from phonometry import signals, thensignals.leq. See the one
rule. - Domains were regrouped.
phonometry.environmentalis
phonometry.environment;metrologysplit intofilters,signalsand
metrology; STI, STIPA, SII and STOI moved fromhearingto the new
phonometry.speech;sea_water_sound_speedandcharacteristic_impedance
moved tofluids, andunderwater.depth_to_pressureis
fluids.depth_to_gauge_pressure_mpa, with the same number. See one
address. - Module paths changed, and the old ones do not import. Most packages
regrouped or renamed their modules (building.measurement,
materials.absorbers,room.acoustics, ...); a 3.3.0 module path raises
ImportErrorand a pickle whose classes moved does not load. The module
moves do not change where a name is read from its package. See modules
that split. - A module is never hidden behind a function of its own name, and every
public module lists what it publishes; the constants and type aliases a
module kept for itself are private or published elsewhere (room.NC_*,
metrology.REFERENCE_VALUES). See modules and functions.
Names
- A parameter that names a quantity carries its unit.
temperature_c,
relative_humidity_percent,static_pressure_kpa,thickness_m,
distances_m,phase_rad,absorption_db_per_km,speed_kt, and
constants such asREFERENCE_AREA_M2. See units in names. - One spelling per concept.
speed_of_sound,frequencies,fs,
n_<plural>,min_andmax_,xfor a time signal,reference,
coverage,fraction=1or3,"free"and"diffuse",
weighting="Z", American English (center),in_situ, acronyms in
capitals (ANPDatabase), and a standard's designation written one way
(band_attenuation_arp5534,weighting_bs468). A duration ends in its
unit:materials.adrienne_windowtakesflat_duration_s=,
leading_duration_s=andtrailing_duration_s=,
StationarityTestResult.segment_duration_sand
PileStrikeResult.pulse_duration_sare in seconds, andhearing.Task
holdsduration_range_hoursandduration_observations_hours. See one
spelling. - A function is named for what it returns.
combine_uncertaintiesis
metrology.combined_standard_uncertainty,air_attenuation_mis
environment.air_power_attenuation_per_m, and
environmental.expanded_uncertaintyis
environment.environmental_expanded_uncertainty(withcoverage=). See
what it returns. - A level carries no unit suffix, and a name says the quantity it holds.
sensitivity_level_dbissensitivity_level,criterion_dbis
prominence_limit_db. See no suffix and the
quantity.
Where the obvious fix is the wrong one
- Two renames take another unit or fail late. The ISO 10534-2 air
helpers took kelvin and their successors take Celsius, and
underwater.transmission_lossispropagation_loss, whose result
(PropagationLossResult) has.plwhere.tlwas, so the old field fails
only where it is read; the normal-mode, parabolic-equation and sonar
results and the sonar equations'transmission_loss=follow it. The
ISO 17497-1materials.speed_of_soundis
materials.speed_of_sound_iso17497and returns the same number;
fluids.air()is another model, 343.99 m/s at 20 °C against 343.20 m/s,
so switch to it only on purpose. Read this section first. - The air is one
fluid=argument. The visco-thermal absorber models
(Johnson-Champoux-Allard, Delany-Bazley, Miki, slits, Helmholtz resonators,
perforated plates,layered_absorber),ground_effect,
barrier_insertion_loss,atmospheric_parabolic_equationand the building
panel functions take afluids.Fluidinstead ofspeed_of_sound=,
air_density=,viscosity=,prandtl_number=,heat_capacity_ratio=and
atmospheric_pressure=. The default,materials.ABSORBER_AIR, gives
3.3.0's numbers. See onefluid=.
Calls
- Conditions, flags and frequency axes are written by name. A
temperature, humidity, pressure, speed of sound, density, ground factor or
calibration factor with a default, every boolean flag, a frequency axis
beside its values and the fields of the records you build and pass in are
keyword-only. See written by name. - Signal-processing functions take their defining argument by name.
linkwitz_riley(..., *, frequency),parametric_eq(..., *, sections),
zoom_fft(..., *, f_min, f_max),lifter(..., *, cutoff),
time_synchronous_average(..., *, period_s)and
resample_signal(..., *, fs_new);fsmay be left out for aSignal.
See written by name. - The longest signatures take their options in records, so a 3.3.0
keyword is not renamed but gone:octave_filter(x, fs, calibration_factor=k)
raisesTypeError.octave_filterandOctaveFilterBanktake
design=FilterDesign(filter_type=, ripple=, attenuation=, resample=),
calibration=LevelCalibration(factor=, dbfs=),
response_plot=ResponsePlot(show=, file=)and, on the bank,
block_processing=BlockProcessing(stateful=, steady_ic=).
microphone_characteristicstakesMicrophoneDirectivity,
MicrophoneNoise,MicrophoneOverloadandMicrophoneElectrical, and a
noise weighting that was a free label is"A"or"468"(ITU-R BS.468-4):
"CCIR"or any other text raisesValueError.loudspeaker_characteristics
takesLoudspeakerDirectivityandLoudspeakerRatings,
sound_power_pressureits room asRoomEnvironment, and
predicted_receiver_levelPropagationGeometry,GroundFactors,
AtmosphericConditionsandDirectivityCorrection.aircraft.event_level
andnoise_contourtakeAerodromeAtmosphereandFlightSegmentState, and
the rotorcraft onesRotorcraftAtmosphere,RotorcraftGround,
RotorcraftTrackStateandFlightConditionInterpolation. See the option
records and the environment. - An FDTD run is one record, written by name.
fdtd_simulationtakes
oneFDTDRun(*, c, dx, duration_s, sources, ...), its probes and
snapshots inrecording=FDTDRecording(...)and its sides and absorbing
layer inboundaries=FDTDBoundaries(sides=, absorbing_layer_cells=), where
3.3.0 tookfdtd_simulation(c, dx, duration, *, sources, probes=, boundaries=, absorbing_layer_cells=, snapshot_every=).
FDTD2Dnames its absorbing layer as the runs do,absorbing_layer_cells=,
absorbing_sides=andabsorbing_layer_reflection=where it took
sponge_width=,sponge_sides=andsponge_reflection=, and
FDTD2D.run(n_steps, *, snapshot_every=, snapshot_decimation=)takes by
name whatrun(steps, record_every, decimate)took by position. See one
spelling. - The FDTD engines take every argument by name, as the runs do.
simulation.FDTD2D(*, c, dx, rho=1.2, ...)and
simulation.ElasticFDTD2D(*, c_p, c_s, dx, rho, ...):FDTD2D(343.0, 0.01, shape=(200, 300))is nowFDTD2D(c=343.0, dx=0.01, shape=(200, 300)), and a call that gives them by position raisesTypeError. A speed
and a spacing written in the wrong order built an engine:
FDTD2D(0.01, 343.0, shape=...)stepped cells 343 m wide with a time step
of about four hours.ElasticFDTD2D.from_regions(shape, dx, ...)keeps its
order, and refuses a shape and a spacing given the other way round with a
TypeErrornamingshape. See written by name. - Every
.plot()takes the axes first. See plots.
Results and verdicts
- The verifiers return records, not dictionaries.
verify_filter_class(bank).overall_class, and the same for
verify_weighting_classandverify_aircraft_noise_system, which moved to
aircraft. See verdicts are objects. - A verdict says
passes, refuses a truth value, and comes from a verb.
if verdict:raisesTypeError;rigid_mass_calibration_checkis
verify_rigid_mass_calibration. See passes. - A verdict reads its limit, its flags and its regime from what it holds,
so a result built by hand takes only the measured values. See
limits, flags and
regimes. - The filter bank returns a result.
octave_filterand
OctaveFilterBank.filterreturn anOctaveFilterResult, which holds its
band centres and band waveforms as tuples,
OctaveFilterBank.spectrogramanOctaveSpectrogramResult, and the bank's
freqandnum_bandsarefrequenciesandn_bands. See the filter
bank. - Other answers that were tuples are records.
nominal_frequencies,
coherence,decay_curve,sound_pressure_level_history,
background_corrected_level,epnl_from_pnltand others; none unpacks.
See records. - A multi-panel
.plot()returns a tuple of its axes. Withoutax, the
27 plots that draw several panels return a tuple of exactly their axes, the
top panel first, where they returned a NumPy array of them, so indexing,
unpacking andlen()work and.shape,.flatand.ravel()do not;
withaxthey draw one panel and return that axes. The polar plots return
aPolarAxes, andDiffuserPolarResponse.plot()refuses a cartesian axes
withValueError. See a tuple of axes. - A function of a number or an array returns a number for numbers and an
array for an array, a zero-dimensional one included. 352 public
functions and methods follow the rule and say so in their signatures.
room.room_constant(100.0, np.array(0.2))returnsarray(25.)where it
returned thefloat25.0, and a one-element list gives a one-element
array where the ISO 11200 corrections gave afloat. The other way,
functions that gave a zero-dimensional array, a NumPy scalar or a
one-element array for numbers (inbuilding,emission,vibration,
materials,aircraftand the induction loops ofelectroacoustics,
among others) give a Pythonfloatnow, or acomplexwhere the result
is complex, with the same bits;piston_resistance,piston_reactance
andpiston_directivitygive afloatwhere they gave anumpy.float64.
noise_control.duct_matrixandshunt_matrixgive the(2, 2)matrix
for one frequency, where they gave a(1, 2, 2)stack. See
zero-dimensional arrays. - A record's fields are required. See required fields.
- Results keep read-only copies of their arrays, and published tables refuse
writes. Copy before editing. See own copies and
read-only tables. - A record you build holds what its fields say. The records a caller
builds convert what they are given: a list becomes a read-only array of
the field's dtype, solevels * 2doubles it instead of repeating it, a
tuple field a tuple and a pair a pair of numbers, refused when built
(TypeErrorfor a number or a text,ValueErrorfor the wrong count)
instead of failing when read.materials.TransferMatrixholds each entry
as a read-onlycomplex128array, so a scalar entry is a
zero-dimensional array, no longer acomplexand no longer hashable
(complex(m.t11)gives the number), andhearing.Taskholds its samples
and its duration range as tuples of floats. A result that held adict
holds a read-only mapping, a spectral result holds the weights of its
window as a tuple, and a record that comes back frompickleor
copy.deepcopyholds its arrays read-only. See what its fields
say.
Choices
- A choice is matched as it is written. 198 parameters and record fields
folded the case, stripped the spaces or mapped aliases of their own before
they looked a choice up, sofilters.WeightingFilter(48000, "a"),
time_weighting(..., mode="FAST")andln_levels(..., weighting="z")ran
although a type checker refused them. Each takes only the spellings its
Literallists: another case, padding or an alias raisesValueError, and
a value that is not textTypeError. The ANP lookups no longer take
"approach","landing","takeoff","departures"and the other
aliases for an operation, andenvironment.detect_onsetsand
impulsive_sound_adjustmentno longer fit anyonset_rate_methodbut
"upper_half"as least squares. Text the library reads from a file is
still read as the file writes it. See matched as
written. - A record refuses an unknown choice when it is built, and every choice is
checked on every path. The records a caller builds, among them
filters.FilterDesign,noise_control.DesignCriterionandhearing.Task,
check their choices when they are built, where they stored any value and
failed later or not at all. A choice read on one path only
(environment.ground_effect(model=)without a flow resistivity,
signals.time_delay(weighting=)outside"gcc", thefan_type=of
noise_control.fan_sound_powerwith the VDI 2081 model, and the others
the guide lists) is refused whatever else is given, and each key of a
mapping and each item of a sequence is checked one by one. See a record
refuses a choice.
Errors and removed names
- A wrong type raises
TypeErrorinstead ofValueError, a text that
reads as a number and abytearrayread as the codes of its characters
included, and an array or a one-element list where one
number belongs is aTypeErrorthat names the parameter. A complex value
where a real one belongs, a NumPy complex scalar included, which the
checks read as its real part, is aTypeErrortoo, and so is a value that
is not text where a choice belongs. A choice beside numbers (the
terminationofmaterials.layered_absorberand
diffuse_field_absorption, theinitial_stateof
filters.time_weighting, thecoefficientsofmaterials.delany_bazley,
thespeech_spectrumofspeech.speech_intelligibility_indexand the
others the guide lists) refuses a text in any form but astr:
layered_absorber(termination=["400", "400"])closed the stack with an
impedance of 400 Pa s/m anddelany_bazley(coefficients=b"12345678")
took the codes of the characters, where both are aTypeErrornow. Code
that caughtValueErrorfor any bad input catches
(TypeError, ValueError). See errors. - A count is a whole number and a sample rate a
float. A fractional
count is aValueErrorand a flag aTypeError, where 3.3.0 truncated it
or readTrueas 1 (n_points=100.6drew 100 points,
OctaveFilterBank(order=2.5)androom.mls_signal(10.5)ran); a band
fraction that names octaves or thirds only, 1 or 3, as thefractionof
emission.sound_intensitydoes, refuses1.0with aTypeError. The
sample rates that run at any value are typedfloat, where a type checker
read anint. See rates and counts. - Every warning is shown at the line of your code that made the call, and
a filter by module no longer reaches it. 33 warnings reached by a second
route were shown at a line of the library, so the same call in a later
notebook cell said nothing; every warning now skips the package's own
frames, and the fourteen published warnings that were written in private
modules name the package that exports them. A filter written as
module="phonometry"reaches none of them: filter by
category=phonometry.PhonometryWarningor by topic. See the line of your
code. - Some names exist nowhere any more. Each has its replacement in the
names that are gone.
Added
Signals and files
phonometry.ioreads and writes measurement audio.io.readreturns a
Signal(samples, rate, calibration, channels, the EBU Tech 3285bext
record) from any linear WAV, RF64 or BW64, and FLAC, AIFF, Ogg and MP3 with
[audio];info,read_blocks,write,convertand a calibration
sidecar come with it.- A
Signalgoes wherever an array went. The filters, weightings, levels,
spectral, correlation, envelope and cepstrum estimators and the
psychoacoustic models read its rate and calibration, and a transform of a
pressure record returns aSignal. io.Signal.pipe(func, *args, **kwargs)writes a chain of steps in the
order it runs, as thepipeof pandas does:
sig.pick(0).pipe(filters.weighting_filter, weighting="A").crop(10.0, 30.0).pipe(signals.leq).
A type checker reads the arguments and the result fromfuncitself.- Any matplotlib animation writes to WebM, MP4 or GIF through ffmpeg, on a
GPU encoder when one works.io.write_videotakes the container from the
suffix and tries NVENC, Quick Sync, VAAPI and VideoToolbox first, each on
one black frame of the video's size, then the CPU; a GIF is written with a
palette of up to 256 colours.io.VideoOptionsholds the settings, its
vaapi_devicenaming the GPU VAAPI encodes on when it is not
/dev/dri/renderD128, the first one. The file appears only when ffmpeg has
finished it, and a write that fails says why, with the path and the
encoder (io.FFmpegNotFoundError,io.VideoEncoderError).
Filters and weightings
- Filter banks by IEC 61260-2:2016 and IEC 61260-3:2016.
filters.verify_time_invariance(the swept test) and
filters.verify_filter_periodic(periodic tests). - Weighting class against IEC 651:1979.
verify_weighting_class(..., edition="1979")grades A, B and C against Table V, Type 0 included. time_weightingof aSignalreturns aTimeWeightedEnvelope, with a
.plot()of the level trace.
Calibration and metrology
- Reciprocity calibration (IEC 61094-2:2009, IEC 61094-3:2016). Coupler and
free-field primary calibration of laboratory standard microphones. - Comparison calibration (IEC 61094-5:2016, IEC 61094-8:2012). Magnitude
and phase, impedance and jig corrections, the 6.5 diameter correction, jig
and coupler validation by 6.7, and the Annex B time window. - Sound level meters: free-field corrections on a calibrator, coupler or
actuator (IEC 62585:2012), the random-incidence response (IEC 61183:1994)
and the periodic tests of IEC 61672-3:2013, with a verdict. - Sound calibrators (IEC 60942:2017), graded by the IEC TC 29 conformance
rule ofmetrology.verify_conformance. - ISO 1683:2015 reference values as
metrology.REFERENCE_VALUES, read by
every level.
Simulation
- The FDTD engines step on an NVIDIA GPU through CuPy, or on PyTorch, and
every result records where it ran.simulation.Compute, passed as
compute=, set by awith simulation.use(...)block or by
PHONOMETRY_COMPUTE, runsFDTD2D,ElasticFDTD2Dand both simulation
functions on NumPy, CuPy or torch in float64 or float32, and.provenance
says where: the device, the dtype, the phonometry, NumPy and array library
versions. The NumPy path did not move. On CuPy in float64 the fields came
out bit-identical to NumPy's on an NVIDIA GeForce RTX 4060 with CuPy 14.2.0,
the energy within 1.79e-16; torch on a CPU stays within 9e-16 in float64 and
2e-06 in float32, and NumPy in float32 within 3e-06 of float64, over grids of
up to 64 by 48 cells, up to 120 steps. - A simulation runs on another machine over SSH.
Compute(host=...)or
PHONOMETRY_COMPUTE=cupy@nassends a whole run to a node named in
hosts.toml, as data and never as code, and returns the same result. - An FDTD run writes straight to a video, here or on a node.
simulation.write_fdtd_animationandwrite_elastic_fdtd_animationdraw
each frame as it is computed, 960 by 540 pixels by default and at least
479 by 245 pixels; a run whose last frame comes at ten seconds or later has
a wider floor, which its error names.simulation.AnimationFrameholds how
a frame is drawn, its colour limit refusing a flag, and ffmpeg and ssh are
found by one rule on every system. - An elastic P-SV solver.
ElasticFDTD2Dandelastic_fdtd_simulationon
the Virieux staggered grid, withMaterial(STEEL,ALUMINUM,
CONCRETE,WATER,AIR), explosive and force sources, fluid-solid
interfaces andscholte_speed. - Plane waves, impedance tubes and the far field.
FDTD2D.add_plane_wave
andPlaneWaveSource, per-cell damping maps, andfar_field_from_contour. fdtd_simulationcan keep every d-th cell of its snapshots
(FDTDRecording(snapshot_decimation=)), asFDTD2D.runcould, and
pip install "phonometry[torch]"installs the torch backend.
Fluids and solids
phonometry.fluids, the medium sound travels through.fluids.air()
computes humid air by IEC 61094-2:2009 Annex F;sea_water(),
sea_water_density(),ideal_gas(), the absolute pressure at a depth and
a Medwin sound-speed model join it.phonometry.solids. Beam, plate and bulk longitudinal speeds, their
inverses and the thickness-coincidence product.
Materials
- Biot poroelastic layers (Allard and Atalla) in
layered_absorber, and the
limp-frame model withcheck_limp_frame. - Metadiffusers (Jimenez, Cox, Romero-Garcia and Groby, 2017).
MetadiffuserWellandmetadiffuser_polar_response. - Suspended ceilings in a reverberation room (EN 16487:2014).
- Impedance tubes of any section in the ASTM E2611 branch, and a square
section in both branches. - Porous-material estimates from what a table prints: porosity and flow
resistivity from bulk density, characteristic lengths.
Published catalogues
- Catalogues of materials read from the books. Solids, fluids and gases,
porous materials, absorption, scattering and diffusion, transmission loss,
impact insulation, duct walls, resilient layers and ground surfaces, each
row naming its table and saying what its source claims for each cell. - Catalogues of your own.
io.read_cataloguereads JSON or a spreadsheet
saved as CSV into the same row classes, every*_namedlookup takes
catalogue=, andio.catalogue_schemareturns a JSON Schema for editors.
Building acoustics
- ISO 10140-1:2021 Annexes G, H, J and K. Linings, floor coverings, sealed
joints and rain noise in the laboratory, with the Figure H.4 and J.7 forms. - ISO 16032 (from the ISO/DIS 16032:2023 draft). Service-equipment noise in
buildings, with its on-site checks. - ISO 15186-3:2002, insulation by intensity down to 50 Hz, and the
ISO 16283 low-frequency procedure for rooms under 25 m³. - Heavy and soft impact sources (ISO 16283-2 Annex A, ISO 10140-5 Annex F,
JIS A 1418-2, ISO 717-2 Annex D). - The detailed ISO 12354-1/-2:2017 model, band by band and path by path,
with the EN 12354-5:2009 Annex D and F tables. - Prediction from material data: resilient layers, floating floors and
linings, ceiling plenum flanking (ISO 140-9, ASTM E1414, ASTM E413), wall
ties, orthotropic panels and the plateau method. - The Spanish building code CTE DB-HR: its A-weighted indices and
requirements.
Room acoustics
- ISO 3382-1 completed. Sound strength G, lateral energy (J_LF, L_J), IACC,
stage support, the reverberation-time uncertainty and the printed tables. - Workrooms: ISO 14257:2001 (spatial sound distribution) and
ISO 11690-3:1998 (choosing a prediction method). - Room modes and crowd noise (Long), and
steady_state_splwith an
absorption area, a per-band directivity or the reverberant field alone.
Sound power and emission
- ISO 3743-1 and ISO 3743-2 (small sources in a hard-walled or a special
reverberation room) and ISO 3747:2010 (in situ, against a reference
source). - ISO 26101:2017 room qualification and ISO 6926:2016 reference sources,
with ISO 3745 Annex A as amended in 2017. - ISO 8297 (a whole plant), IEC 61063 (a steam turbine), ISO 9295
(the 16 kHz octave) and ISO 5136 (a fan in its duct). - The sound energy level L_J of a burst (ISO 3744, ISO 3746, ISO 3741) and
the emission level at a work station (ISO 11201, ISO 11202, ISO 11204). - ISO 9614-1 at discrete points, its F1 indicator, the ISO 9614-3 fiche,
and the IEC 61043 grading of intensity probes. - ISO 3746 survey positions beside three reflecting planes, which raised
NotImplementedError.
Noise control
- Enclosures and cabins as built (ISO 11546-1/-2:1995, ISO 11957:1996).
- Silencers and screens: ISO 7235, ISO 11691 and ISO 5135 in the
laboratory, ISO 11820:1996 in situ, ISO 11821:1997 removable screens. - Control-valve noise: IEC 60534-8-3 (gas, with low-noise trims and
expanders) and IEC 60534-8-4 (liquid). - HVAC duct-borne noise from fan to room (Long, ASHRAE, AHRI 885), with
the VDI 2081 Parts 1 and 2 models beside the ASHRAE ones. - Room-to-room transmission, enclosure design and duct modes with flow
(Norton and Karczub), andSilencerChainfor a silencer built by hand.
Environmental noise
- Road noise barriers: EN 1793-1, -2 and -3 ratings, EN 1793-5:2016
reflection in situ, and the railway spectrum of EN 16272-3-1. - Railway rolling stock (ISO 3095:2013) on a track judged by EN 15610 and
EN 15461. - CNOSSOS-EU road and railway source emission (Directive 2002/49/EC
Annex II), checked against the Commission's workbooks. - Soundscape (ISO/TS 12913-2, ISO/TS 12913-3), road surfaces by
statistical pass-by (ISO 11819-1) and distant blasts (ISO 13474). - Wind turbines at a dwelling (IEC TS 61400-11-2:2024), with the
amplitude-modulation rating. - Outdoor sound software (ISO 17534-1, ISO/TR 17534-3) and barriers
measured in situ (ISO 10847:1997). - The Spanish noise regulation RD 1367/2007: corrected levels, limits and
the Article 25 assessment, with a fiche.
Aircraft
- ECAC Doc 29 Vol. 2 Appendix B flight profiles from a published ANP
procedure (approach_profile,departure_profile), and Appendix D NPD
curves for the airport's own air. - Rotorcraft hover and idle sources derived from the ground hover ring
(NORAH2 Table 3).
Vibration
- Vibration in buildings by the DIN family: DIN 45669-1/-2 (the meter and
its mounting), DIN 45672-1/-2 (railways), DIN 4150-1, -2 and -3, and the
E DIN 4150-2:2023 and E DIN 45672-3:2023 drafts. - Vibration meters (ISO 8041-1, ISO 8041-2), seats (ISO 10326-1:2016) and
building frequencies (ISO 4866 Annex D). - Machines: ISO 20816-1, ISO 20816-9 and ISO 10816-3 zones and limits, and
bearing, gear and blade fault frequencies. - Structures: mobility by impact hammer (ISO 7626-5:2019), the ISO 10846
band average, driving-point method and adequacy checks, and experimental
SEA.
Hearing and speech
- Audiometric test methods (ISO 8253-1, ISO 8253-2) and supra-aural
earphone reference levels (ISO 389-1). - Hearing protectors (ISO 4869-1, -2, -3 and -6): real-ear attenuation,
HML and SNR, earmuffs on a fixture, active noise reduction. - STI adjusted to other speech and noise levels (IEC 60268-16 Annex M),
and the critical-band, equally-contributing and octave-band SII procedures
of ANSI S3.5-1997. - The ERB_N bandwidth and the Cam scale (Glasberg and Moore 1990) in
psychoacoustics:erb_bandwidth,cam_from_frequencyand
frequency_from_cam. - The four decision criteria of ECMA-418-2 are published.
psychoacoustics.AUDIBILITY_THRESHOLD_SONE_HMS(0.01 sone_HMS, clause
5.1.9),PROMINENT_TONALITY_TU_HMS(0.4 tu_HMS, clause 6.3),
PROMINENT_ROUGHNESS_ASPER(0.2 asper, clause 7.2) and
PROMINENT_FLUCTUATION_STRENGTH_VACIL_HMS(0.2 vacil_HMS, clause 9.2),
each held to its printed page. No function applies them.
EcmaLoudness.basis_loudness_vs_timeholds the total basis loudness of
Formula 26 in sone_HMS that the audibility criterion reads, block by block
at thetimesofloudness_vs_time, and
EcmaLoudness.last_evaluated_blockthe last block that holds the signal
(l_end of Formula 40). The fluctuation criterion was
PROMINENT_FLUCTUATION_STRENGTH_VACILin 3.3.0; see modules and
functions.
Electroacoustics and broadcast
- Headphones and earphones (IEC 60268-7:2010) with the programme signal of
IEC 60268-1:1985. - Induction loops (IEC 60118-4, IEC 62489-1) and gain before feedback.
- The ITU-R BS.468-4 quasi-peak meter:
broadcast.quasi_peak_meterand
verify_quasi_peak_dynamics.
Underwater
- Gaussian beams, eigenrays and sloping bottoms, and
ray_tracereturns
travel times, arc lengths and bounce counts. - Weston's shallow-water regimes, marine-mammal weighting and exposure
criteria (Southall 2019, NMFS 2018 and 2024), and the detection
threshold, array gain and detection range of the sonar equation.
Results and figures
- Results read well in a notebook, as a table of their fields, and the
wheel runs in Pyodide. - Every domain draws its set-ups. 23
plot_*helpers draw a measurement
or model geometry (impedance tube, barrier, plate, double wall, silencer,
QRD and more), each withax=andlanguage=.
Changed
- A filter bank's class reads every requirement of its edition.
verify_filter_classgrades the effective bandwidth and summation of
IEC 61260-1:2014 (or 4.5.3 and 4.9 of IEC 61260:1995) beside the Table 1
mask, each band at the input rate. See the filter class. - The ISO 9053-2 thermal correction defaults to the air of IEC 61094-2, not
to the five values of Annex A.3; the printed Annex A.3 results stand. - A room under 25 m³ measured without the ISO 16283 low-frequency procedure
warns withbuilding.LowFrequencyWarning. - Silencer results carry their plane-wave limit
(ReactiveSilencerResult.plane_wave_limit) and warn with
noise_control.PlaneWaveWarningwhen the analysis runs past it, so a
3.3.0 call can warn now. - Every warning has a topic of its own, a
PhonometryWarningsubclass that
is still aUserWarning, so existing filters keep working. - Records refuse at construction a NaN, a per-band column of the wrong
length and a field of the wrong kind, instead of drawing it wrong later.
aircraft.RotorcraftGroundrefuses, when it is built, a flow resistivity
that is neither a class letter nor numbers (b"G",None, a complex
value), where it stored any of them as given and left it to the event that
read it. - The types say what a call takes and what it returns. pyright's
--verifytypesreads every public name as known, and every NumPy type the
package annotates names its dtype. Every fixed choice is aLiteral, a
collection of choices and a mapping keyed by one included, the published
tables are keyed by their vocabulary, andhelp()names the values each
choice takes; a parameter whose body converts its argument takes any
array-like, and one that takes numbers refuses a text; a count and a flag
take the NumPy scalar their check takes, and a mapping of band values
integer keys; a function of a number or an array, a filter object and a
plot of one panel or several are overloaded on what decides their return;
a record a caller builds declares the constructor a type checker reads; a
choice beside numbers refuses a text to a type checker as at run time; and
a misspelt root name is a type error. Nothing that ran stops running for
this, but a variable annotatedArrayLike, or amemoryview, handed where
numbers go is now a type error: annotate what it holds, or pass
np.asarray(view). See a text before the call runs. - Faster where it was slow.
import phonometryloads lazily (about 4 ms),
a minute of 44.1 kHz audio is weighted in about 18 ms instead of 377 ms, and
a large FDTD run no longer holds its snapshots twice. A weighting design
now costs a few hundred milliseconds the first time for each curve, rate
and mode in a process, where 3.3.0 took a few milliseconds; it is cached,
andhigh_accuracy=Falsestays instant. - Installs on Python 3.12, with floors measured in CI on each Python it
supports: on 3.12 NumPy 2.0.2, SciPy 1.14.0, numba 0.60.0 and torch 2.3.0,
on 3.13 and 3.14 the first releases with a wheel for them, and matplotlib
3.10.7, reportlab 4.3.0, svglib 0.9.1 and soundfile 0.12.0 everywhere. The
torch floor on Python 3.13, 2.5.0, has a wheel for Linux on x86-64 only;
macOS on ARM, Windows on x86-64 and Linux on ARM take torch 2.6.0, the
oldest release with a wheel there. - The conformance claim counts normative designations and further
sources. The README, the badge, the conformance report and the
documentation say that the checks run across 111 domains, against 230
normative designations and 121 further published sources, read from
docs/conformance.json, where they counted groups of citations as
standards. - The documentation lives at https://docs.jmrp.io/phonometry/, organised by
topic in English and Spanish, and every address the site published before
redirects to where the page is now. Thedocs/markdown mirror follows the
same topic layout, so its 3.3.0 file paths are gone, and thellms.txt
shards are served by the site under topic names. The errata register cites
each defect by edition, PDF page and printed folio. Every install line a
reader with 3.x may follow says to upgrade withpip install -U phonometry,
with the extras they use. A new Environments section says how
to install and run phonometry with pip and uv, conda, Jupyter,
JupyterLite and Pyodide, Docker and a type checker. The API reference
shows the tables its docstrings hold as tables,help()of every domain
opens with what it holds, and no docstring writes a hyphen or a double
hyphen as a dash. - The bundled EASA ANP tables carry EASA's terms and no condition of
ours, quoted inaircraft/data/anp/PROVENANCE.mdbeside the
acknowledgement, where they were said to be redistributed for
non-commercial use. The PyOctaveBand transition package moves to 2.2.1,
still pinned below phonometry 4, and declares and carries the MIT licence. - A weighting design gives the same bytes on every platform. It takes
its transcendentals, the BS.468-4 poles and the second-order sections from
the package's own arithmetic instead of the C library, LAPACK and the
BLAS, so macOS, Windows, Linux on ARM and musl design the Linux bytes. On
Linux six of the 133 designs CI checks move by their last bits (A and C at
44.1 and 88.2 kHz, D at 88.2 kHz, G at 1.5 kHz), the nineteen BS.468-4
designs by at most 0.0072 dB of response and the AU weighting at 100 and
200 Hz by up to two units in the last place;
electroacoustics.weighting_bs468moves by at most 4e-14 dB. A design
costs about 270 ms where it cost about 200. - A sample rate need not be a whole number.
vibration.evaluate_train_passage,signals.resample_signalhanded a
Signaland the EN 15610 Method B bank run at a fractional rate, where
they refused one, and the functions that hand their rate to a filter
(electroacoustics.weighted_thd,environment.sound_pressure_level_history,
broadcast.quasi_peak_meterand the others) hand it on as it is, where
they rounded it. - English text writes the decimal point, a value restated from a
standard that prints a comma included, and Spanish keeps the comma: the
warnings and messages that quote a number, the catalogue rows written in
English, thereferenceof IEC 61672-1 Table B.1 above 8 kHz and the
ISO 17534-1 quantile symbolsq_{0.1}andq_{0.9}change their text. No
value changes. - A missing extra names the conda command beside pip's, a domain offers
only what it publishes, and a record's table shows its units. Each
install hint ends with both commands;dir()and tab completion of each
of the 21 domains list its__all__alone; and a record's notebook table
shows the unit of every field that has one. - Since 4.0.0rc1.
vibration.blade_pass_frequenciesreturns a
BladePassResultthat holds the lobe patterns of a ducted fan apart from
its lines, as signed speeds of rotation, where rc1 listed them as lines at
those speeds; the ± 50 % of ISO 4866 D.2 is
vibration.EMPIRICAL_FREQUENCY_ERROR, notEMPIRICAL_FREQUENCY_TOLERANCE;
ElasticFDTD2D.from_regionstakes the engine's options by name;
noise_control.cascademultiplies matrices alone; a record that holds a
read-only mapping pickles and deep-copies, and every record comes back
frompickleorcopy.deepcopyholding its arrays read-only; and a
Signalor aSignalOriginpickled under rc1 no longer unpickles, since
their module isphonometry._internal.signal. See the lobe
patterns.
Removed
- The aliases deprecated in 3.1 and 3.2:
octavefilter,
getansifrequencies,normalizedfreq,calculate_sensitivity, the
ISO 12999-1coverage_factorandexpanded_uncertainty,ExposureWarning,
the keywordssample_rate,humidityandroom_volume, and the flat
module paths such asphonometry.levels. - Duplicate and superseded functions:
partial_exposure,
combine_uncertainties,satisfies_lower_requirement,
strong_coupling_satisfied,tonal_seeking_survey,
filter_class_complianceand the rest of the names that are
gone. BandUncertainty.to_arrays(), the public type aliases and the private
phonometry._plottingre-export;filters.complianceno longer answers
for the weighting transcriptions by their old private names, which
filters.weighting_complianceholds.
Fixed
- The default filter banks are class 1 of IEC 61260-1:2014. Alias images
sat 68.9 dB down in the octave bank and the decimated summation broke 5.16;
band levels move by up to 0.07 dB. - A and C weightings meet IEC 61672-1 class 1 at every rate from 8 kHz.
In 3.3.0 the default weighting lost up to 16 dB at the Table 3 rows within
a tenth of the Nyquist frequency: A and C at fs = 16 kHz met no class at
the 8 kHz row, and A at 32 kHz met class 2, whileverify_weighting_class
reported class 1, because it graded the designed sections and not the path
a signal takes. The filter is now designed at the input rate, AU verifies
too, and weighted levels move in the top octaves: at 48 kHz by about 0.1 dB
at 10 kHz, 0.4 dB at 16 kHz and 0.9 dB at 20 kHz.stateful=Trueran the
plain bilinear design in 3.3.0 and runs the accurate one now, so stateful
output changes, and a stateful G weighting reads 0 dB at its 10 Hz
reference. - The ITU-R BS.468-4 curve comes from the printed network, not from an
interpolated Table 1, which was 0.61 dB off near 11 kHz. - SAE ARP 5534 band attenuation uses the ARP's own saturation vapour
pressure, so ECAC Doc 29 Table D-3c reproduces to the last digit. - A value exactly on a printed limit is judged by its decimal value, the
same on every machine; NC and RC ratings round half to even. room.open_plan_metricsreturns NaN for a distraction or privacy
distance the STI never reaches, where 3.3.0 returned a distance of the
order of 1e16 m.- The ISO 3382 fiche takes the single-number reverberation time over 400 Hz
to 1250 Hz for a third-octave analysis, as Clause 9.1 prints. - ISO 3746 survey positions over one reflecting plane are those of
ISO 3746 Table B.1, whatevertonessays. - The ray solvers reflect exactly at a boundary, and
ray_tracetakes the
gradient of the segment a ray is entering. extended_tube_chambermodels the straight section over L - L_a - L_b,
reproducing Bies Figure 8.20.installed_dynamic_stiffnessno longer reads a missing gas term as zero
below 100 kPa·s/m².- A temperature at or below absolute zero is refused across the tree.
- The impulsive-sound analysis refuses a multichannel signal instead of
reading it as one channel twice as long. - The ISO 10846 fiche reads its headline at the lowest valid line.
- An ISO 9612 instrument that Table C.5 does not list raises
ValueError,
not aKeyErrorfrom a table lookup. - Plots accept matplotlib's short aliases and
label=, write the Spanish
decimal comma on every axis, keep their legend off a second scale, draw a
band with no reading as no bar, stay visible on a dark theme, and close
the figure they opened when they raise. - Fiches keep their size under any
savefigsetting, refuse a table that
does not fit one page, write the Spanish decimal comma in band columns, and
the IEC 61400-11 tonality fiche shows the spectrum under its critical band
on every svglib thereportextra admits. emission.grade_from_local_correctiongrades a method A.2 correction
by Condition (A.6) of ISO 11202:2010 when givenlargest_dimension_m=:
a correction above 3.34 dB, 2.82 dB or 2.41 dB, by the largest dimension
of the source, is grade 3, where it came out grade 2.- ISO 9295 keeps its digits where a reflection or an absorption rounds to
one.materials.standing_wave_normalized_impedancelost up to 4e-6 of
its result at large standing-wave ratios and gave inf + nan j past about
1e16, andemission.room_constant_from_reverberation_timelost every
digit once its exponent passed about 37. - A half-octave band is labelled with three significant digits, as
Annex E.2 of IEC 61260-1 asks: the bands at 595.7 Hz and 841.4 Hz read
596and841, not600and840, and a band finer than 1/36 octave
takes the digits that keep its labels apart. Centres, edges and levels do
not move. - A filter bank on its default span says nothing at 44.1 kHz. The span
is trimmed to the bands the rate holds, the ones the bank kept before;
limits the caller gives still warn and name the bands left out, and a
rate that holds no band at all raisesValueError. - A documented refusal comes before any warning, so under
python -W errora call raises its refusal and not the advisory before
it. - An FDTD run refuses by name what it cannot step: a run longer than
its record can hold, a time step that rounds to zero or to infinity, and a
time or a waveform sample that is not one real number. ADecimalor a
Fractionsteps as the float it reads as, and aContourProbebuilt
through its class samples. - A writer puts its file at the name only once it is whole.
io.write,
io.convert, every.report(), the response plot of a filter bank and
the video writers write beside the target and rename over it, keeping the
old file's permission bits, so a write stopped half way leaves the file
that was there..report()takes apathlib.Path, and a path object of
another library reaches the file it names. See once it is
whole. - Two threads importing two domains no longer deadlock, and with
[perf]every package imports where numba can write no cache. - Missing matplotlib, an overflowing record and a saturating tangent are
handled. Seventeen plots and fiches that raised a bare
ModuleNotFoundErrorgive the install hint;signals.envelope_spectrum
returns the same result past the floating-point range on every SciPy
without a NumPy warning; the tangents of the layered absorber, the slits,
the couplers, Maekawa's barrier and the Biot and capillary models
saturate quietly on Windows too; and a WAV reads from a file system that
cannot be memory-mapped, such as JupyterLite's.
Security
- A reader refuses a name that holds no regular file.
io.read,
io.info,io.read_blocks,io.convertand
aircraft.load_anp_databaserefuse a named pipe, a device, a socket or a
directory with aValueErrornaming the file, before they open it, where a
pipe no one wrote to kept the call waiting and a link to/dev/zerowas
read without end. The ANP reader reads a table of at most 32 MiB and
refuses a cell that holds no finite number, or a count that is no whole
number, with its table, line and column. A message that names a file
writes its control characters and its marks that reorder text as escapes.
See a reader refuses a name. - A remote run starts your own ssh, and nothing crosses as code. ssh runs
with no terminal and no agent, X11 or port forwarding, the run travels as
data and is checked again on the node, every byte the node sends is checked
before it is read, its text reaches you with its control characters and
marks that reorder text escaped, and a warning class the node names is
imported only from phonometry's own modules. ffmpeg and ssh run by their
full path, with every argument checked before they start. - Releases go out by trusted publishing, each file with a Sigstore
attestation, and the GitHub Release carries the checksum file
phonometry-<version>.sha256and a CycloneDX SBOM, every one of its four
files with build provenance. The release publishes only from a commit on
which Python CI succeeded and refuses a wheel or an sdist that does not
declare the MIT licence or carry its text.PyOctaveBandstays on the 3.x
line. - A release rebuilds from its tag to the same bytes on Linux and macOS
withscripts/build_release.py, which the release checks by building twice
and by rebuilding the tag on macOS after it publishes; the sdist of
4.0.0rc1 carried the build time and the builder's user, and its wheel the
builder's umask. SECURITY.mdsays what is supported, how to report a vulnerability in
private and how to verify and rebuild a release, and zizmor audits every
workflow in CI.
For contributors
- One written style guide.
docs/contributing/gives every rule an
identifier and names the check that enforces it;AGENTS.mdsends coding
agents there first. - Guards close classes of defect: em dashes and a spaced double hyphen,
breakable digit groups, units in parameter names, mutable published
tables, float equality and figure legibility, each ascripts/check_*.py
or a test that CI runs. - Ruff formats and lints, a bare
mypycheckssrc,scripts,
stub/src,tests/static_typingand the conformance scripts against the
oracle tables they read, and the development requirements are pinned. - CI tests the dependency floors, the GPU parity record, notebooks in
Pyodide and the MPS backend, builds the release twice on Linux and once
more on macOS on every pull request, and builds the site on every pull
request that touches it. - The documentation clips live in the phonometry-assets repository.
- The test suite runs from a source archive, skipping with a reason the
tests that ask git about the repository, and fails on a warning a test
did not ask for.
The same notes are in the changelog.