Fast PowerCepstrogram Creation (Advanced Performance API)
Source:R/performance-helpers.R
to_powercepstrogram_fast.RdCreate a PowerCepstrogram object bypassing R6 method dispatch for maximum performance. Returns an external pointer that can be used with other fast path functions.
Usage
to_powercepstrogram_fast(
sound,
pitch_floor = 60,
time_step = 0.002,
max_frequency = 5000,
pre_emphasis_from = 50
)Details
**ADVANCED API** - Returns raw external pointer, not R6 object.
Use this when you need to create multiple PowerCepstrogram objects in a loop and want to minimize R6 overhead. The returned pointer can be: - Passed to other fast path functions - Wrapped in R6 PowerCepstrogram object if needed
Examples
sound <- Sound(system.file("extdata", "test.wav", package = "pladdrr"))
# Fast path: returns an external pointer, no wrapper object built
pcep_ptr <- to_powercepstrogram_fast(sound, 60, 0.002, 5000, 50)
# Wrap it when you want the method API
pcep <- PowerCepstrogram(.xptr = pcep_ptr)
pcep$get_cpps()
#> [1] 9.920529