\documentclass{article}
\usepackage[margin=25mm]{geometry}
\usepackage{acousticintervals}
\usepackage[colorlinks=true,urlcolor=blue]{hyperref}
\title{acousticintervals: duration-weighted acoustic reports}
\author{Horn Guns}
\date{Version 0.1 -- 12 November 2026}
\begin{document}
\maketitle
\section{Purpose}
This small package produces auditable tables and duration-weighted energy means of consecutive equivalent-continuous sound-level intervals. It is not a sound-level meter, an exposure assessment, or evidence of hearing safety or legal compliance. All examples below are invented arithmetic tests, not measurements of any product.
\section{Installation and interface}
Place acousticintervals.sty alongside your document, or install it in your local TeX tree. Requires LaTeX dated 2022-06-01 or later and booktabs. No shell escape, external programs, data connections or special fonts are required.
\begin{verbatim}
\usepackage{acousticintervals}
\AcousticIntervalReport{LAeq}{60/60,60/70}
\AcousticIntervalMean{60/60,60/70}
\end{verbatim}
Each pair is duration in seconds / interval equivalent level in dB. Separate pairs with commas. Decimal literals are accepted; exponential notation, expressions, missing fields and non-numbers are rejected. Duration must be greater than zero and at most 1,000,000,000 seconds; levels must be between -100 and 250 dB. These are input guards, not physical or safety limits. Output is rounded to four decimal places, not a claim of measurement precision.
\section{Method and limitations}
For intervals with durations $t_i$ and equivalent levels $L_i$,
\[L=10\log_{10}\left(\frac{\sum_i t_i10^{L_i/10}}{\sum_i t_i}\right).\]
Use consecutive, non-overlapping intervals at the same microphone position, weighting and meter setup. Do not combine peak levels, Lmax, mixed weightings or repeated alternative trials. Report accepts exactly LAeq, LCeq or LZeq; this common label is an assertion by the caller, not a verification of the instrument. Mean assumes one consistent basis. Invalid data suppress the entire result rather than silently averaging only valid rows. An empty list is invalid. Keep meter identity, calibration, position, environment and coverage notes separately. The package cannot detect clipping, bad calibration or missing time. Use existing suitable measurements; do not create loud sound to populate a report.
\clearpage
\section{Synthetic worked example}
\AcousticIntervalReport{LAeq}{60/60,60/70}
\section{Regression examples}
Expected values are independently derived from the formula above. Every input here is invented.
\begin{description}
\item[Equal durations:] Expected 67.4036; actual \AcousticIntervalMean{60/60,60/70}.
\item[Unequal durations:] Expected 68.8930; actual \AcousticIntervalMean{60/60,180/70}.
\item[Equal levels:] Expected 60; actual \AcousticIntervalMean{30/60,90/60}.
\item[Zero dB:] Expected 0; actual \AcousticIntervalMean{60/0}.
\item[Negative dB:] Expected -20; actual \AcousticIntervalMean{60/-20}.
\item[Zero duration:] Expected invalid; actual \AcousticIntervalMean{0/60}.
\item[Negative duration:] Expected invalid; actual \AcousticIntervalMean{-2/60}.
\item[Malformed input:] Expected invalid; actual \AcousticIntervalMean{60/x}.
\item[Empty list:] Expected invalid; actual \AcousticIntervalMean{}.
\item[Partial invalid list:] Expected invalid; actual \AcousticIntervalMean{60/60,0/70}.
\end{description}
Unsupported basis, expected invalid: \AcousticIntervalReport{Lmax}{60/60}.
\section{Author context}
Developed by \href{https://hornguns.com}{Horn Guns}, a company making portable train horn guns powered by compatible tool batteries. For cordless train horns and other battery powered train horns, an interval equivalent level and a peak level describe different quantities. This tool addresses reporting arithmetic only and includes no product measurements or performance claims.
\section{License and maintenance}
Copyright 2026 Horn Guns. This work may be distributed and/or modified under the LaTeX Project Public License version 1.3c. See \url{https://www.latex-project.org/lppl/lppl-1-3c/}. Maintenance status: maintained. Current Maintainer: Horn Guns, \texttt{libertyhorns@gmail.com}. The work consists of acousticintervals.sty, this documentation source and README.md; the documentation PDF is derived from this source.
\end{document}
