Skip to content
Extraits de code Groupes Projets
Valider 1e7712c6 rédigé par Michel Crucifix's avatar Michel Crucifix
Parcourir les fichiers

introduce develop method + changed data

parent 199394e5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# Generated by roxygen2: do not edit by hand # Generated by roxygen2: do not edit by hand
S3method(as.data.frame,mfft_deco) S3method(as.data.frame,discreteSpectrum)
S3method(lines,mfft_deco) S3method(develop,discreteSpectrum)
S3method(lines,discreteSpectrum)
S3method(plot,SSAObject) S3method(plot,SSAObject)
S3method(plot,discreteSpectrum)
S3method(plot,memObject) S3method(plot,memObject)
S3method(plot,mfft_deco)
S3method(plot,periodogram) S3method(plot,periodogram)
S3method(plot,wavelet) S3method(plot,wavelet)
S3method(print,mfft_deco) S3method(print,discreteSpectrum)
export(approx_ts) export(approx_ts)
export(arspec) export(arspec)
export(attributeTones) export(attributeTones)
export(cwt_morlet) export(cwt_morlet)
export(develop)
export(hilbert_extension) export(hilbert_extension)
export(mem) export(mem)
export(mfft) export(mfft)
...@@ -21,7 +23,6 @@ export(mfft_real) ...@@ -21,7 +23,6 @@ export(mfft_real)
export(mmfft) export(mmfft)
export(periodogram) export(periodogram)
export(powerspectrum.wavelet) export(powerspectrum.wavelet)
export(reconstruct_mfft)
export(reconstruct_morlet) export(reconstruct_morlet)
export(ssa) export(ssa)
export(toneCombinations) export(toneCombinations)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#' #'
#' A simple time series for testing purposes #' A simple time series for testing purposes
#' cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) #' cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498)
#' for t from 0 to 1023. It is coded as a `mfft_deco` objcet and self-describes its spectral decomposition. #' for t from 0 to 1023. It is coded as a `discreteSpectrum` objcet and self-describes its spectral decomposition.
#' #'
#' @docType data #' @docType data
#' @keywords datasets #' @keywords datasets
...@@ -14,7 +14,7 @@ NULL ...@@ -14,7 +14,7 @@ NULL
#' #'
#' Same has harmonic sample but with an added random time series #' Same has harmonic sample but with an added random time series
#' cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + rnorm(1024)*0.12 #' cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + rnorm(1024)*0.12
#' for t from 0 to 1023. It is coded as a `mfft_deco` objcet and self-describes its spectral decomposition. #' for t from 0 to 1023. It is coded as a `discreteSpectrum` objcet and self-describes its spectral decomposition.
#' #'
#' @docType data #' @docType data
#' @keywords datasets #' @keywords datasets
...@@ -26,7 +26,7 @@ NULL ...@@ -26,7 +26,7 @@ NULL
#' #'
#' A truncated version (squared-shape) version of a harmonic signal for mimicking a sedimentary log #' A truncated version (squared-shape) version of a harmonic signal for mimicking a sedimentary log
#' sign( cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + 0.8)) #' sign( cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + 0.8))
#' for t from 0 to 8191. It is coded as a `mfft_deco` objcet and self-describes its spectral decomposition. #' for t from 0 to 8191. It is coded as a `discreteSpectrum` objcet and self-describes its spectral decomposition.
#' @docType data #' @docType data
#' @keywords datasets #' @keywords datasets
#' @name pseudo_log #' @name pseudo_log
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#' not documented for real time series #' not documented for real time series
#' @param nfreq is the number of frequencies returned, must be smaller that the length of xdata. #' @param nfreq is the number of frequencies returned, must be smaller that the length of xdata.
#' @param force_complex : use the complex number implementation even if the time series is real. #' @param force_complex : use the complex number implementation even if the time series is real.
#' @return a `mfft_deco` object, based on a data.frame with columns "Freq", "Ampl" and "Phases". #' @return a `discreteSpectrum` object, based on a data.frame with columns "Freq", "Ampl" and "Phases".
#' note that because of a language glitch (to be fixed), "Freq" actually means "Rate" #' note that because of a language glitch (to be fixed), "Freq" actually means "Rate"
#' @author Michel Crucifix for the R code, and David Nesvorny for most of the supporting C code doing the #' @author Michel Crucifix for the R code, and David Nesvorny for most of the supporting C code doing the
#' Frequency Modified Fourier transform for Complex Numbers #' Frequency Modified Fourier transform for Complex Numbers
...@@ -56,7 +56,7 @@ mfft <- function(xdata, nfreq=15, minfreq=NULL, maxfreq=NULL, correction=1, forc ...@@ -56,7 +56,7 @@ mfft <- function(xdata, nfreq=15, minfreq=NULL, maxfreq=NULL, correction=1, forc
#' the third algorithm should be in general much more precise). #' the third algorithm should be in general much more precise).
#' The computed frequencies are in the range given by minfreq and maxfreq. #' The computed frequencies are in the range given by minfreq and maxfreq.
#' @param nfreq is the number of frequencies returned, must be smaller that the length of xdata. #' @param nfreq is the number of frequencies returned, must be smaller that the length of xdata.
#' @return a `mfft_deco` object, based on a data.frame with columns "Freq", "Ampl" and "Phases". #' @return a `discreteSpectrum` object, based on a data.frame with columns "Freq", "Ampl" and "Phases".
#' note that because of a language glitch (to be fixed), "Freq" actually means "Rate" #' note that because of a language glitch (to be fixed), "Freq" actually means "Rate"
#' @author Michel Crucifix for the R code, and David Nesvorny for most of the supporting C code doing the #' @author Michel Crucifix for the R code, and David Nesvorny for most of the supporting C code doing the
#' actual computations #' actual computations
...@@ -104,7 +104,7 @@ mfft_complex <- function(xdata, nfreq=30, minfreq=NULL, maxfreq=NULL, correctio ...@@ -104,7 +104,7 @@ mfft_complex <- function(xdata, nfreq=30, minfreq=NULL, maxfreq=NULL, correctio
# corresponding to the same amplitude # corresponding to the same amplitude
OUT <- data.frame(Freq=Freq, Amp=Ampl, Phases=Phase) OUT <- data.frame(Freq=Freq, Amp=Ampl, Phases=Phase)
class(OUT) <- c("mfft_deco", "data.frame") class(OUT) <- c("discreteSpectrum", "data.frame")
attr(OUT,"nfreq") <- nfreq attr(OUT,"nfreq") <- nfreq
attr(OUT,"data") <- xdata attr(OUT,"data") <- xdata
......
...@@ -342,15 +342,15 @@ mfft_analyse <- function(xdata, nfreq, fast = TRUE, nu = NULL, minfreq=NULL, max ...@@ -342,15 +342,15 @@ mfft_analyse <- function(xdata, nfreq, fast = TRUE, nu = NULL, minfreq=NULL, max
#' @param nfreq is the number of frequencies returned, must be smaller that the length of xdata. #' @param nfreq is the number of frequencies returned, must be smaller that the length of xdata.
#' @param fast (default = TRUE) uses analytical formulations for the crossproducts involving sines and cosines. #' @param fast (default = TRUE) uses analytical formulations for the crossproducts involving sines and cosines.
#' note: this is not really faster because the bottleneck is actually the goden section search. But more elegant. #' note: this is not really faster because the bottleneck is actually the goden section search. But more elegant.
#' @return a `mfft_deco` object, based on a data.frame with columns "Freq", "Ampl" and "Phases". #' @return a `discreteSpectrum` object, based on a data.frame with columns "Freq", "Ampl" and "Phases".
#' @author Michel Crucifix #' @author Michel Crucifix
#' @references #' @references
#' \insertRef{sidlichovsky97aa}{gtseries} #' \insertRef{sidlichovsky97aa}{gtseries}
#' @examples #' @examples
#' #'
#' data(harmonic_sample) #' data(harmonic_sample)
#' spectrum <- mfft_real(harmonic_sample$data) #' spec <- mfft_real(harmonic_sample$data)
#' print(spectrum) #' print(spec)
#' #'
#' @export mfft_real #' @export mfft_real
mfft_real <- function(xdata, nfreq=5, minfreq=NULL, maxfreq=NULL, correction = 1 , fast=TRUE){ mfft_real <- function(xdata, nfreq=5, minfreq=NULL, maxfreq=NULL, correction = 1 , fast=TRUE){
...@@ -430,7 +430,7 @@ mfft_real <- function(xdata, nfreq=5, minfreq=NULL, maxfreq=NULL, correction = ...@@ -430,7 +430,7 @@ mfft_real <- function(xdata, nfreq=5, minfreq=NULL, maxfreq=NULL, correction =
# rename for class compatibility # rename for class compatibility
names(OUT) <- c("Freq","Amp","Phases") names(OUT) <- c("Freq","Amp","Phases")
class(OUT) <- c("mfft_deco", "data.frame") class(OUT) <- c("discreteSpectrum", "data.frame")
attr(OUT, "data") <- xdata attr(OUT, "data") <- xdata
attr(OUT, "nfreq") <- nfreq attr(OUT, "nfreq") <- nfreq
return(OUT) return(OUT)
......
#' MFFT reconstruction #' MFFT reconstruction
#' @importFrom stats deltat start #' @importFrom stats deltat start
#' @rdname mfft_deco #' @param M : discreteSpectrum object
#' @param M : mfft_deco object #' @param times: if supplied, times of the decomposition
#' @param sum : TRUE if user wants to sum components in the reconstruction #' @param start: if supplied, overrides time and will generate a time series with start and deltat, which must then
#' @export reconstruct_mfft #' be supplied as well
#' @param deltat : see start.
#' @param sum : TRUE if user wants to sum components %in% the reconstruction
#' @note if none if times, start and deltat are supplied, will reconstruct based on the attribute `xdata`
#' which must then be present. If no `xdata` is availble, return an error.
#' @return list of reconstructed components if sum=FALSE, full #' @return list of reconstructed components if sum=FALSE, full
#' reconstructed time series otherwise #' reconstructed time series otherwise
reconstruct_mfft <- function(M, sum=TRUE){ #' @method develop discreteSpectrum
if (!(attr(M,"class")=="mfft_deco")) stop ("object is not a MFFT decomposition") #' @export
develop.discreteSpectrum <- function(M, times=NULL, start=NULL, end=NULL, deltat=NULL, sum=TRUE){
if (!("discreteSpectrum" %in% class(M))) stop ("object is not a discreteSpectrum decomposition")
timesIsATseries = FALSE
if (!is.null(start)){
if (is.null(deltat) || is.null(end)) stop ("if you supply start, you must also supply deltat and end");
times <- start + seq((end - start) %/% deltat) * deltat
timesIsATseries = TRUE
}
if (is.null(times)){
if (is.null(attr(M,"data"))) stop ("if you do not supply any time argument (times, or (start, end, deltat)), then object must have a valid data attribute")
xdata <- attr(M,"data") xdata <- attr(M,"data")
start <- stats::start(xdata)
deltat <- stats::deltat(deltat)
times <- (seq(length(xdata))-1) * stats::deltat(xdata) + stats::start(xdata)[1]
timesIsATseries = TRUE
}
nfreq <- attr(M,"nfreq") nfreq <- attr(M,"nfreq")
times <- seq(length(xdata))*stats::deltat(xdata) + stats::start(xdata)[1] if (is.null(nfreq)) nfreq <- length(M$Amp)
reconstructed <- lapply(seq(nfreq), function(i) ts( M$Amp[i]*cos(M$Freq[i]*times + M$Phase[i]), start=stats::start(xdata), deltat=stats::deltat(xdata)) ) if (timesIsATseries){
reconstructed <- lapply(seq(nfreq), function(i) ts( M$Amp[i] * cos(M$Freq[i] * times + M$Phase[i]), start=start, deltat=deltat) )}
else {
reconstructed <- lapply(seq(nfreq), function(i) M$Amp[i] * cos(M$Freq[i] * times + M$Phase[i]))
}
if ( sum ) reconstructed <- ts(apply(simplify2array(reconstructed), 1 , sum), start=stats::start(xdata), deltat=stats::deltat(xdata)) if ( sum ) reconstructed <- ts(apply(simplify2array(reconstructed), 1 , sum), start=stats::start(xdata), deltat=stats::deltat(xdata))
return(reconstructed)
} }
#' MFFT ANOVA #' MFFT ANOVA
#' not ready. do not use. #' not ready. do not use.
#' @rdname mfft_deco #' @rdname discreteSpectrum
#' @export mfft_anova #' @export mfft_anova
mfft_anova <- function(M){ mfft_anova <- function(M){
if (!(attr(M,"class")=="mfft_deco")) stop ("object is not a MFFT decomposition") if (!("discreteSpectrum" %in% class(M))) stop ("object is not a discreteSpectrum decomposition")
xdata <- attr(M,"xdata") xdata <- attr(M,"xdata")
nfreq <- attr(M,"nfreq") nfreq <- attr(M,"nfreq")
N <- length(xdata) N <- length(xdata)
...@@ -37,17 +64,17 @@ mfft_anova <- function(M){ ...@@ -37,17 +64,17 @@ mfft_anova <- function(M){
} }
#' @rdname mfft_deco #' @rdname discreteSpectrum
#' @export #' @export
as.data.frame.mfft_deco <- function(x) {data.frame(Freq=x$Freq, Amp=x$Amp, Phases=x$Phases)} as.data.frame.discreteSpectrum <- function(x) {data.frame(Freq=x$Freq, Amp=x$Amp, Phases=x$Phases)}
#' @rdname mfft_deco #' @rdname discreteSpectrum
#' @param a `mfft_deco` object, typically the output of a `mfft` call. #' @param a `discreteSpectrum` object, typically the output of a `mfft` call.
#' @param labels to be set above the frequency peaks. Can be the output of `attributeTone` #' @param labels to be set above the frequency peaks. Can be the output of `attributeTone`
#' @param periods if TRUE will add a lower axis with period labels #' @param periods if TRUE will add a lower axis with period labels
#' @export #' @export
plot.mfft_deco <- function (M,periods=FALSE,labels=NULL,...){ plot.discreteSpectrum <- function (M,periods=FALSE,labels=NULL,...){
# O <- order(M$Freq) # O <- order(M$Freq)
plot(abs(M$Freq), abs(M$Amp),'h',ylab="Amplitudes", xlab="", ...) plot(abs(M$Freq), abs(M$Amp),'h',ylab="Amplitudes", xlab="", ...)
if (periods) { if (periods) {
...@@ -60,25 +87,25 @@ plot.mfft_deco <- function (M,periods=FALSE,labels=NULL,...){ ...@@ -60,25 +87,25 @@ plot.mfft_deco <- function (M,periods=FALSE,labels=NULL,...){
} else { } else {
mtext("Rate", 1, 3) mtext("Rate", 1, 3)
} }
points(abs(M$Freq), abs(M$Amp),'p',...) # points(abs(M$Freq), abs(M$Amp),'p',...)
if (!is.null(labels)) { if (!is.null(labels)) {
yshift <- 0.05*diff(range(M$Amp)) yshift <- 0.05*diff(range(M$Amp))
text(M$Freq, M$Amp, labels, srt=90, , adj=-0.4) text(M$Freq, M$Amp, labels, srt=90, , adj=-0.4)
} }
} }
#' @rdname mfft_deco #' @rdname discreteSpectrum
#' @export #' @export
lines.mfft_deco <- function (M,...){ lines.discreteSpectrum <- function (M,...){
# O <- order(M$Freq) # O <- order(M$Freq)
lines(abs(M$Freq), abs(M$Amp),'h',...) lines(abs(M$Freq), abs(M$Amp),'h',...)
points(abs(M$Freq), abs(M$Amp),'p',...) points(abs(M$Freq), abs(M$Amp),'p',...)
} }
#' @rdname mfft_deco #' @rdname discreteSpectrum
#' @export #' @export
print.mfft_deco <- function (M,...){ print.discreteSpectrum <- function (M,...){
print.data.frame(cbind(as.data.frame(M), Period=2*pi/M$Freq)) print.data.frame(cbind(as.data.frame(M), Period=2*pi/M$Freq))
} }
......
...@@ -10,12 +10,10 @@ harmonic_sample_spectrum <- list( ...@@ -10,12 +10,10 @@ harmonic_sample_spectrum <- list(
Freq = c(0.13423167, 0.119432, 0, 0.653167, 0.78913498), Freq = c(0.13423167, 0.119432, 0, 0.653167, 0.78913498),
Phases = c(0, 2.314, 0, 0.653167, 0)) Phases = c(0, 2.314, 0, 0.653167, 0))
attr(harmonic_sample_spectrum,"class") <- 'mfft_deco' class(harmonic_sample_spectrum) <- 'discreteSpectrum'
harmonic_sample_noisy$data <- harmonic_sample_data
harmonic_sample_noisy$spectrum <- harmonic_sample_spectrum
harmonic_sample_noisy <- harmonic_sample_spectrum
attr(harmonic_sample_noisy,"data") <- harmonic_sample_data
usethis::use_data(harmonic_sample_noisy, overwrite = TRUE) usethis::use_data(harmonic_sample_noisy, overwrite = TRUE)
...@@ -29,10 +27,9 @@ harmonic_sample_spectrum <- list( ...@@ -29,10 +27,9 @@ harmonic_sample_spectrum <- list(
Freq = c(0.13423167, 0.119432, 0, 0.653167, 0.78913498), Freq = c(0.13423167, 0.119432, 0, 0.653167, 0.78913498),
Phases = c(0, 2.314, 0, 0.653167, 0)) Phases = c(0, 2.314, 0, 0.653167, 0))
attr(harmonic_sample_spectrum,"class") <- 'mfft_deco' class(harmonic_sample_spectrum) <- 'discreteSpectrum'
harmonic_sample$data <- harmonic_sample_data
harmonic_sample$spectrum <- harmonic_sample_spectrum
harmonic_sample <- harmonic_sample_spectrum
attr(harmonic_sample,"data") <- harmonic_sample_data
usethis::use_data(harmonic_sample, overwrite = TRUE) usethis::use_data(harmonic_sample, overwrite = TRUE)
...@@ -13,10 +13,10 @@ pseudo_log_spectrum <- list( ...@@ -13,10 +13,10 @@ pseudo_log_spectrum <- list(
Phases = c(0, 2.314, 0, 0.653167, 0)) Phases = c(0, 2.314, 0, 0.653167, 0))
attr(pseudo_log_spectrum,"class") <- 'mfft_deco' class(pseudo_log_spectrum) <- 'discreteSpectrum'
pseudo_log$data <- pseudo_log_data pseudo_log_spectrum <- pseudo_log_spectrum
pseudo_log$spectrum <- pseudo_log_spectrum attr(pseudo_log,"data") <- pseudo_log_data
usethis::use_data(pseudo_log, overwrite = TRUE) usethis::use_data(pseudo_log, overwrite = TRUE)
Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
Aucun aperçu pour ce type de fichier
...@@ -10,6 +10,6 @@ data(harmonic_sample) ...@@ -10,6 +10,6 @@ data(harmonic_sample)
\description{ \description{
A simple time series for testing purposes A simple time series for testing purposes
cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498)
for t from 0 to 1023. It is coded as a `mfft_deco` objcet and self-describes its spectral decomposition. for t from 0 to 1023. It is coded as a `discreteSpectrum` objcet and self-describes its spectral decomposition.
} }
\keyword{datasets} \keyword{datasets}
...@@ -10,6 +10,6 @@ data(harmonic_sample_noisy) ...@@ -10,6 +10,6 @@ data(harmonic_sample_noisy)
\description{ \description{
Same has harmonic sample but with an added random time series Same has harmonic sample but with an added random time series
cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + rnorm(1024)*0.12 cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + rnorm(1024)*0.12
for t from 0 to 1023. It is coded as a `mfft_deco` objcet and self-describes its spectral decomposition. for t from 0 to 1023. It is coded as a `discreteSpectrum` objcet and self-describes its spectral decomposition.
} }
\keyword{datasets} \keyword{datasets}
...@@ -31,7 +31,7 @@ The computed frequencies are in the range given by minfreq and maxfreq.} ...@@ -31,7 +31,7 @@ The computed frequencies are in the range given by minfreq and maxfreq.}
not documented for real time series} not documented for real time series}
} }
\value{ \value{
a `mfft_deco` object, based on a data.frame with columns "Freq", "Ampl" and "Phases". a `discreteSpectrum` object, based on a data.frame with columns "Freq", "Ampl" and "Phases".
note that because of a language glitch (to be fixed), "Freq" actually means "Rate" note that because of a language glitch (to be fixed), "Freq" actually means "Rate"
} }
\description{ \description{
......
...@@ -25,7 +25,7 @@ the third algorithm should be in general much more precise). ...@@ -25,7 +25,7 @@ the third algorithm should be in general much more precise).
The computed frequencies are in the range given by minfreq and maxfreq.} The computed frequencies are in the range given by minfreq and maxfreq.}
} }
\value{ \value{
a `mfft_deco` object, based on a data.frame with columns "Freq", "Ampl" and "Phases". a `discreteSpectrum` object, based on a data.frame with columns "Freq", "Ampl" and "Phases".
note that because of a language glitch (to be fixed), "Freq" actually means "Rate" note that because of a language glitch (to be fixed), "Freq" actually means "Rate"
} }
\description{ \description{
......
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mfft_support.R
\name{reconstruct_mfft}
\alias{reconstruct_mfft}
\alias{mfft_anova}
\alias{as.data.frame.mfft_deco}
\alias{plot.mfft_deco}
\alias{lines.mfft_deco}
\alias{print.mfft_deco}
\title{MFFT reconstruction}
\usage{
reconstruct_mfft(M, sum = TRUE)
mfft_anova(M)
\method{as.data.frame}{mfft_deco}(x)
\method{plot}{mfft_deco}(M, periods = FALSE, labels = NULL, ...)
\method{lines}{mfft_deco}(M, ...)
\method{print}{mfft_deco}(M, ...)
}
\arguments{
\item{M}{: mfft_deco object}
\item{sum}{: TRUE if user wants to sum components in the reconstruction}
\item{periods}{if TRUE will add a lower axis with period labels}
\item{labels}{to be set above the frequency peaks. Can be the output of `attributeTone`}
\item{a}{`mfft_deco` object, typically the output of a `mfft` call.}
}
\value{
list of reconstructed components if sum=FALSE, full
reconstructed time series otherwise
}
\description{
MFFT reconstruction
MFFT ANOVA
not ready. do not use.
}
...@@ -29,7 +29,7 @@ note: this is not really faster because the bottleneck is actually the goden sec ...@@ -29,7 +29,7 @@ note: this is not really faster because the bottleneck is actually the goden sec
3: second order-correction using synthetic data (all documented in the Sidlichovsky and Nesvorny reference)} 3: second order-correction using synthetic data (all documented in the Sidlichovsky and Nesvorny reference)}
} }
\value{ \value{
a `mfft_deco` object, based on a data.frame with columns "Freq", "Ampl" and "Phases". a `discreteSpectrum` object, based on a data.frame with columns "Freq", "Ampl" and "Phases".
} }
\description{ \description{
R-coded version of the Modified Fourier Transform R-coded version of the Modified Fourier Transform
...@@ -43,8 +43,8 @@ A C-version should be supplied one day. ...@@ -43,8 +43,8 @@ A C-version should be supplied one day.
\examples{ \examples{
data(harmonic_sample) data(harmonic_sample)
spectrum <- mfft_real(harmonic_sample$data) spec <- mfft_real(harmonic_sample$data)
print(spectrum) print(spec)
} }
\references{ \references{
......
...@@ -10,6 +10,6 @@ data(pseudo_log) ...@@ -10,6 +10,6 @@ data(pseudo_log)
\description{ \description{
A truncated version (squared-shape) version of a harmonic signal for mimicking a sedimentary log A truncated version (squared-shape) version of a harmonic signal for mimicking a sedimentary log
sign( cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + 0.8)) sign( cos(t*0.13423167+0.00) + 1.3 * cos(t*0.119432+2.314) + 0.134994 + 0.4*cos(t*0.653167) + 0.11 * cos(t*0.78913498) + 0.8))
for t from 0 to 8191. It is coded as a `mfft_deco` objcet and self-describes its spectral decomposition. for t from 0 to 8191. It is coded as a `discreteSpectrum` objcet and self-describes its spectral decomposition.
} }
\keyword{datasets} \keyword{datasets}
...@@ -259,7 +259,7 @@ ...@@ -259,7 +259,7 @@
"[1] 0.000000 2.314000 0.000000 0.653167 0.000000\n", "[1] 0.000000 2.314000 0.000000 0.653167 0.000000\n",
"\n", "\n",
"attr(,\"class\")\n", "attr(,\"class\")\n",
"[1] \"mfft_deco\"\n" "[1] \"spectrum\"\n"
] ]
}, },
"metadata": {}, "metadata": {},
...@@ -3832,7 +3832,7 @@ ...@@ -3832,7 +3832,7 @@
"[1] -5.4832704 0.4030191 -1.6431082 2.3957822 -1.1782940 0.0000000\n", "[1] -5.4832704 0.4030191 -1.6431082 2.3957822 -1.1782940 0.0000000\n",
"\n", "\n",
"attr(,\"class\")\n", "attr(,\"class\")\n",
"[1] \"mfft_deco\"\n", "[1] \"spectrum\"\n",
"attr(,\"row.names\")\n", "attr(,\"row.names\")\n",
"[1] 1 2 3 4 5 6\n", "[1] 1 2 3 4 5 6\n",
"attr(,\"nfreq\")\n", "attr(,\"nfreq\")\n",
...@@ -4269,7 +4269,7 @@ ...@@ -4269,7 +4269,7 @@
"[1] -0.6804843 -1.4340620 -2.6011862 0.2136524 0.0000000 -5.6976628 0.5740075\n", "[1] -0.6804843 -1.4340620 -2.6011862 0.2136524 0.0000000 -5.6976628 0.5740075\n",
"\n", "\n",
"attr(,\"class\")\n", "attr(,\"class\")\n",
"[1] \"mfft_deco\"\n", "[1] \"spectrum\"\n",
"attr(,\"row.names\")\n", "attr(,\"row.names\")\n",
"[1] 1 2 3 4 5 6 7\n", "[1] 1 2 3 4 5 6 7\n",
"attr(,\"nfreq\")\n", "attr(,\"nfreq\")\n",
...@@ -4481,7 +4481,7 @@ ...@@ -4481,7 +4481,7 @@
"[1] 0.0000000 -1.6515515 -1.5786453 -1.4144484 2.8983504 -0.8902084\n", "[1] 0.0000000 -1.6515515 -1.5786453 -1.4144484 2.8983504 -0.8902084\n",
"\n", "\n",
"attr(,\"class\")\n", "attr(,\"class\")\n",
"[1] \"mfft_deco\"\n", "[1] \"spectrum\"\n",
"attr(,\"row.names\")\n", "attr(,\"row.names\")\n",
"[1] 1 2 3 4 5 6\n", "[1] 1 2 3 4 5 6\n",
"attr(,\"nfreq\")\n", "attr(,\"nfreq\")\n",
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter