eptdecomp: Decomposition of a signal by Ensemble Patch Transform

Description Usage Arguments Details Value See Also Examples

View source: R/EPT1d.R

Description

This function decomposes a signal into frequency component and residue of ensemble patch transform by sifting process.

Usage

1
2
3
4
eptdecomp(tindex = NULL, signal, type = "rectangle", tau, 
    process = c("average", "average"), pquantile = c(0, 1), equantile = c(0, 1), 
    gamma = 1, boundary = "symmetric", stoprule = "type1", 
    tol = sd(signal, na.rm = TRUE) * 0.1^2, maxiter = 10, check = FALSE) 

Arguments

tindex

time index at which a signal is observed. When it is NULL, the signal is supposed to be equally spaced.

signal

a set of data or a signal observed at time tindex.

type

patch type of "rectangle" or "oval".

tau

a size parameter for ensemble patch transform.

process

specifies transform types for patch and ensemble processes: process[1] for patch process and process[2] for ensemble process. Each process has options of "average", "median", or "envelope". Note that when process[1] is "average" or "median", process[2] must be "average" or "median". When process[1] is "envelope", lower and upper envelopes are obtained by \code{pquantile[1]} \times 100 \%-quantile and \code{pquantile[2]} \times 100 \%-quantile of patches, respectively. When process[2] is "envelope", ensemble lower and upper envelopes are obtained as \code{equantile[1]} \times 100 \%-quantile and \code{equantile[2]} \times 100 \%-quantile of lower and upper envelopes of shifted patches, respectively.

pquantile

quantiles for lower and upper envelopes of patch transform. When it is c(0, 1), minimum and maximum of a patch are used for lower and upper envelopes, respectively.

equantile

quantiles for lower and upper envelopes of ensemble patch transform.

gamma

controls the amount of envelope magnitude.

boundary

specifies boundary condition from "symmetric", "periodic" or "none".

stoprule

stopping rule of sifting. The type1 stopping rule indicates that absolute values of ept (ensemble patch transform) component must be less than the user-specified tolerance level. The type2 is the stopping rule that the difference between ept components at the current and previous iterative steps must be less than the user-specified tolerance level.

tol

tolerance for stopping rule of sifting.

maxiter

the maximum number of sifting.

check

specifies whether the sifting process is displayed. When check = TRUE, ept component and residue for each sifting step are displayed. If check=TRUE, click the plotting area to start the next step.

Details

This function decomposes a signal into frequency component and residue of ensemble patch transform by sifting process for a size parameter.

Value

eptcomp

matrix of ept (ensemble patch transform) component at each sifting step.

FC

frequency component of ensemble patch transform by sifting process.

residue

residue of ensemble patch transform by sifting process.

parameters

a list of input parameters of type, tau, process, pquantile, equantile, gamma, boundary, and output parameter niter, the number of sifting.

See Also

eptransf, meptransf.

Examples

 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
#### example : composite of two components having different frequencies
ndata <- 1000 
tindex <- seq(0, 1, length=ndata)
comp1 <- cos(90*pi*tindex)
comp2 <- cos(10*pi*tindex)
f <- comp1 + comp2 

op <- par(mfrow=c(3,1), mar=c(2,2,2,1))
plot(tindex, f, main="a signal", xlab="", ylab="", type='l')
abline(h=0, lty=3)
plot(tindex, comp1, main="high-frequency component", xlab="", ylab="", type='l')
abline(h=0, lty=3)
plot(tindex, comp2, main="low-frequency component", xlab="", ylab="", type='l')
abline(h=0, lty=3)

#### Decomposition by Ensemble Patch Transform  
outdecom <- eptdecomp(signal=f, tau=21, process=c("envelope", "average"), pquantile=c(0, 1))

#### Decomposition result
plot(tindex, f, main="a signal", xlab="", ylab="", type='l'); abline(h=0, lty=3)
plot(outdecom$FC, type='l', main="", xlab="", ylab=""); abline(h=0, lty=3)
title(paste0("high-frequency component, tau=", 21))
lines(comp1, col="red", lty=2, lwd=0.5)
plot(outdecom$residue, type="l", main="", xlab="", ylab=""); abline(h=0, lty=3)
title(paste0("low-frequency component, tau=", 21))
lines(comp2, col="red", lty=2, lwd=0.5)
par(op)

EPT documentation built on Jan. 5, 2022, 9:06 a.m.

Related to eptdecomp in EPT...