Skip to content

Integrate gain_chk, per-band gain verification tool, into STL #179

Open
TomV76 wants to merge 6 commits into
openitu:devfrom
TomV76:STL-gain-check-tool
Open

Integrate gain_chk, per-band gain verification tool, into STL #179
TomV76 wants to merge 6 commits into
openitu:devfrom
TomV76:STL-gain-check-tool

Conversation

@TomV76
Copy link
Copy Markdown

@TomV76 TomV76 commented May 22, 2026

Summary
This PR adds gain_chk, a command-line tool for per-band gain verification between a reference and a processed 16-bit PCM stream. It is intended for codec and speech-processing validation workflows aligned with ITU-T G.191-style tooling.

The tool analyzes audio in 20 ms frames, performs short-time spectral analysis, and reports energy ratios (dB and %) per frequency band. Optional VAD input splits statistics into active/inactive frames; optional threshold flags (-a, -s) provide a numeric exit code for automated pass/fail in scripts.

What's included
gain_chk source (src/gain_chk/gain_chk.c)
CMake target integrated into the top-level STL build (gain_chk → build/bin/gain_chk)
5 CTest regression cases (gain_chk_self, gain_chk_a–d) with bundled PCM and golden stderr references
README.md with build and test instructions; release notes for revision history

TomV76 and others added 5 commits May 14, 2026 15:19
… the STL build; add regression tests under src/gain_chk/test_data and README for build/ctest usage.
… algorithm, command line syntax, and implementation. Integrate the new chapter into the STL manual.
…djusted equation formatting for clarity and added gain_chk.tex to the build process.
Add .gitattributes with eol=native for .ref files so they are checked
out with platform-native line endings, matching gain_chk stderr output.
Normalize stored ref files to LF.
- Move chapter after freqresp (spectral analysis tools grouped together)
- Add labels to chapter and all sections for cross-referencing
- Add output file format subsection describing -t results structure
- Add usage examples with sample output and threshold check
- Fix data format description (remove incorrect endianness wording)
@ludomal
Copy link
Copy Markdown
Member

ludomal commented May 29, 2026

Thanks @TomV76 for the tool.

CTest fails on MacOS (and most likely Linux) because of CRLF line endings in the reference files. I assume they have been generated on Windows. The fix is to let Git update the reference file automatically according to the platform it checks out (see .gitattributes).

I have also updated the documentation with more details on the output file and usage to match the other sections of the manual, added links and moved the section just after freqresp.

I have submitted a PR on your project with the proposed changes for your consideration: TomV76#1

Pr 179 fixes CRLF and improves doc. Thanks to @ludomal
@TomV76
Copy link
Copy Markdown
Author

TomV76 commented May 29, 2026

Thanks for the corrections and improvments @ludomal , I accepted your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants