Convenience function to create pre-defined window functions as compiled XPtrs. Requires the RcppXPtrUtils package.
Usage
create_window_xptr(
type = c("hamming", "hanning", "gaussian", "triangular", "blackman", "rectangular"),
sigma = 0.25
)Examples
# \donttest{
# Compiling a C++ window function takes a few seconds
if (requireNamespace("RcppXPtrUtils", quietly = TRUE)) {
hamming <- create_window_xptr("hamming")
sound <- Sound$create_tone(frequency = 220, duration = 0.3, sampling_rate =
16000)
windowed <- apply_window_xptr(sound, hamming)
}
# }