Internal soundgen function.
.filterSoundByMS(
audio,
logSpec = FALSE,
windowLength = 25,
step = NULL,
overlap = 80,
wn = "hamming",
zp = 0,
amCond = NULL,
fmCond = NULL,
jointCond = NULL,
action = c("remove", "preserve")[1],
initialPhase = c("zero", "random", "spsi")[3],
nIter = 50,
play = FALSE,
plot = TRUE,
savePlots = NULL,
width = 900,
height = 500,
units = "px",
res = NA
)
a list returned by readAudio
if TRUE, the spectrogram is log-transformed prior to taking 2D FFT
length of FFT window, ms
you can override overlap
by specifying FFT step, ms (NB:
because digital audio is sampled at discrete time intervals of
1/samplingRate, the actual step and thus the time stamps of STFT frames
may be slightly different, eg 24.98866 instead of 25.0 ms)
overlap between successive FFT frames, %
window type accepted by ftwindow
, currently
gaussian, hanning, hamming, bartlett, rectangular, blackman, flattop
window length after zero padding, points
character strings with valid conditions on amplitude and frequency modulation (see examples)
character strings with valid conditions on amplitude and frequency modulation (see examples)
character string with a valid joint condition amplitude and frequency modulation
should the defined AM-FM region be removed ('remove') or preserved, while everything else is removed ('preserve')?
initial phase estimate: "zero" = set all phases to zero; "random" = Gaussian noise; "spsi" (default) = single-pass spectrogram inversion (Beauregard et al., 2015)
the number of iterations of the GL algorithm (Griffin & Lim, 1984), 0 = don't run
if TRUE, plays back the reconstructed audio
if TRUE, produces a triple plot: original MS, filtered MS, and the MS of the output sound
if a valid path is specified, a plot is saved in this folder (defaults to NA)
parameters passed to
png
if the plot is saved
parameters passed to
png
if the plot is saved
parameters passed to
png
if the plot is saved
parameters passed to
png
if the plot is saved