norm_dct_deltaF {tidynorm} | R Documentation |
Delta F DCT Normalization
Description
Delta F DCT Normalization
Usage
norm_dct_deltaF(
.data,
...,
.token_id_col,
.by = NULL,
.param_col = NULL,
.drop_orig = FALSE,
.names = "{.formant}_df",
.silent = FALSE
)
Arguments
.data |
A data frame containing vowel formant data |
... |
|
.token_id_col |
|
.by |
|
.param_col |
A column identifying the DCT parameter number. |
.drop_orig |
Should the originally targeted columns be dropped. |
.names |
A |
.silent |
Whether or not the informational message should be printed. |
Details
\hat{F}_{ij} = \frac{F_{ij}}{S}
S = \frac{1}{MN}\sum_{i=1}^M\sum_{j=1}^N \frac{F_{ij}}{i-0.5}
Where
-
\hat{F}
is the normalized formant -
i
is the formant number -
j
is the token number
Value
A data frame of Delta F normalized DCT coefficients.
References
Johnson, K. (2020). The \Delta
F method of vocal tract length normalization for vowels.
Laboratory Phonology: Journal of the Association for Laboratory Phonology, 11(1),
Article 1. doi:10.5334/labphon.196
Examples
library(tidynorm)
library(dplyr)
ggplot2_inst <- require(ggplot2)
speaker_dct <- speaker_tracks |>
reframe_with_dct(
F1:F3,
.by = speaker,
.token_id_col = id,
.time_col = t
)
# Normalize DCT coefficients
speaker_dct_norm <- speaker_dct |>
norm_dct_deltaF(
F1:F3,
.by = speaker,
.token_id_col = id,
.param_col = .param
)
# Apply average and apply inverse dct
# to plot tracks
track_norm_means <- speaker_dct_norm |>
summarise(
.by = c(speaker, vowel, .param),
across(
ends_with("_df"),
mean
)
) |>
reframe_with_idct(
ends_with("_df"),
.by = speaker,
.token_id_col = vowel,
.param_col = .param
)
if (ggplot2_inst) {
track_norm_means |>
ggplot(
aes(F2_df, F1_df, color = speaker)
) +
geom_path(
aes(
group = interaction(speaker, vowel)
)
) +
scale_x_reverse() +
scale_y_reverse() +
scale_color_brewer(palette = "Dark2") +
coord_fixed()
}