functional_phase_vocoder | R Documentation |
Given a STFT tensor, speed up in time without modifying pitch by a factor of rate
.
functional_phase_vocoder(complex_specgrams, rate, phase_advance)
complex_specgrams |
(Tensor): Dimension of |
rate |
(float): Speed-up factor |
phase_advance |
(Tensor): Expected phase advance in each bin. Dimension of (freq, 1) |
tensor
: Complex Specgrams Stretch with dimension of (..., freq, ceiling(time/rate), complex=2)
if(torch::torch_is_installed()) { library(torch) library(torchaudio) freq = 1025 hop_length = 512 # (channel, freq, time, complex=2) complex_specgrams = torch_randn(2, freq, 300, 2) rate = 1.3 # Speed up by 30% phase_advance = torch_linspace(0, pi * hop_length, freq)[.., NULL] x = functional_phase_vocoder(complex_specgrams, rate, phase_advance) x$shape # with 231 == ceil (300 / 1.3) # torch.Size ([2, 1025, 231, 2]) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.