functional_griffinlim: Griffin-Lim Transformation (functional)

functional_griffinlimR Documentation

Griffin-Lim Transformation (functional)

Description

Compute waveform from a linear scale magnitude spectrogram using the Griffin-Lim transformation. Implementation ported from librosa.

Usage

functional_griffinlim(
  specgram,
  window,
  n_fft,
  hop_length,
  win_length,
  power,
  normalized,
  n_iter,
  momentum,
  length,
  rand_init
)

Arguments

specgram

(Tensor): A magnitude-only STFT spectrogram of dimension (..., freq, frames) where freq is n_fft %/% 2 + 1.

window

(Tensor): Window tensor that is applied/multiplied to each frame/window

n_fft

(int): Size of FFT, creates n_fft %/% 2 + 1 bins

hop_length

(int): Length of hop between STFT windows.

win_length

(int): Window size.

power

(float): Exponent for the magnitude spectrogram, (must be > 0) e.g., 1 for energy, 2 for power, etc.

normalized

(bool): Whether to normalize by magnitude after stft.

n_iter

(int): Number of iteration for phase recovery process.

momentum

(float): The momentum parameter for fast Griffin-Lim. Setting this to 0 recovers the original Griffin-Lim method. Values near 1 can lead to faster convergence, but above 1 may not converge.

length

(int or NULL): Array length of the expected output.

rand_init

(bool): Initializes phase randomly if TRUE, to zero otherwise.

Value

tensor: waveform of (..., time), where time equals the length parameter if given.


curso-r/torchaudio documentation built on May 4, 2023, 2:27 a.m.