找回密码
 注册
查看: 626|回复: 0

R语言 wavethresh包 wd()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-10-1 20:17:41 | 显示全部楼层 |阅读模式
wd(wavethresh)
wd()所属R语言包:wavethresh

                                        Wavelet transform (decomposition).
                                         小波变换(分解)。

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This function can perform two types of discrete wavelet transform (DWT). The standard DWT computes the DWT according to Mallat's pyramidal algorithm (Mallat, 1989) (it also has the ability to compute the wavelets on the interval transform of Cohen, Daubechies and Vial, 1993).
此功能可以执行离散小波变换(DWT)的两种类型的。标准载重吨计算DWT的根据Mallat的锥体算法(Mallat的,1989年)(它也有能力上的时间间隔来计算小波变换的Cohen,Daubechies小波和样品瓶,1993)。

The non-decimated DWT (NDWT) contains all possible shifted versions of the DWT. The order of computation of the DWT is O(n), and it is O(n log n) for the NDWT if n is the number of data points.
非锐减载重吨(NDWT)的包含所有可能的移版本的DWT。的顺序计算的DWT是O(n)的,它是O(nlogn)为NDWT如果n是数据点的数目。


用法----------Usage----------


wd(data, filter.number=10, family="DaubLeAsymm", type="wavelet",
bc="periodic", verbose=FALSE, min.scale=0, precond=TRUE)



参数----------Arguments----------

参数:data
A vector containing the data you wish to decompose. The length of this vector must be a power of 2.
一个向量,包含你想分解的数据。此向量的长度必须是2的幂的。


参数:filter.number
This selects the smoothness of wavelet that you want to use in the decomposition. By default this is 10, the Daubechies least-asymmetric orthonormal compactly supported wavelet with 10 vanishing moments.  
选择要使用的分解小波的平滑度。默认情况下,这是10,至少不对称的Daubechies正交的紧支撑小波与10个消失矩。

For the “wavelets on the interval” (bc="interval") transform the filter number ranges from 1 to 8. See the table of filter coefficients indexed after the reference to Cohen, Daubechies and Vial, 1993.
对于“小波的时间间隔”(bc="interval")变换过滤器的数量范围从1到8。请参阅下表索引后科恩,1993年Daubechies小波和样品瓶,滤波器系数。


参数:family
specifies the family of wavelets that you want to use. Two popular options are "DaubExPhase" and "DaubLeAsymm" but see the help for filter.select for more possibilities.
指定要使用的小波家庭。两个流行的选择是“DaubExPhase”和“DaubLeAsymm的”,但的帮助filter.select更多的可能性。

This argument is ignored for the “wavelets on the interval” transform (bc="interval").
此参数将被忽略“小波”的时间间隔变换(bc="interval")。


参数:type
specifies the type of wavelet transform. This can be "wavelet" (default) in which case the standard DWT is performed (as in previous releases of WaveThresh). If type is "station" then the non-decimated DWT is performed. At present, only periodic boundary conditions can be used with the non-decimated wavelet transform.
指定类型的小波变换。这是“小波”(默认值),在这种情况下,执行标准DWT(在以前的版本中,WaveThresh)。如果类型是“站”,然后进行非抽取载重吨。目前,只有周期性的边界条件,可以用与非抽取小波变换。


参数:bc
specifies the boundary handling. If bc="periodic" the default, then the function you decompose is assumed to be periodic on it's interval of definition, if bc="symmetric" then the function beyond its boundaries is assumed to be a symmetric reflection of the function in the boundary. The symmetric option was the implicit default in releases prior to 2.2. If bc=="interval" then the “wavelets on the interval algorithm” due to Cohen, Daubechies and Vial is used. (The WaveThresh implementation of the “wavelets on the interval transform” was coded by Piotr Fryzlewicz, Department of Mathematics, Wroclaw University of Technology, Poland; this code was largely based on code written by Markus Monnerjahn, RHRK, Universitat Kaiserslautern; integration into WaveThresh by GPN. See the nice project report by Piotr on this piece of code).
指定的边界处理。如果bc="periodic"默认值,然后你分解的功能被认为是周期性的,它的定义的时间间隔,如果bc="symmetric"那么的功能超越它的界限,在边界假设是对称反射的功能, 。对称隐含的默认选项是2.2之前的版本中。如果bc=="interval"然后在“区间上的小波算法”由于科恩,Daubechies小波和样品瓶的使用。 (WaveThresh实施的“区间上的小波变换”编码由彼得·Fryzlewicz的技术,波兰的弗罗茨瓦夫大学,数学系,这主要基于代码编写的代码是由Markus Monnerjahn,RHRK的Universitat凯泽斯劳滕融入WaveThreshGPN。看到漂亮的彼得·这段代码的项目报告)。


