Skip to contents

Bark Difference Normalize

Usage

norm_barkz(
  .data,
  ...,
  .by = NULL,
  .drop_orig = FALSE,
  .keep_params = FALSE,
  .names = "{.formant}_bz",
  .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.

.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.

Value

A data frame of Bark Difference normalized formant values

Details

This is a within-token normalization technique. First all formants are converted to Bark (see hz_to_bark), then, within each token, F3 is subtracted from F1 and F2.

$$ \hat{F}_{ij} = F_{ij} - L_j $$

$$ L_j = F_{3j} $$

References

Syrdal, A. K., & Gopal, H. S. (1986). A perceptual model of vowel recognition based on the auditory representation of American English vowels. The Journal of the Acoustical Society of America, 79(4), 1086–1100. https://doi.org/10.1121/1.393381

Examples

library(tidynorm)
ggplot2_inst <- require(ggplot2)
#> Loading required package: ggplot2

speaker_data_barkz <- speaker_data |>
  norm_barkz(
    F1:F3,
    .by = speaker,
    .names = "{.formant}_bz"
  )
#> Normalization info
#>  normalized `F1`, `F2`, and `F3`
#>  normalized values in `F1_bz`, `F2_bz`, and `F3_bz`
#>  grouped by `speaker`
#>  formant extrinsic
#> 

## this is equivalent to
# speaker_data |>
#   norm_generic(
#     F1:F3,
#     .by = speaker,
#     .by_token = T,
#     .L = .formant[3]
#   )

if(ggplot2_inst){
  ggplot(
    speaker_data_barkz,
    aes(
      F2_bz,
      F1_bz,
      color = speaker
    )
  )+
    stat_density_2d(
      bins = 4
    )+
    scale_color_brewer(
      palette = "Dark2"
    )+
    scale_x_reverse()+
    scale_y_reverse()+
    coord_fixed()
}
#> Warning: Removed 42 rows containing non-finite outside the scale range
#> (`stat_density2d()`).