The CWT is defined by a complex correlation of a scaled and time-shifted mother wavelet with a function $f(x)$. Let $psi(x)$ be a real- or complex-valued function representing a mother wavelet, i.e. a function which meets the standard mathematical criteria for a wavelet and one that can be used to generate all other wavelets within the same family. Let $Conj{psi(w)}$ be the complex conjugate of $psi(w)$. The CWT of $f(x)$ is defined as
$$ W_f(a,b) \equiv \frac{1}{\sqrt{a}} \int_{-\infty}^\infty f(x) \psi^* \Bigl(\frac{x-b}{a} \Bigr) \; dx, $$ for $(a,b) in R$ and $a > 0$, where $a$ is the scale of the wavelet and $b$ is the shift of the wavelet in time. It can be shown that the above complex correlation maintains a duality with the Fourier transform defined by the relation
$$ W_f(a,b) \equiv \frac{1}{\sqrt{a}} \int_{-\infty}^\infty f(x) \psi^* \Bigl(\frac{x-b}{a} \Bigr) \; dx \longleftrightarrow \sqrt{a} \, F(\omega) \,\Psi^*(a\omega) $$
where $F()$ is the Fourier transform of $f(x)$ and $w$ is the frequency in radians. This function calculates the CWT in the Fourier domain followed by an inverse Fourier transform.
wavCWT(x, scale.range=deltat(x) * c(1, length(x)), n.scale=100, wavelet="gaussian2", shift=5, variance=1)rts, ts, cts, or signalSeries, or be a numeric
vector.scale.range. Default: 100.deltat(x) * c(1, length(x)).5."gaussian1" or
"gaussian2" then this parameter
represents the variance of the Gaussian PDF used to
scale the corresponding filters. Default: 1."gaussian2".wavCWT.
TRUE, the phase of the CWT is plotted. Default: FALSE."time"."log2(units)" where units are the units of the time
series if available. If units are not available, "log2(scale)" is used.power.stretch=0, then image is
transformed with log(abs(x)+1). Otherwise, the image is
transformed with (abs(x))$^$power.stretch. Default: 0.5."image" and
"persp" which plot the CWT as an image or as a meshed perspective plot, respectively. The perspective
plot resamples the data to contain a maximum of grid.size rows and columns.NULL (no zoom).100.TRUE, a new plot is forced with the frame() command.wavCWTFilters.## calculate the CWT of the sunspots series using
## a Mexican hat wavelet (gaussian2)
sunspots.cwt <- wavCWT(sunspots)
## print the result
print(sunspots.cwt)
## plot an image of the modulus of the CWT and the
## time series
plot(sunspots.cwt, series=TRUE)
## plot a coarse-scale wire-frame perspective of
## the CWT
plot(sunspots.cwt, type="persp")
Run the code above in your browser using DataLab