diff --git a/R/mfft_support.R b/R/mfft_support.R index 733ce535da78c1519795768c2d28f8e4e1e184d2..662afe43ed4fe692e7bb6b45bcd16236fe924427 100644 --- a/R/mfft_support.R +++ b/R/mfft_support.R @@ -62,8 +62,8 @@ plot.mfft_deco <- function (M,periods=FALSE,labels=NULL,...){ } points(abs(M$Freq), abs(M$Amp),'p',...) if (!is.null(labels)) { - yshift <- 0.2*range(M$Amp) - text(M$Freq, M$Amp + yshift, labels) + yshift <- 0.05*range(M$Amp) + text(M$Freq, M$Amp + yshift, labels, srt=90, pos=4) } } diff --git a/man/attributeTones.Rd b/man/attributeTones.Rd new file mode 100644 index 0000000000000000000000000000000000000000..00f347d5ebc32a1bf3cd124ccf9729fde4a8e4c0 --- /dev/null +++ b/man/attributeTones.Rd @@ -0,0 +1,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) + +} diff --git a/man/toneCombinations.Rd b/man/toneCombinations.Rd new file mode 100644 index 0000000000000000000000000000000000000000..9be4371e80e38c3fc96b926f7ef938e5162009c6 --- /dev/null +++ b/man/toneCombinations.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/toneCombinations.R +\name{toneCombinations} +\alias{toneCombinations} +\title{Generation of combination of tones} +\usage{ +toneCombinations(omegas, keepPositives = TRUE) +} +\arguments{ +\item{keepPositives}{: if TRUE, then only keeps positive combinations of frequencies} + +\item{omegas:}{vector of references frequencies, optionally with rownames,} +} +\value{ +a vector with combination of tones and explicit rownames, using, if available, the + rownames provided in the input vector omega +} +\description{ +Generates a vector with combinations of an input vector of frequencies, wih +explicit label names, up to order 3 (this could be made more flexible is the future) +} +\examples{ +omegas <- c( 0.123, 0.14312, 0.33251, 0.554313) +print(toneCombinations(omegas) +} +\author{ +Michel Crucifix +}