Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
% 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{
attributeTones(infreq, omegas, tol1 = 1e-06, tol2 = 1e-04)
}
\arguments{
\item{infreq}{: input frequencies}
\item{omegas}{: reference frequencies (a numeric vector which may contain explicit row names)}
\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)
}