使用“ WaveletStudio”将wavelet应用于wave文件

时间:2018-08-20 14:19:44

标签: c# visual-studio matlab wavelet

我尝试在VS上使用wavelet来计算wave文件的WaveletStudio,但该库没有很好的文档,我不确定我所做的一切。

这是我在matlab上的代码

[cA,cD]= dwt(x1(:,1),'sym6');

这是VS上的代码

var sample = buf.Samples;
double[] doubleArray = Array.ConvertAll(sample, x => (double)x);

Signal sign = new Signal(doubleArray);
var wavelet = MotherWavelet.LoadFromName("sym6");
var output = DWT.ExecuteDWT(sign, wavelet,2, 
SignalExtension.ExtensionMode.AntisymmetricHalfPoint);

有人可以帮我吗? 谢谢。

输出matlab: 3,16320801207017e-07 -1,01583359677462e-05 -3,47844682047843e-06 1,14694820511622e-05 3,39252240372775e-07 8,97279990863433e-06 1,15038653611192e-05 2,43046421129216e-06 -1,61369908206498e-05 1,32412854950234e-05 -1,08862917135995e-05

VB中的输出: 我显示十个值,与matlab不相等并且出现两次(索引0和1)

for (int i = 0; i <10; i++)

{
   Console.WriteLine(i+1 + ":"+outp.Index + ":" + outp.Details[i]+"/"+outp.Approximation[i]);
}

结果:

1:0:7,50333128962666E-12/5,22959453519434E-12 2:0:6,99174051987939E-12/-2,27373675443232E-12 3:0:-0,00603299645041488/-0,0119133972440295 4:0:0,0176316128041094/0,0577649713181927 5:0:0,275122803422278/0,338946061095385 6:0:1,59854478815328/0,0463692277272685 7:0:1,36137312350019/-0,375410807828075 8:0:2,13904808509892/-0,78662450165757 9:0:2,47515837787779/0,143557755120469 10:0:2,87600721658731/-0,470215164047318 1:1:-2,54640752928026E-12/2,51247911364771E-11 2:1:0,000429548238281896/0,000848231716076953 3:1:-0,00137176124392235/-0,00434269860886616 4:1:-0,0158419918038213/-0,0162915354128472 5:1:0,106233502223414/0,414332125854799 6:1:-0,0322026601468124/-0,644760986507663 7:1:0,415925143582185/-0,331935864398247 8:1:0,439402584889281/-0,221799790585692 9:1:0,0682131291286869/0,25486845639989 10:1:-0,316755136430771/-0,081470480363123

0 个答案:

没有答案