Skip to content
Extraits de code Groupes Projets
attributeTones.Rd 1,33 ko
Newer Older
  • Learn to ignore specific revisions
  • Michel Crucifix's avatar
    Michel Crucifix a validé
    % Generated by roxygen2: do not edit by hand
    % Please edit documentation in R/toneCombinations.R
    \name{attributeTones}
    \alias{attributeTones}
    \title{Attribution of combination of tones}
    \usage{
    
    Michel Crucifix's avatar
    Michel Crucifix a validé
    attributeTones(infreq, omegas, fractions = 1, tol1 = 1e-06, tol2 = 1e-04)
    
    Michel Crucifix's avatar
    Michel Crucifix a validé
    }
    \arguments{
    \item{infreq}{: input frequencies}
    
    \item{omegas}{: reference frequencies (a numeric vector which may contain explicit row names)}
    
    
    Michel Crucifix's avatar
    Michel Crucifix a validé
    \item{fractions}{: 1, 2, or 3 depending on willing to include singe, double or triple periods}
    
    
    Michel Crucifix's avatar
    Michel Crucifix a validé
    \item{tol1}{: acceptable tolerance for being considered as a certain attribution
    (if several frequencies match the criteria, the closest will be taken)}
    
    \item{tol2}{: acceptable tolerance for being considered as a likely or plausible}
    }
    \description{
    Based on a vector of frequencies (`infreq`), and a vector of referenc
    frequencies with row names (it will be input to `toneCombinations`), 
    attribute the `infreq` frequencies with two possible degrees of tolerance
    }
    \examples{
    omegas <- c( 0.123, 0.14312, 0.33251, 0.554313)
    names(omegas) <- c('g1','g2','s1','s2')
    outamps <- c(1., 2, 0.2 , 0.5, 0.5)
    outfreqs <- c(1., 1.2432, omegas[1]+omegas[3]+0.00000002, omegas[1]-omegas[4]+0.00004, 0.15)
    
    attributions <- attributeTones(outfreqs, omegas)
    
    cbind(outfreqs, attributions)
    
    plot(outfreqs, outamps, type='h')
    text(outfreqs, outamps+0.1, attributions)
    
    }