参数:verbose
Controls the printing of "informative" messages whilst the computations progress. Such messages are generally annoying so it is turned off by default.
控制打印的“信息”的消息,而计算的进展。这样的消息一般都是讨厌的,所以它在默认情况下是关闭的。


参数:min.scale
Only used for the “wavelets on the interval transform”. The wavelet algorithm starts with fine scale data and iteratively coarsens it. This argument controls how many times this iterative procedure is applied by specifying at which scale level to stop decomposiing.
仅用于“区间上的小波变换”。小波算法开始时,细规模的数据和反复粗化。此参数控制多少次迭代过程由指定停止的规模水平decomposiing的应用。


参数:precond
Only used for the “wavelets on the interval transform”. This argument specifies whether preconditioning is applied (called prefiltering in Cohen, Daubechies and Vial, 1993.) Preconditioning ensures that sequences like 1,1,1,1 or 1,2,3,4 map to zero high pass coefficients.
仅用于“区间上的小波变换”。此参数指定是否预处理(称为预过滤,在Cohen,Daubechies小波和样品瓶,1993年)。预处理确保序列,如1,1,1,1或1,2,3,4图零点高通系数。


Details

详细信息----------Details----------

If type=="wavelet" then the code implements Mallat's pyramid algorithm (Mallat 1989). For more details of this implementation see Nason and Silverman, 1994. Essentially it works like this: you start off with some data cm, which is a real vector of length 2^m, say.
如果type ==“小波”的代码实现Mallat的金字塔算法(Mallat的1989年)。这种实现的详细信息,请参阅利晨和Silverman,1994年。本质上,它的工作原理是这样的:你开始用一些数据厘米的长度2^m,说这是一个真正的矢量。

Then from this you obtain two vectors of length 2^(m-1). One of these is a set of smoothed data, c(m-1), say. This looks like a smoothed version of cm. The other is a vector, d(m-1), say. This corresponds to the detail removed in smoothing cm to c(m-1). More precisely, they are the coefficients of the wavelet expansion corresponding to the highest resolution wavelets in the expansion. Similarly, c(m-2) and d(m-2) are obtained from c(m-1), etc. until you reach c0 and d0.
然后从你获得的两个向量的长度2^(m-1)。角第(m-1),其中之一是平滑后的数据的一组说。这看起来像一个平滑的厘米。另一种是一个向量,D(m-1的),说。这对应于平滑厘米到c(米-1)中除去细节。更确切地说,它们是对应于在膨胀的最高分辨率小波的小波展开系数。同样角第(m-2)和d(米2),得到从c第(m-1),等等,直到到达C0和D0。

All levels of smoothed data are stacked into a single vector for memory efficiency and ease of transport across the SPlus-C interface.
各级平滑后的数据堆积成一个向量记忆效率和便于运输业务的S-PLUS-C接口。

The smoothing is performed directly by convolution with the wavelet filter (filter.select(n)$H, essentially low- pass filtering), and then dyadic decimation (selecting every other datum, see Vaidyanathan (1990)). The detail extraction is performed by the mirror filter of H, which we call G and is a bandpass filter. G and H are also known quadrature mirror filters.
平滑直接执行卷积的小波滤波器(filter.select(n)$H,基本上是低通滤波处理),然后二进抽取(选择每个其他基准面,见Vaidyanathan的(1990))。细节提取执行由所述反射镜滤波器的H,这是我们称G是一个带通滤波器。 G和H也被称为正交镜像滤波器。

