Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
T
tseries
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de conteneur
Registre de modèles
Opération
Environnements
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Conditions générales et politique de confidentialité
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Michel Crucifix
tseries
Validations
5feb65ad
Valider
5feb65ad
rédigé
Il y a 8 mois
par
Michel Crucifix
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
mffft
parent
199394e5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
5
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
5 fichiers modifiés
NAMESPACE
+1
-0
1 ajout, 0 suppression
NAMESPACE
R/mmfft.R
+1
-9
1 ajout, 9 suppressions
R/mmfft.R
R/toneCombinations.R
+22
-3
22 ajouts, 3 suppressions
R/toneCombinations.R
man/attributeTones.Rd
+3
-1
3 ajouts, 1 suppression
man/attributeTones.Rd
man/toneCombinations.Rd
+3
-1
3 ajouts, 1 suppression
man/toneCombinations.Rd
avec
30 ajouts
et
14 suppressions
NAMESPACE
+
1
−
0
Voir le fichier @
5feb65ad
...
...
@@ -5,6 +5,7 @@ S3method(lines,mfft_deco)
S3method(plot,SSAObject)
S3method(plot,memObject)
S3method(plot,mfft_deco)
S3method(plot,mmfft)
S3method(plot,periodogram)
S3method(plot,wavelet)
S3method(print,mfft_deco)
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
R/mmfft.R
+
1
−
9
Voir le fichier @
5feb65ad
...
...
@@ -26,6 +26,7 @@ mmfft <- function(xdata, seglength = length(xdata) %/% 16, ...){
}
#' @rdname mmfft
#' @export
plot.mmfft
<-
function
(
x
){
freqrange
<-
c
(
min
(
sapply
(
x
,
function
(
xs
)
min
(
xs
$
Freq
))),
...
...
@@ -35,7 +36,6 @@ plot.mmfft <- function(x){
c
(
min
(
sapply
(
x
,
function
(
xs
)
min
(
xs
$
Amp
))),
max
(
sapply
(
x
,
function
(
xs
)
max
(
xs
$
Amp
))))
print
(
amprange
)
amp2lwd
<-
function
(
amp
){
3
*
amp
/
amprange
[
2
]
}
length
<-
attr
(
x
,
"nsections"
)
*
...
...
@@ -48,17 +48,13 @@ plot.mmfft <- function(x){
tstart
<-
attr
(
x
,
"start"
)
tend
<-
tstart
+
nsec
*
tsec
print
(
freqrange
)
print
(
c
(
tstart
,
tend
))
plot
(
c
(
tstart
,
tend
),
freqrange
,
type
=
'n'
,
xlab
=
'Time'
,
ylab
=
'Rate'
)
for
(
iseq
in
seq
(
nsec
)){
trange
<-
tstart
+
c
(
iseq
-1
,
iseq
)
*
tsec
obj
<-
x
[[
iseq
]]
nfreq
<-
length
(
obj
$
Freq
)
print
(
obj
$
Amp
)
lwds
<-
sapply
(
obj
$
Amp
,
amp2lwd
)
print
(
lwds
)
for
(
j
in
seq
(
nfreq
)){
lines
(
trange
,
rep
(
obj
$
Freq
[
j
],
2
),
lwd
=
lwds
[
j
])
}
...
...
@@ -66,7 +62,3 @@ plot.mmfft <- function(x){
}
Ce diff est replié.
Cliquez pour l'agrandir.
R/toneCombinations.R
+
22
−
3
Voir le fichier @
5feb65ad
...
...
@@ -6,6 +6,7 @@
#' @importFrom RcppAlgos comboGeneral
#' @param omegas: vector of references frequencies, optionally with rownames,
#' @param keepPositives : if TRUE, then only keeps positive combinations of frequencies
#' @param fractions : defaults 1. Set 2 to include double-periods, and 3 triple-periods.
#' @return a vector with combination of tones and explicit rownames, using, if available, the
#' rownames provided in the input vector omega
#' @author Michel Crucifix
...
...
@@ -14,7 +15,24 @@
#' omegas <- c( 0.123, 0.14312, 0.33251, 0.554313)
#' print(toneCombinations(omegas))
toneCombinations
<-
function
(
omegas
,
keepPositives
=
TRUE
){
toneCombinations
<-
function
(
omegas
,
fractions
=
1
,
keepPositives
=
TRUE
){
if
(
fractions
==
2
){
local
({
tmp
<-
c
(
as.numeric
(
omegas
),
as.numeric
(
omegas
)
/
2
)
names
(
tmp
)
<-
c
(
names
(
omegas
),
sprintf
(
"%s/2"
,
names
(
omegas
)))
omegas
<<-
tmp
})
}
if
(
fractions
==
3
){
local
({
tmp
<-
c
(
as.numeric
(
omegas
),
as.numeric
(
omegas
)
/
2
,
as.numeric
(
omegas
)
/
3
)
names
(
tmp
)
<-
c
(
names
(
omegas
),
sprintf
(
"%s/2"
,
names
(
omegas
)),
sprintf
(
"%s/3"
,
names
(
omegas
)))
omegas
<<-
tmp
})
}
twoomegas
<-
c
(
-
omegas
,
omegas
)
indices
<-
c
(
-
seq
(
length
(
omegas
)),
seq
(
length
(
omegas
)))
result
=
rbind
(
...
...
@@ -75,6 +93,7 @@ generate_name <- function(invec,char="s", labels = NULL){
#'
#' @param infreq : input frequencies
#' @param omegas : reference frequencies (a numeric vector which may contain explicit row names)
#' @param fractions : 1, 2, or 3 depending on willing to include singe, double or triple periods
#' @param tol1 : acceptable tolerance for being considered as a certain attribution
#' (if several frequencies match the criteria, the closest will be taken)
#' @param tol2 : acceptable tolerance for being considered as a likely or plausible
...
...
@@ -93,9 +112,9 @@ generate_name <- function(invec,char="s", labels = NULL){
#' plot(outfreqs, outamps, type='h')
#' text(outfreqs, outamps+0.1, attributions)
#'
attributeTones
<-
function
(
infreq
,
omegas
,
tol1
=
1
.e
-6
,
tol2
=
1
.e
-4
)
{
attributeTones
<-
function
(
infreq
,
omegas
,
fractions
=
1
,
tol1
=
1
.e
-6
,
tol2
=
1
.e
-4
)
{
attributions
<-
rep
(
""
,
length
(
infreq
))
combis
<-
toneCombinations
(
omegas
)
combis
<-
toneCombinations
(
omegas
,
fractions
=
fractions
)
for
(
i
in
seq
(
infreq
)){
deltas
<-
abs
(
infreq
[
i
]
-
combis
)
bestSuspect
<-
which.min
(
abs
(
infreq
[
i
]
-
combis
))
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
man/attributeTones.Rd
+
3
−
1
Voir le fichier @
5feb65ad
...
...
@@ -4,13 +4,15 @@
\alias{attributeTones}
\title{Attribution of combination of tones}
\usage{
attributeTones(infreq, omegas, tol1 = 1e-06, tol2 = 1e-04)
attributeTones(infreq, omegas,
fractions = 1,
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{fractions}{: 1, 2, or 3 depending on willing to include singe, double or triple periods}
\item{tol1}{: acceptable tolerance for being considered as a certain attribution
(if several frequencies match the criteria, the closest will be taken)}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
man/toneCombinations.Rd
+
3
−
1
Voir le fichier @
5feb65ad
...
...
@@ -4,9 +4,11 @@
\alias{toneCombinations}
\title{Generation of combination of tones}
\usage{
toneCombinations(omegas, keepPositives = TRUE)
toneCombinations(omegas,
fractions = 1,
keepPositives = TRUE)
}
\arguments{
\item{fractions}{: defaults 1. Set 2 to include double-periods, and 3 triple-periods.}
\item{keepPositives}{: if TRUE, then only keeps positive combinations of frequencies}
\item{omegas:}{vector of references frequencies, optionally with rownames,}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter