Skip to content

feat(voicing): add mu-law domain for voicing/energy extraction - #333

Open
KakaruHayate wants to merge 1 commit into
openvpi:mainfrom
KakaruHayate:pr/mulaw-voicing
Open

KakaruHayate wants to merge 1 commit into
openvpi:mainfrom
KakaruHayate:pr/mulaw-voicing

Conversation

@KakaruHayate

@KakaruHayate KakaruHayate commented Sep 16, 2026

Copy link
Copy Markdown

What this does

Adds a voicing_domain configuration key that selects how the voicing curve (and the RMS energy it is derived from) is represented:

  • 'db' (default): the current behaviour - raw RMS of the harmonic part converted to decibels.
  • 'mulaw': mu-law compression (mu = 255) of the same RMS values, rescaled to [-96, 0] so it stays compatible with the dB-like range the rest of the pipeline expects. The compression gives low-energy frames a larger share of the available range, which improves resolution on unvoiced and weakly voiced segments.

Implementation:

  • utils/binarizer_utils.get_energy_librosa and get_voicing gain domain and mu parameters.
  • The acoustic and variance binarizers pass hparams['voicing_domain'] through when extracting voicing.
  • The variance parameter adaptor clamps the upper normalization bound of the voicing branch to 0 when the domain is 'mulaw'; voicing_db_min still applies as the lower bound.
  • docs/ConfigurationSchemas.md gains a voicing_domain entry.

Configuration

voicing_domain is read from the acoustic and variance configs and falls back to 'db' when unset, so configurations that do not set it keep exactly the current behaviour.

The shipped configs/acoustic.yaml, configs/variance.yaml and the two template configs do set voicing_domain: 'mulaw'. Let me know if you would rather keep the shipped recipes on 'db' and treat mulaw as strictly opt-in - I am happy to drop those four lines.

Compatibility

Switching the domain changes both the stored voicing curves and the normalization range of the voicing branch, so it requires re-running binarization and training from scratch to take full effect. This is noted in the new schema entry.

Notes

Supersedes #304, which was closed after unrelated work ended up on the same branch. This PR contains only the mu-law change, rebased onto the current main.

Introduce 'mulaw' voicing_domain and mu-law energy handling across configs and preprocessing. Configs updated to include voicing_domain='mulaw' (acoustic/variance templates and instances). Acoustic/variance binarizers now pass hparams['voicing_domain'] to get_voicing. Parameter adaptor clamps voicing max to 0 when domain is 'mulaw'. get_energy_librosa and get_voicing gain new domain/mu params and implement mu-law compression (default mu=255) to produce a dB-like range compatible with existing pipelines. These changes add support for mu-law representation of voicing/energy.
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.

1 participant