findformants | R Documentation |
Find formants given a sound or set of LPC coefficients.
findformants (sound, fs = 10000, coeffs = NULL, maxbw = 600,
minformant = 200, verify = TRUE, showbws = FALSE,
showrejected = TRUE)
sound |
A numeric vector representing a waveform, or a 'sound' object created with the loadsound() or makesound() functions. |
fs |
The sampling frequency of the sound. If a 'sound' object is passed this does not need to be specified. |
coeffs |
If a number is given, this many coefficients are used in the analysis. Alternatively, the LPC (AR filter) coefficients may be passed to the function directly using this parameter. For good results, two coefficients are required for each formants plus 2 or 3 'for the pot'. |
maxbw |
The maximum bandwidth for accepted formants. |
minformant |
Formants below this frequency are rejected. |
verify |
If TRUE, a plot is created which allows the user to visually inspect the process. |
showbws |
If TRUE, formant bandwidths are indicated on the plot. |
showrejected |
If TRUE, rejected formant locations are indicated. |
Formant frequencies are found analytically using the formulas provided in Snell (1993). If Verify = TRUE, the estimated frequency response, formant locations, and a pole-zero plot of the estimated filter are presented. Accepted formants are presented in 5 colors (which are reused if there are more than 5 formants), while rejected formants are presented in black.
A dataframe with the following elements is returned:
frequency |
The frequencies of formants, in ascending order. |
bandwidth |
The corresponding formant bandwidth. |
Santiago Barreda <sbarreda@ucdavis.edu>
Snell, R.(1993). "Formant location from LPC analysis data", IEEE Transactions on Speech and Audio Processing, 1(2), pp. 129-134.
## make a synthetic vowel with a known set of formant frequencies
## and bandwidths
#sound = vowelsynth (ffs = c(500,1500,2500,3500,4500),
# fbw = c(30, 90, 150, 210, 270), f0 = 100)
## compare different plotting options
#findformants (sound)
#findformants (sound, showrejected = FALSE)
#findformants (sound, showbws = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.