getAM_env: Get Amplitude Modulation

View source: R/am.R

getAM_envR Documentation

Get Amplitude Modulation

Description

Internal soundgen function

Usage

getAM_env(
  audio,
  amRange = c(20, 100),
  overlap = 80,
  parab = TRUE,
  plot = FALSE
)

Details

Measures AM

Examples

s = soundgen(sylLen = 1500, pitch = c(300, 550, 320, 220),
             amFreq = c(50, 120, 100), amDep = c(10, 60, 30))
# spectrogram(s)
# playme(s)
am = soundgen:::getAM_env(audio = list(sound = s, samplingRate = 16000),
  amRange = c(20, 200), overlap = 80, plot = TRUE)
# compare getAM from modulation spectrum:
ms = modulationSpectrum(s, 16000, plot = FALSE)
plot(x = seq(1, 1500, length.out = length(ms$amMsFreq)), y = ms$amMsFreq,
     cex = 10^(ms$amMsDep/20) * 10, xlab = 'Time, ms', ylab = 'AM frequency, Hz')

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