Lobanov Normalize
Usage
norm_lobanov(
.data,
...,
.by = NULL,
.by_formant = TRUE,
.drop_orig = FALSE,
.keep_params = FALSE,
.names = "{.formant}_z",
.silent = FALSE
)
Arguments
- .data
A data frame containing vowel formant data
- ...
<tidy-select>
One or more unquoted expressions separated by commas. These should target the vowel formant data columns.- .by
<tidy-select>
A selection of columns to group by. Typically a column of speaker IDs.- .by_formant
Ignored by this procedure
- .drop_orig
Whether or not to drop the original formant data columns.
- .keep_params
Whether or not to keep the Location (
*_.L
) and Scale (*_.S
) normalization parameters- .names
A
glue::glue()
expression for naming the normalized data columns. The"{.formant}"
portion corresponds to the name of the original formant columns.- .silent
Whether or not the informational message should be printed.
Details
$$ \hat{F}_{ij} = \frac{F_{ij} - L_i}{S_i} $$
$$ L_i = \frac{1}{N}\sum_{j=1}^{N}F_{ij} $$
$$ S_i = \sqrt{\frac{\sum(F_{ij}-L_i)^2}{N-1}} $$
Where
\(\hat{F}\) is the normalized formant
\(i\) is the formant number
\(j\) is the token number
References
Lobanov, B. (1971). Classification of Russian vowels spoken by different listeners. Journal of the Acoustical Society of America, 49, 606–608.
Examples
library(tidynorm)
ggplot2_inst <- require(ggplot2)
speaker_data_lobanov <- speaker_data |>
norm_lobanov(
F1:F3,
.by = speaker,
.names = "{.formant}_z"
)
#> Normalization info
#> • normalized `F1`, `F2`, and `F3`
#> • normalized values in `F1_z`, `F2_z`, and `F3_z`
#> • grouped by `speaker`
#> • formant intrinsic
#>
## this is equivalent to
# speaker_data |>
# norm_generic(
# F1:F3,
# .by = speaker,
# .by_formant = T,
# .L = mean(.formant, na.rm = T),
# .S = sd(.formant, na.rm = T)
# )
if(ggplot2_inst){
ggplot(
speaker_data_lobanov,
aes(
F2_z,
F1_z,
color = speaker
)
)+
stat_density_2d(
bins = 4
)+
scale_color_brewer(
palette = "Dark2"
)+
scale_x_reverse()+
scale_y_reverse()+
coord_fixed()
}