Movatterモバイル変換


[0]ホーム

URL:


Type:Package
Title:Continuous Wavelet Transformation for Spectroscopy
Version:0.2.1
Maintainer:J. Antonio Guzmán Q. <antguz06@gmail.com>
Description:Fast application of Continuous Wavelet Transformation ('CWT') on time series with special attention to spectroscopy. It is written using data.table and 'C++' language and in some functions it is possible to use parallel processing to speed-up the computation over samples. Currently, only the second derivative of a Gaussian wavelet function is implemented.
License:GPL (≥ 3)
URL:https://github.com/Antguz/CWT
BugReports:https://github.com/Antguz/CWT/issues
Depends:R (≥ 4.0.0)
Imports:data.table (≥ 1.14.0), Rcpp
Suggests:testthat (≥ 3.2.0)
LinkingTo:Rcpp, RcppArmadillo
ByteCompile:true
Config/testthat/edition:3
Encoding:UTF-8
Language:en-US
RoxygenNote:7.3.1
SystemRequirements:GNU make
NeedsCompilation:yes
Packaged:2024-06-28 01:17:03 UTC; antonio
Author:J. Antonio Guzmán Q.ORCID iD [cre, aut, cph]
Repository:CRAN
Date/Publication:2024-06-28 03:50:02 UTC

Continuous Wavelet Transformation for Spectroscopy

Description

Fast application of Continuous Wavelet Transformation on timeseries with special attention to spectroscopy. It is written using'data.table' and 'C++' language and in some functions it is possible touse parallel processing to speed-up the computation over samples.

Author(s)

Maintainer: J. Antonio Guzmán Q.antguz06@gmail.com (ORCID) [copyright holder]

See Also

Useful links:


Continuous Wavelet Transform

Description

Compute a 1D continuous wavelet transformation using 2st orderderivative Gaussian wavelet.

Usage

cwt(t, scales, variance = 1, summed_wavelet = FALSE, threads = 1L)

Arguments

t

Adata.table,matrix, ornumeric vector wherecolumns or values represent time (i.e., bands) and rows samples (i.e., pixels).Remember the transformation assume that columns or values are evenly spacedthough time (i.e., bands at equal to sampling interval).

scales

A positivenumeric vector describing the scales tocompute. The minimum scale (i.e., scales = 1) is equal to sampling intervalbetween columns.

variance

A positivenumerber describing the variance of theGaussian PDF used to scale. Defaultvariance = 1.

summed_wavelet

IfTRUE, it returns the sum of scales.IfFALSE, each scale is returned.

threads

Aninteger specifying the number of threads to use.Experiment to see what works best for your data on your hardware.

Value

Ifsummed_wavelet = TRUE, it returns adata.table wherecolumns are the sum of wavelet scales. Ifsummed_wavelet = FALSE, itreturns anarray (i.e., time, samples, and scales).

Author(s)

J. Antonio Guzmán Q.

Examples

time_series <- sin(seq(0, 20 * pi, length.out = 100))# Using a numeric vectorcwt(t = time_series,    scales = c(1, 2, 3, 4, 5),    summed_wavelet = FALSE)cwt(t = time_series,    scales = c(1, 2, 3, 4, 5),    summed_wavelet = TRUE)# Using a matrixtimes <- 100frame <- matrix(rep(time_series, times),                nrow = times,                byrow = TRUE)cwt(t = frame,    scales = c(1, 2, 3, 4, 5),    summed_wavelet = FALSE)cwt(t = frame,    scales = c(1, 2, 3, 4, 5),    summed_wavelet = TRUE)

Full Width Half Maximum Resampling

Description

It resample spectra data using Full Width Half Maximum (FWHM).

Usage

resampling_FWHM(spectra, wavelengths, new_wavelengths, FWHM, threads = 1L)

Arguments

spectra

Adata.table,data.frame, ormatrix wherecolumns represent bands and rows samples (i.e., pixels).

wavelengths

Anumeric vector describing the current positioningof the spectral bands withinspectra.

new_wavelengths

Anumeric vector describing positioning of thenew spectral bands to resample.

FWHM

Anumeric vector describing the Full Width Half Maximums ofthe new spectral bands. The length of this vector should be equal than the lengthofnew_wavelengths.

threads

Aninteger specifying the number of threads to use.Experiment to see what works best for your data on your hardware.

Value

It returns adata.table with the resampled spectra, where columnsare the new bands and rows are samples.

Author(s)

J. Antonio Guzmán Q.

Examples

mean <- 50sd1 <- 5sd2 <- 10n <- 100test <- matrix(c(dnorm(1:n, mean = mean, sd = sd1),               dnorm(1:n, mean = mean, sd = sd2)),               nrow = 2,               byrow = TRUE)current_bands <- 1:nnew_bands <- seq(10, 90, by = 5)FHWM <- rep(5, length(new_bands))resampling_FWHM(spectra = test,                wavelengths = current_bands,                new_wavelengths = new_bands,                FWHM = FHWM)

[8]ページ先頭

©2009-2025 Movatter.jp