getFormants: Get formants

View source: R/formants_utilities.R

getFormantsR Documentation

Get formants

Description

Internal soundgen function

Usage

getFormants(
  audio,
  windowLength = 50,
  step = 25,
  wn = "gaussian",
  zp = 0,
  dynamicRange = 80,
  silence = 0.04,
  formants = list(),
  nFormants = NULL
)

Arguments

audio

input sound as returned by readAudio

windowLength

length of FFT window, ms

step

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)

wn

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

zp

window length after zero padding, points

dynamicRange

dynamic range, dB. All values more than one dynamicRange under maximum are treated as zero

silence

(0 to 1 as proportion of max amplitude) frames with RMS amplitude below silence * max_ampl adjusted by scale are not analyzed at all.

formants

a list of arguments passed to findformants - an external function called to perform LPC analysis

nFormants

the number of formants to extract per STFT frame (0 = no formant analysis, NULL = as many as possible)

Details

A barebones version of analyze() that only measures formants. Called by formant_app()

Examples

data(sheep, package = 'seewave')
f = soundgen:::getFormants(soundgen:::readAudio(sheep, from = .1, to = .5))
f[11:15, 1:5]

soundgen documentation built on Sept. 29, 2023, 5:09 p.m.