算法如下

【...matlab的小波算法系数重构的信号,matlab算法如下】 pywt.waverec(coeffs, wavelet, mode= symmetric , axis=-1)It may sometimes be desired to run waverec with some sets of coefficients omitt...

...matlab的小波算法系数重构的信号,matlab算法如下

pywt.waverec(coeffs, wavelet, mode= symmetric , axis=-1)
It may sometimes be desired to run waverec with some sets of coefficients omitted. This can best be done by setting the corresponding arrays to zero arrays of matching shape and dtype. Explicitly removing list entries or setting them to None is not supported.

Specifically, to ignore detail coefficients at level 2, one could do:
coeffs[-2] = np.zeros_like(coeffs[-2])

##################################################################
coeffs=pywt.wavedec(data_current, db6 ,level=3)
for i in range(1,4):
coeffs[i] = np.zeros_like(coeffs[i])
A3 = pywt.waverec(coeffs, db6 )
### wavelet分解、重构原始序列
# time_series = rec_D1 + rec_A1
# rec_A1 = rec_D2 + rec_A2
# rec_A2 = rec_D3 +rec_A3
# 也就是说,time_series = rec_D1 + rec_D2 + rec_D3 +rec_A3
def wavelet_decompose(time_series, wavelet):
coeffs = wavedec(time_series, wavelet, level=1)
cA1, cD1 = coeffs
rec_D1 = pywt.waverec([None, cD1], wavelet)
rec_A1 = pywt.waverec([cA1, None], wavelet)
coeffs = wavedec(time_series - rec_D1, wavelet, level=1)
cA2, cD2 = coeffs
rec_D2 = pywt.waverec([None, cD2], wavelet)
rec_A2 = pywt.waverec([cA2, None], wavelet)
coeffs = wavedec(time_series - rec_D1 - rec_D2, wavelet, level=1)
cA3, cD3 = coeffs
rec_D3 = pywt.waverec([None, cD3], wavelet)
rec_A3 = pywt.waverec([cA3, None], wavelet)

return rec_D1, rec_D2, rec_D3, rec_A3, rec_A2, rec_A1
我也在找这个问题,pywt.upcoef可以实现python里小波的一层分解重构,但多层分解以后,再重构数据就不对了,你知道结果答案了么,已经过去一年
下列SQL创建了一个唯一约束的“ P_Id ”一栏时, “人”是创建表:
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
继续阅读:...matlab的小波算法系数重构的信号,matlab算法如下