![]() |
matlab和R语言小波变换结果怎么不一样?
在R语言中用wavelet包中的dwt函数:
X=c(1.,2.,3.,4.,5.,6.,7.,8.) dwt(X, filter="d4", n.levels=3, boundary="periodic", fast=FALSE) 得各级高频小波系数: An object of class “dwt” Slot "W": $W1 [,1] [1,] 2.828427e+00 [2,] 0.000000e+00 [3,] -2.220446e-16 [4,] 0.000000e+00 $W2 [,1] [1,] 3.8301270 [2,] -0.3660254 $W3 [,1] [1,] 4.381341 在matlab中用 dwtmode('per') [c,l]=wavedec(1:8,3,'db2') 得结果: c = Columns 1 through 5 12.727922061357855 -0.000000000002692 -2.464101615135696 4.464101615132895 -1.035276180408362 Columns 6 through 8 -0.000000000000990 -0.000000000000990 3.863703305156531 l = 1 1 2 4 8 显然高频系数是不一样的,我发现matlab做的塔式算法中卷积后作偶数点采样,R语言是做奇数点采样,好像是R错了,是这样么?请高手指点!! |
所有时间均为北京时间。现在的时间是 11:15。 |
Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.