matlab中wenergy函数,Python中一维小波的能量

我想知道在Python中是否有一个一维小波能量的实现,与Matlab的'[Ea,Ed]=wenergy(C,L)'相同。

我试着自己写一篇,但我不确定:

公式为:

f3eba872c1229c0de590b96bd651119b.gif

其中Dj是细节向量,j=1,2,…,ld和N1是分解层的数据长度。在import json

import pywt

f=open('DataFile.txt','r')

D=json.load(f)

f.close()

#create the wavelet function

db1 = pywt.Wavelet('db13')

#calculate the number of necessary decompositions

NbrDecomp= pywt.dwt_max_level(len(D), db1)+1

#Initialize an empty list to receive the Detail and Approximation

Vector = [None] * NbrDecomp

#we use the Wavelet decomposition in the pywt module

Vector = pywt.wavedec(D, db1)

#Now Vector = [Approxiamtion N, Details N, Details N-1,.....]

#Where N would be the number of decompositions

根据定义,k级能量为:

^{pr2}$

实施是否正确?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值