Vocal signature via voice

Filipe J. Zabala

2024-03-24 11:38:23

0. Context

This is a vignette presenting the voice approach (Zabala 2023) to (Rehder et al. 2022) available audios.

1. Libraries and functions

1.1 Installing

The summarization was made using voice, an R library with functions to easily deal with audio.

# install packs
install.packages('voice', dep = TRUE)

1.2 Calling

The libraries are called, geti and gaussian functions are defined.

# packs
library(voice)
library(tidyverse)

# geti function
geti <- function(x,i){x[i]}

2. Data

The summarized dataset via voice is available at https://github.com/filipezabala/assinatura_vocal.

2.1 Reading data

path <- 'https://raw.githubusercontent.com/filipezabala/assinatura_vocal/main/Et.csv'
Et <- readr::read_csv(path)
Et
#> # A tibble: 9 × 373
#>   subject_id f0_tag_mean f1_tag_mean f2_tag_mean f3_tag_mean f4_tag_mean
#>   <chr>            <dbl>       <dbl>       <dbl>       <dbl>       <dbl>
#> 1 AN                147.        482.       1593.       2641.       3626.
#> 2 BS                160.        486.       1480.       2443.       3465.
#> 3 EK                177.        520.       1576.       2578.       3493.
#> 4 FP                159.        519.       1640.       2669.       3679.
#> 5 JJ                124.        410.       1554.       2515.       3554.
#> 6 NT                191.        615.       1472.       2503.       3471.
#> 7 SD                191.        480.       1537.       2607.       3509.
#> 8 SR                210.        487.       1441.       2528.       3510.
#> 9 TR                106.        464.       1644.       2585.       3663.
#> # ℹ 367 more variables: f5_tag_mean <dbl>, f6_tag_mean <dbl>,
#> #   f7_tag_mean <dbl>, f8_tag_mean <dbl>, zcr1_tag_mean <dbl>,
#> #   mhs_tag_mean <dbl>, rms_tag_mean <dbl>, gain_tag_mean <dbl>,
#> #   mfcc1_tag_mean <dbl>, mfcc2_tag_mean <dbl>, mfcc3_tag_mean <dbl>,
#> #   mfcc4_tag_mean <dbl>, mfcc5_tag_mean <dbl>, mfcc6_tag_mean <dbl>,
#> #   mfcc7_tag_mean <dbl>, mfcc8_tag_mean <dbl>, mfcc9_tag_mean <dbl>,
#> #   mfcc10_tag_mean <dbl>, mfcc11_tag_mean <dbl>, mfcc12_tag_mean <dbl>, …

3. Plots

PCA

Principal Components Analysis (Pearson 1901) applied to dimensionality reduction.

# PCA
pcaE <- prcomp(Et[,-1], scale = T)

PC1 x PC2

# devtools::install_github('cran/pca3d')
library(pca3d)
pca2d(pcaE, c(1,2), group = Et$subject_id, show.group.labels = T, show.ellipses = F)

# PC1 x PC2
# Q1: SD, BS
# Q2: TR, JJ
# Q3: FP, AN
# Q4: EK, NT, SR

PC2 x PC3

pca2d(pcaE, c(2,3), group = Et$subject_id, show.group.labels = T, show.ellipses = F)

# PC2 x PC3
# Q1: SD, JJ
# Q2: BS, TR
# Q3: NT, SR, AN
# Q4: EK, FP

PC1 x PC3

pca2d(pcaE, c(1,3), group = Et$subject_id, show.group.labels = T, show.ellipses = F)

# PC1 x PC3
# Q1: SD, EK
# Q2: FP, JJ
# Q3: AN, TR
# Q4: BS, SR, NT

PC1 x PC2 x PC3

pca3d(pcaE, group = Et$subject_id, show.group.labels = T, show.shadows = F)
#> [1] 0.3844791 0.2789792 0.2131257
#> Creating new device
# PC1 x PC2 x PC3
# O1: SD
# O2: BS
# O3: TR
# O4: JJ
# O5: EK
# O6: SR, NT
# O7: AN
# O8: FP
Pearson, Karl. 1901. “On Lines and Planes of Closest Fit to Systems of Points in Space.” Philosophical Magazine 2 (11): 559–72. http://pca.narod.ru/pearson1901.pdf.
Rehder, M. I., A. F. Pessoa, A. P. Sanches, and R. C. S. Gonzalez. 2022. Assinatura Vocal - Perícia de Voz e Linguagem Em Casos Criminais Midiáticos. 1st ed. Campinas - SP: Millenium Editora. https://www.millenniumeditora.com.br/ciencias-forenses/assinatura-vocal-pericia-de-voz-e-linguagem-em-casos-criminais-midiaticos//.
Zabala, Filipe J. 2023. Voice: Tools for Voice Analysis, Speaker Recognition and Mood Inference. https://CRAN.R-project.org/package=voice.