Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
|
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
在此先感谢您的帮助。
我正在尝试使用模仿Matlab小波函数的函数分析和绘制Python中小波去噪的所有可能组合。这涉及四个不同的变量,并且在所有变量之间进行迭代。我不确定是否可以附加和循环字典值。有关如何执行此操作的任何建议?下面是我尝试过的。 threshold = {'rigrsure','heursure','sqtwolog','minimaxi'} sorh = {'hard','soft'} scal = {'one', 'sln', 'mln'} for k in pywt.wavelist(kind='discrete'): name = k w = pywt.Wavelet(name) n = pywt.dwt_max_level(len(A), w.dec_len) for l in threshold: thres = l print(thres) for j in sorh: sorh = j print(sorh) for i in scal: scal = i print(scal) A_denoised = wden(A, thr, sorh, scal, n, name) plt.plot(A, color='blue') plt.plot(A_denoised, color='red', label=[name,l,j,i]) plt.legend(loc='upper right') plt.show() 更多&回答... |
![]() |
![]() |