There are now two methods of handling "boundary problems". If you know that your function is periodic (on it's interval) then use the bc="periodic" option, if you think that the function is symmetric reflection about each boundary then use bc="symmetric". You might also consider using the "wavelets on the interval" transform which is suitable for data arising from a function that is known to be defined on some compact interval, see Cohen, Daubechies, and Vial, 1993. If you don't know then it is wise to experiment with both methods, in any case, if you don't have very much data don't infer too much about your decomposition! If you have loads of data then don't infer too much about the boundaries. It can be easier to interpret the wavelet coefficients from a bc="periodic" decomposition, so that is now the default. Numerical Recipes implements some of the wavelets code, in particular we have compared our code to "wt1" and "daub4" on page 595. We are pleased to announce that our code gives the same answers! The only difference that you might notice is that one of the coefficients, at the beginning or end of the decomposition, always appears in the "wrong" place. This is not so, when you assume periodic boundaries you can imagine the function defined on a circle and you can basically place the coefficient at the beginning or the end (because there is no beginning or end, as it were).
现在有两种方法处理“边界问题”。如果你知道你的函数是周期性的间隔,然后使用bc =“定期”选项,如果你认为每个边界,然后使用bc =“对称”的功能是对称的反射。你也可以考虑使用“小波变换间隔”,这是适用于数据所产生的一个功能,是已知的一些紧凑的时间间隔被定义,请参见科恩,Daubechies小波,和样品瓶,1993年。如果你不知道,那么明智的做法是用两种方法进行试验,在任何情况下,如果没有非常多的数据,推断出太多的分解!如果你有大量的数据,那么就无法推断出太多的界限。它可以更容易解释从BC =“定期”分解的小波系数,所以,现在是默认的。数值方法实现的小波代码,尤其是我们比较我们的代码以“WT1”的第595页的“daub4”。我们很高兴地宣布,我们的代码给出了相同的答案!唯一的区别,你可能会注意到的系数,在开头或结尾的分解,总是出现在“错误”的地方。这是不是这样,当你承担周期性边界,你能想象一个圆上定义的函数,你基本上可以将系数在开始或结束(因为是无始无终,因为它是)。

The non-deciated DWT contains all circular shifts of the standard DWT. Naively imagine that you do the standard DWT on some data using the Haar wavelets. Coefficients 1 and 2 are added and difference, and also coefficients 3 and 4; 5 and 6 etc. If there is a discontinuity between 1 and 2 then you will pick it up within the transform. If it is between 2 and 3 you will loose it. So it would be nice to do the standard DWT using 2 and 3; 4 and 5 etc. In other words, pick up the data and rotate it by one position and you get another transform. You can do this in one transform that also does more shifts at lower resolution levels. There are a number of points to note about this transform.
的的非deciated DWT包含所有圆形的标准DWT的变化。天真的想象,你做标准DWT使用Haar小波的一些数据。系数1和2中加入和区别,同时系数3和4,5和6等,如果有一个在1和2之间的不连续性,则您将它捡起内变换。如果是在2和3之间,你将失去它。因此,这将是很好做标准DWT,2,3,4和5等换句话说,拿起数据,并将其旋转一个位置,你会得到另一个转变。为此,您可以在一个转换,也没有更多的变化在分辨率较低的水平。有一些需要注意的事项有关此转换。

Note that a time-ordered non-decimated wavelet transform object may be converted into a packet-ordered non-decimated wavelet transform object (and vice versa) by using the convert function.
需要注意的是一个时间排序的非抽取小波变换对象可以被转换成一个packet-ordered non-decimated wavelet transform对象(反之亦然)使用convert功能,。

The NDWT is translation equivariant. The DWT is neither translation invariant or equivariant. The standard DWT is orthogonal, the non-decimated transform is most definitely not. This has the added disadvantage that non-decimated wavelet coefficients, even if you supply independent normal noise. This is unlike the standard DWT where the coefficients are independent (normal noise).
NDWT是翻译等变。 DWT既不是翻译不变或等变。标准DWT是正交,非元气大伤的变换是最绝对不是。这是额外的缺点,非抽取小波系数的,即使你提供独立的正态噪声。这是一个不同于标准的DWT系数是独立的(正常的噪音)。

You might like to consider growing wavelet syntheses using the wavegrow function.
您可能要考虑的小波合成wavegrow使用函数。


值----------Value----------

An object of class wd.
对象的类wd。

For boundary conditions apart from bc="interval" this object is a list with the following components.
对于边界条件除了bc="interval"这个对象是有以下组件的列表。

<table summary="R valueblock"> <tr valign="top"><td>C</td> <td> Vector of sets of successively smoothed data. The pyramid structure of Mallat is stacked so that it fits into a vector. The function accessC should be used to extract a set for a particular level.</td></tr> <tr valign="top"><td>D</td> <td> Vector of sets of wavelet coefficients at different resolution levels. Again, Mallat's pyramid structure is stacked into a vector. The function accessD should be used to extract the coefficients for a particular resolution level.</td></tr>  <tr valign="top"><td>nlevels</td> <td> The number of resolution levels. This depends on the length of the data vector. If length(data)=2^m, then there will be m resolution levels. This means there will be m levels of wavelet coefficients (indexed 0,1,2,...,(m-1)), and m+1 levels of smoothed data (indexed 0,1,2,...,m). </td></tr> <tr valign="top"><td>fl.dbase</td> <td> There is more information stored in the C and D than is described above. In the decomposition &ldquo;extra&rdquo; coefficients are generated that help take care of the boundary effects, this database lists where these start and finish, so the "true" data can be extracted.</td></tr> <tr valign="top"><td>filter</td> <td> A list containing information about the filter type: Contains the string "wavelet" or "station" depending on which type of transform was performed. </td></tr> <tr valign="top"><td>date</td> <td> The date the transform was performed.</td></tr> <tr valign="top"><td>bc</td> <td> How the boundaries were handled.</td></tr>
<table summary="R valueblock"> <tr valign="top"> <TD>C</ TD> <TD>向量的连续平滑的数据集。金字塔结构的Mallat被堆积成一个向量,使其适合。的功能accessC应提取一组特定的水平。</ TD> </ TR> <tr valign="top"> <TD>D</ TD> <TD>组在不同的分辨率水平的小波系数矢量。同样,Mallat的金字塔结构的层叠成一个向量。的功能accessD应该被用来提取一个特定的分辨率级别的系数。</ TD> </ TR> <tr valign="top"> <TD>nlevels </ TD> <TD >,分辨率级别的数目。这取决于对数据向量的长度。如果length(data)=2^m,然后有米分辨率的水平。这意味着会有米水平的小波系数(索引为0,1,2,...,第(m-1)),和m +1个水平的平滑化数据(索引0,1,2,...,米)。 </ TD> </ TR> <tr valign="top"> <TD> fl.dbase</ TD> <TD>有更多的信息存储在C和D比上述。在分解的“额外”系数的产生,帮助照顾的边界效应,这个数据库列出了这些起点和终点,这样的“真实”的数据可以被提取出来。</ TD> </ TR> <TR VALIGN = “顶”> <TD> filter </ TD> <td>一个列表,其中包含的过滤器类型的信息:包含字符串“小波”或“站”根据哪种类型的变换进行。 </ TD> </ TR> <tr valign="top"> <TD>date </ TD> <TD>的日期转换。</ TD> </ TR> <TR VALIGN = “顶”> <TD> bc </ TD> <TD>的界限如何处理。</ TD> </ TR>

</table> If the &ldquo;wavelets on the interval&rdquo; transform is used (i.e. bc="interval") then the internal structure of the wd object is changed as follows.
</表>如果“的时间间隔上的小波变换用于(即bc="interval")然后在wd对象的内部结构的改变如下。




The coefficient vectors C and D have been replaced by a single vector transformed.vector. The new single vector contains just the transformed coefficients: i.e. the wavelet coefficients down to a particular scale (determined by min.scale above). The scaling function coefficients are stored first in the array (there will be 2^min.scale of them. Then the wavelet coefficients are stored as consecutive vectors coarsest to finest of length 2^min.scale, 2^(min.scale+1) up to a vector which is half of the length of the original data.)
已被替换成一个单一的向量transformed.vector系数向量C和D。只包含新的单矢量变换后的系数:即小波系数下降到一个特定的范围内(由min.scale以上)。尺度函数的系数存储阵列中的第一(2^min.scale他们的小波系数被存储为连续向量粗的长度2^min.scale,2^(min.scale+1)到一个最好的向量中的原始数据的长度的一半。)

In any case the user is recommended to use the functions accessC, accessD, putC and putD to access coefficients from the wd object.
在任何情况下,建议用户使用的功能accessC,accessD,putC和putD访问系数wd对象。




The extra component current.scale records to which level the transform has been done (usually this is min.scale as specified in the arguments).
额外的组件current.scale记录到哪个级别的转换已经完成(通常是min.scale中指定的参数)。

The extra component filters.used is a vector of integers that record which filter index was used as each level of the decomposition. At coarser scales sometimes a wavelet with shorter support is needed.  
额外的组件filters.used是一个向量整数记录,过滤器指数作为每个级别的分解。小波在粗糙的尺度,有时一个较短的支持是必要的。

The extra logical component preconditioned specifies whether preconditioning was turned on or off.
额外的逻辑组件preconditioned指定是否预处理开启或关闭。

The component fl.dbase is still present but only contains data corresponding to the storage of the coefficients that are present in transformed.vector. In particular, since only one scale of the father wavelet coefficients is stored the component first.last.c of fl.dbase is now a three-vector containing the indices of the first and last entries of the father wavelet coefficients and the offset of where they are stored in transformed.vector. Likewise, the component first.last.d of fl.dbase is still a matrix but there are now only rows for each scale level in the transformed.vector (something like nlevels(wd)-wd$current.scale).  
组件fl.dbase是仍然存在,但只包含相对应的数据的存储的系数是本在transformed.vector。特别地,由于只有一个规模的父亲的小波系数存储组件first.last.cfl.dbase现在是一个三向量含有的父亲的小波系数的第一个和最后一个的条目的索引和偏移他们身在何处存储在transformed.vector。同样,组件first.last.dfl.dbase仍然是一个矩阵,但现在只有行每级的transformed.vector(类似的东西nlevels(wd)-wd$current.scale)。

The filter coefficient is also slightly different as the filter coefficients are no longer stored here (since they are hard coded into the wavelets on the interval transform.)  </ul>
滤波器系数不再存储在这里(因为它们被硬编码到的间隔变换的小波filter系数也略有不同。)</ ul>


RELEASE----------RELEASE----------

Version 3.5.3 Copyright Guy Nason 1994 Integration of &ldquo;wavelets on the interval&rdquo; code by Piotr Fryzlewicz and Markus Monnerjahn was at Version 3.9.6, 1999.
1999年的版本为3.9.6,版本3.5.3版权所有盖利晨1994年整合“间隔”代码由彼得·Fryzlewicz的和Markus Monnerjahn小波。


(作者)----------Author(s)----------


G P Nason



参见----------See Also----------

wd.int, wr, wr.int, wr.wd, accessC, accessD, putD, putC, filter.select, plot.wd, threshold, wavegrow
wd.int,wr,wr.int,wr.wd,accessC,accessD,putD,putC,filter.select,plot.wd,threshold,wavegrow


实例----------Examples----------


#[]
# Generate some test data[生成一些测试数据。]
#[]
test.data <- example.1()$y
## Not run: ts.plot(test.data)[#不运行:ts.plot(test.data)]
#[]
# Decompose test.data and plot the wavelet coefficients[分解test.data和绘制的小波系数]
#[]
wds <- wd(test.data)
## Not run: plot(wds)[#未运行图(WDS)]
#[]
# Now do the time-ordered non-decimated wavelet transform of the same thing[现在做的时间顺序的非抽取小波变换,同样的事情]
#[]
wdS <- wd(test.data, type="station")
## Not run: plot(wdS)[#未运行图(WDS)]
#[]
# Next examples[下面的例子]
# ------------[------------]
# The chirp signal is also another good examples to use.[线性调频信号是另一个很好的例子使用。]
#[]
# Generate some test data[生成一些测试数据。]
#[]
test.chirp <- simchirp()$y
## Not run: ts.plot(test.chirp, main="Simulated chirp signal")[#不运行:ts.plot(test.chirp,主要=“模拟线性调频信号”)]
#[]
# Now let's do the time-ordered non-decimated wavelet transform.[现在,让我们做的时间排序的非抽取小波变换。]
# For a change let's use Daubechies least-asymmetric phase wavelet with 8[对于改变我们的使用Daubechies小,至少不对称相小波的8]
# vanishing moments (a totally arbitrary choice, please don't read[消失矩(完全任意选择,请不要阅读]
# anything into it).[任何东西进去)。]
#[]
chirpwdS <- wd(test.chirp, filter.number=8, family="DaubLeAsymm", type="station")
## Not run: plot(chirpwdS, main="TOND WT of Chirp signal")[#不运行:的图(chirpwdS,主要=“TOND的线性调频信号的WT”)]
#[]
# Note that the coefficients in this plot are exactly the same as those[请注意,在此积的系数是完全相同的那些相同]
# generated by the packet-ordered non-decimated wavelet transform[所产生的分组有序的非抽取小波变换]
# except that they are in a different order on each resolution level.[但,他们以不同的顺序在每个分辨率级别。]
# See Nason, Sapatinas and Sawczenko, 1998[见利晨,Sapatinas和Sawczenko的,1998年]
# for further information.[进一步的信息。]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-25 11:38 , Processed in 0.034582 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表