guessPhase_GL: Guess phase GL

View source: R/invertSpectrogram.R

guessPhase_GLR Documentation

Guess phase GL

Description

Internal soundgen function

Usage

guessPhase_GL(
  spec,
  phase,
  nIter,
  samplingRate,
  overlap,
  wn,
  step_points,
  verbose = TRUE,
  plotError = TRUE
)

Arguments

spec

the spectrogram that is to be transform to a time series: numeric matrix with frequency bins in rows and time frames in columns

phase

an initial guess at the phase: numeric matrix of the same dimensions as spec

nIter

the number of iterations of the GL algorithm (Griffin & Lim, 1984), 0 = don't run

samplingRate

sampling rate of x (only needed if x is a numeric vector)

overlap

overlap between successive FFT frames, %

wn

window type accepted by ftwindow, currently gaussian, hanning, hamming, bartlett, rectangular, blackman, flattop

step_points

STFT step in points

verbose

if TRUE, prints estimated time left every 10% of GL iterations

plotError

if TRUE, produces a scree plot of squared error over GL iterations (useful for choosing 'nIter')

Details

Uses the iterative method proposed by Griffin & Lim (1984) to guess the phase of a magnitude spectrogram.

Value

Returns a matrix of the same dimensions as 'spec' containing the guessed phase.


soundgen documentation built on Aug. 14, 2022, 5:05 p.m.