资源预览内容
第1页 / 共28页
第2页 / 共28页
第3页 / 共28页
第4页 / 共28页
第5页 / 共28页
第6页 / 共28页
第7页 / 共28页
第8页 / 共28页
第9页 / 共28页
第10页 / 共28页
亲,该文档总共28页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
C#小波变换源码 仅仅两个类完成的工作,现共享出来,欢迎大家使用,并体意见。Seq.cs 类是最基 础的用于一维数组处理的;Wvlt.cs 是小波变换的类;其中的主要思路来源于 Matlab6.5. Seq.cs 的源码是: using System; using System.Diagnostics; namespace MathArithmetic.Wavelet / / / Seq 的摘要说明。/ 为小波变换而设计的序列运算对象。/ / 何险峰/ / public class Seqpublic float elements=null;public Seq()elements = new float0;public Seq(int Len) elements = new floatLen;public Seq(float elt)elements = new floatelt.Length;elt.CopyTo(elements,0);public Seq(double elt)elements = new floatelt.Length;for (int i=0;i=xsize)if (x=xsize) x = xsize * 2 - x - 2;return x;/卷积static public Seq operator *(Seq s1,Seq s2)/Seq ss2 = SymmetricExtension(s2);Seq con = new Seq(s1.Length + s2.Length - 1);int i,j,k;for (i = 0; i = 0 return con;static public Seq operator*(float d, Seq s)Seq m = new Seq(s);for (int i = 0; i m.Length; i+) mi *= d;return m;/反转public Seq Wrev()Seq tr = new Seq(Length);for (int i = 0; i Length; i+)tr.elementsi = elementsLength-1-i;return tr;/积分镜像过滤public Seq Qmf() /Quadrature mirror filterSeq tr = Wrev().Altsign();return tr;/间隔变号public Seq Altsign()Seq alt = new Seq(this);int sign = 1;for (int i = 0; i Length; i+) alti *= sign;sign *= -1;return alt;/返回间隔抽样public Seq Dyaddown()Seq down = new Seq(Length / 2);for (int i = 0; i down.Length; i+)downi = this2*i;return down;/倍增样本
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号