当前位置:文档之家› Matlab之小波滤波函数

Matlab之小波滤波函数

Matlab之小波滤波函数南京理工大学仪器科学与技术专业谭彩铭2010-3-201 wfilters函数[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters('wname') computes four filters associated with the orthogonal or biorthogonal wavelet named in the string 'wname'.The four output filters areLo_D, the decomposition low-pass filterHi_D, the decomposition high-pass filterLo_R, the reconstruction low-pass filterHi_R, the reconstruction high-pass filter2 biorfilt函数The biorfilt command returns either four or eight filters associated with biorthogonal wavelets.3 orthfilt函数[Lo_D,Hi_D,Lo_R,Hi_R] = orthfilt(W) computes the four filters associated with the scaling filter W corresponding to a wavelet4 biorwaef函数[RF,DF] = biorwavf(W) returns two scaling filters associated with the biorthogonal wavelet specified by the string W.5 coifwavf函数F = coifwavf(W) returns the scaling filter associated with the Coiflet wavelet specified by the string W where W = 'coifN'. Possible values for N are 1, 2, 3, 4, or 56 dbaux函数W = dbaux(N,SUMW) is the order N Daubechies scaling filter such that sum(W) = SUMW. Possible values for N are 1, 2, 3, ...W = dbaux(N) is equivalent to W = dbaux(N,1)W = dbaux(N,0) is equivalent to W = dbaux(N,1)7 dbwavf函数F = dbwavf(W) returns the scaling filter associated with Daubechies wavelet specified by the string W where W = 'dbN'. Possible values for N are 1, 2, 3, ..., 45.8 mexihat函数[PSI,X] = mexihat(LB,UB,N) returns values of the Mexican hat wavelet on an N point regular grid, X, in the interval [LB,UB].Output arguments are the wavelet function PSI computed on the grid X.This wavelet has [-5 5] as effective support.This function is proportional to the second derivative function of the Gaussian probability density function.9 waveinfo函数waveinfo provides information on all wavelets within the toolbox.10 meyer函数11 meyeraux函数12 morlet函数13 symwavf函数F = symwavf(W) returns the scaling filter associated with the symlet wavelet specified by the string W where W = 'symN'. Possible values for N are 2, 3, ..., 45.14 一维离散小波变换相关联的函数所谓的单尺度指进行一层小波分解,我想其分解的过程应该是简单的一个高通,一个低通FIR 滤波算法,再分别按2下采样(每两个点舍去一个点)。

从一定程度上验证这个问题有一个比较简单的方法。

dwt 函数的输入参数可以是小波名称,也可以是滤波器组系数,两者分别尝试,观察结果是否相同。

程序如下。

图1图2可见分解的过程就是简单的类似FIR 滤波运算的过程(一个高通,一个低通),那么重构的过程是什么呢?我们看下图所示程序。

图3图4可见,小波重构的过程也是简单地类似FIR 滤波运算的过程。

那么,小波滤波的过程是什么呢? 还有个问题,matlab 小波分解与小波重构后的信号和原信号之间有误差,那么这个误差是如何产生的?15 完全重构滤波器组实际编写的小波滤波算法中,其过程实际上就是完全重构滤波器进行滤波的过程,参考杨志华 杨力华译《小波基础及应用教程》中关于滤波器组的介绍。

对于下图一个简单系统,其中H 是FIR 滤波器。

确有W(z)=H(z)V(z)吗?设v=[v(1) v(2) v(3) v(4) v(5)],H=[a(1) a(2) a(3) a(4)]。

则有1234()(1)(2)(3)(4)(5)V z v v zv zv zv z----=++++,123()(1)(2)(3)(4)H z a a za z a z ---=+++那么由W(z)=H(z)V(z)知,对应的W(z)为12345()()(1)(1)((1)(2)(2)(1))((1)(3)(2)(2)(3)(1))((1)(4)(2)(3)(3)(2)(4)(1))((1)(5)(2)(4)(3)(3)(4)(2))((2)(5)(3)(4)(4)(3))((3)(5)(4H z V z a v a v a v z a v a v a v za v a v a v a v z a v a v a v a v za v a v a v za v a -----=++++++++++++++++++67)(4))(4)(5)v z a v z--+这样,你应该清楚得出的w序列是什么了,matlab中的conv命令恰好对应上式中的运算。

常规理解是进来几个数,应该就出去几个数,这里输出序列w的数量多于输入序列v的数量。

当然实际中输入序列v的数量是很多的,一头一尾多出的几个数完全可以忽略。

下列程序验证了完全重构滤波器图5当输入数据很多时,舍去前3个数和后3个数,输出信号和原信号一模一样。

程序及输出结果如下面图所示。

图6图716 完全重构滤波器组的滤波效应对db2小波的4个滤波系数[Lo_D,Hi_D,Lo_R,Hi_R],观察图5,图6中的程序,实际使用的滤波系数应为[h0,h1,h2,h3] = wfilters('db2')命令得到的滤波系数的倒序所得。

下面我们来看看滤波系数h0和滤波系数h00之间的区别,其中 h0=[-0.1294 0.2241 0.8365 0.4830]; h00=[0.4830 0.8365 0.2241 -0.1294]; 二者从形式上看只是顺序反了。

输入下图所示程序,并观察结果。

图8图9对于这一点,理论证明很简单 即证明232301233210jwj wj wjwj wj wa a ea ea ea a ea ea e------+++=+++,两边经展开化简后易证明等式成立。

对FIR 滤波器,其滤波系数数量不论为多少,系数倒序后的幅频响应特性和倒序前的幅频响应特性是一样的。

研究完全重构滤波器组的滤波效应,我们似乎还是离不开一正弦波为基的经典滤波分析理论,因为小波分解过程依然是FIR 滤波。

(此句有误,看起来像是FIR 滤波,但是还有重构的过程,整个过程还是由若干不同尺度的尺度函数和小波函数的组合,所谓的低通滤波,即去掉高频的小波函数部分)17 wavedec 和wrcoef 函数 Wavedec 函数:wavedec performs a multilevel one-dimensional wavelet analysis using either a specific wavelet ('wname') or a specific wavelet decomposition filters (Lo_D and Hi_D, see wfilters).[C,L] = wavedec(X,N,'wname') returns the wavelet decomposition of the signal X at level N, using 'wname'. N must be a strictly positive integer (see wmaxlev for more information). The output decomposition structure contains the wavelet decomposition vector C and the bookkeeping vector L. The structure is organized as in this level-3 decomposition example:图10wrcoef函数:wrcoef reconstructs the coefficients of a one-dimensional signal, given a wavelet decomposition structure (C and L) and either a specified wavelet ('wname', see wfilters for more information) or specified reconstruction filters (Lo_R and Hi_R).这两个函数是构成一维小波滤波程序的主要部分,程序及输出结果如下。

相关主题