Build reusable multi-band Harmonicity objects
Source:R/performance-helpers.R
build_multiband_harmonicity.RdCompute the 5 Harmonicity objects used by VQ's multiband HNR workflow once, then reuse them across repeated interval queries with [multiband_hnr_stats()].
Usage
build_multiband_harmonicity(
sound,
bands = c(0, 500, 1500, 2500, 3500),
time_step = 0.005,
min_pitch = 75
)Value
Named list of 5 `Harmonicity` objects: `full`, `band500`, `band1500`, `band2500`, `band3500` (or names derived from custom bands).
Details
Use this when the same `Sound` is queried over many `[from_time, to_time]` windows, e.g. a TextGrid with multiple voiced intervals. The expensive band-pass filtering and Harmonicity computation are done once; only the summary stats are repeated.
References
- VQ_measurements_V2.praat (Voice Quality measurements) - Maryn & Weenink (2015) - Multi-band HNR for voice quality
Examples
sound <- Sound$create_tone(frequency = 150, duration = 0.5, sampling_rate =
16000)
built <- build_multiband_harmonicity(sound)
hnr_full <- multiband_hnr_stats(built)