eptransf: Ensemble Patch Transform of a Signal

Description Usage Arguments Details Value See Also Examples

View source: R/EPT1d.R

Description

This function performs ensemble patch transform of a signal for a size parameter.

Usage

1
2
3
eptransf(tindex = NULL, signal, type = "rectangle", tau,
    process = c("average", "average"), pquantile = c(0, 1), equantile = c(0, 1), 
    gamma = 1, boundary = "symmetric") 

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

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".

Details

This function performs ensemble patch transform of a signal for a size parameter tau, and produces statistics and envelopes for ensemble patch transform. When process[1] is "average" or "median", outputs related to envelopes are defined as NULL. When process[2] is "envelope", outputs, pstat and Epstat, are defined as NULL.

Value

tindex

time index at which a signal is observed.

signal

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

pstat

centrality of patch transform for size parameter tau.

Epstat

centrality of ensemble patch transform for size parameter tau.

psd

standard deviation of patch transform for size parameter tau.

Epsd

standard deviation of ensemble patch transform for size parameter tau.

pL

lower envelope of patch transform for size parameter tau.

pU

upper envelope of patch transform for size parameter tau.

pM

mean envelope, (pL + pU) / 2, of patch transform for size parameter tau.

pR

distance between lower and upper envelopes, (pU - pL), of patch transform for size parameter tau.

EpL

lower envelope of ensemble patch transform for size parameter tau.

EpU

upper envelope of ensemble patch transform for size parameter tau.

EpM

mean envelope, (EpL + EpU) / 2, of ensemble patch transform for size parameter tau.

EpR

distance between lower and upper envelopes, (EpU - EpL), of ensemble patch transform for size parameter tau.

parameters

a list of input parameters of type, tau, process, pquantile, equantile, gamma, and boundary.

nlevel

the number of size parameter tau. For eptransf() function, nlevel is 1.

See Also

meptransf, eptdecomp.

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# a doppler signal
n <- 256
tindex <- seq(0, 1, length=n)
j <- 5
f <- 10 * sqrt(tindex*(1-tindex)) * sin((2*pi*(1+2^((9-4*j)/5))) / (tindex+2^((9-4*j)/5)))
fnoise <- f + 0.4 * rnorm(n)
  
#### Ensemble statistics
op <- par(mfrow=c(5,3), mar=c(2,2,2,1))
layout(matrix(c(1, 1, 1, 2:13), 5, 3, byrow = TRUE))

plot(f, main="a doppler signal", xlab="", ylab="", type='l', ylim=range(fnoise))
points(fnoise); abline(h=0, lty=3)

#### Ensemble Patch Transform  
taus <- c(5, 10, 20)

out <- list()
for (i in 1:length(taus)) 
    out[[i]] <- eptransf(signal=fnoise, tau=taus[i], process=c("average", "average"))
    
for (i in 1:length(taus)) {
    plot(out[[i]]$Epstat, type="l", xlab="", ylab="",
        main=paste0("ensemble average of patch mean, tau=", taus[i]))
    abline(h=0, lty=3)   
}

for (i in 1:length(taus)) 
    plot(out[[i]]$Epsd, type='l', xlab="", ylab="", 
         main=paste0("ensemble average of standard deviation, tau=", taus[i]))  

out2 <- list()
for (i in 1:length(taus)) 
    out2[[i]] <- eptransf(signal=fnoise, tau=taus[i], process=c("envelope", "average"))
    
for (i in 1:length(taus)) {
    plot(out2[[i]]$EpM, type="l", col="red", xlab="", ylab="", 
         ylim=range(c(out2[[i]]$EpU,out2[[i]]$EpL)),
         main=paste0("ensemble average of mean envelope, tau=", taus[i]))
    points(fnoise, cex=0.1)
    abline(h=0, lty=3); lines(out2[[i]]$EpU); lines(out2[[i]]$EpL)    
}

for (i in 1:length(taus))
    plot(out2[[i]]$EpR, type='l', xlab="", ylab="",
         main=paste0("ensemble average of envelope distance, tau=", taus[i]))
         
par(op)

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

Related to eptransf in EPT...