python如何实现类似matlab的小波滤波?

python如何实现类似matlab的小波滤波?,第1张

T=wpdec(y,5,'db40')

%信号y进行波包解层数5T波树plot看

a10=wprcoef(T,[1,0])

%a10节点[1,0]进行重构信号貌似没层重构说吧能某层某节点进行重构节点编号波树

%以下为滤波程序(主要调节参数c的大小)

c=10

wn=0.1

fs=50000%采样频率;

b=fir1(c,wn/(fs/2),hamming(c+1))

y1=filtfilt(b,1,y)%对y滤波。

Matlab之小波滤波函数 :

1 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 are

Lo_D, the decomposition low-pass filter Hi_D, the decomposition high-pass filter Lo_R, the reconstruction low-pass filter

Hi_R, the reconstruction high-pass filter

2 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 wavelet

4 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 5

6 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.

(1)[Lo_D,Hi_D,Lo_R,Hi_R]=wfilters(‘wname’);

(2)[F1,F2]=wfilters(‘wname’,‘type’)。

说明:格式(1)是用来计算和正交或双正交小波wname相关联的四个滤波器。返回的四个滤波器分别是Lo_D(分解的低通滤波器)、Hi_D(分解的高通滤波器)、Lo_R(重构的低通滤波器)、Hi_R(重构的高通滤波器)。Lo_D和Hi_D分别是Lo_R和Hi_R的对偶算子,也可以分别理解为Lo_R和Hi_R的共轭转置矩阵。可用到的正交或双正交小波函数wn-ame有:

Daubechies:db1或haar,db2,db3,…,db10,…,db50

Coiflets:coifl,…,coif5

Symlets:sym2,…,sym8

Biorthogonal:bior1.1,bior1.3,bior1.5,

bior2.2,bior2.4,bior2.6,bior2.8

bior3.1,bior3.3,bior3.5,bior3.7

bior3.9,bior4.4,bior5.5,bior6.8

调用格式(2)返回如下两个滤波器:

Lo_D和Hi_D(分解滤波器) type为‘d’时

Lo_R和Hi_R(重构滤波器) type为‘r’时

Lo_D和Lo_R(低通滤波器) type为‘l’时

Hi_D和Hi_R(高通滤波器) type为‘h’时

[例6-4]wname=‘db5’;%wname 取db5 小波

%下面计算与给定不波相关联的四个滤波器

[Lo_D,Hi_D,Lo_R,Hi_R]=wfilters(wname);

subplot(421);stem(Lo_D);title(‘分解低通滤波器’);grid;

subplot(422);stem(Hi_D);title(‘分解高通滤波器’);grid;

subplot(425);stem(Lo_R);title(‘重构低通滤波器’);grid;

subplot(426);stem(Hi_R);title(‘重构高通滤波器’);grid;

输出结果如图6-40所示)。

图6-40 小波函数滤波器

下面介绍一个MATLAB工具箱中的小波函数。由于小波函数的定义方式有多种多样,有在时域中进行定义的,有在频域中进行定义的,有的则是能过滤波器进行定义的。根据不同小波函数的不同定义方式,可以计算出该小波函数的时域数值或滤波器数值。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/11063487.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-13
下一篇 2023-05-13

发表评论

登录后才能评论

评论列表(0条)

保存