[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
1.简述变分模态分解
变分模态分解--vmd,适用于非线性时间序列信号,主要是利用求解变分问题的思想去对信号进行提取,在不丢失原始信号特征的情况下,把一个原始信号分解成多个不同中心频率的信号,即不在同一个调制信号内。
2.以轴承信号为例
安装vmd库,直接pip install vmdpy 即可
import matplotlib.pyplot as plt import numpy as np from vmdpy import VMD
读取信号
ball_18_0 = np.loadtxt('E:/12k1/0HP/inner18.txt') data =
ball_18_0[2048*2:2048*3]
设置参数,但分解层数K和二次惩罚系数α需要仔细考虑设定,特别是K值,对分解效果影响巨大。
# 参数设置 alpha = 2000 # moderate bandwidth constraint tau = 0. # noise-tolerance
(no strict fidelity enforcement) K = 5 # 3 modes DC = 0 # no DC part imposed
init = 1 # initialize omegas uniformly tol = 1e-7 u, u_hat, omega = VMD(data,
alpha, tau, K, DC, init, tol)
绘制分解信号图
plt.figure(figsize=(10, 8)) for i in range(K): plt.subplot(K+1, 1, 1)
plt.plot(data) plt.title("outer") plt.subplot(K+1, 1, i+2) plt.plot(u[i, :],
linewidth=0.2, c='r') plt.ylabel('u{}'.format(i + 1)) plt.tight_layout()
plt.show()
最后绘出其频谱图
Fs = 12000 Ts = 1.0/Fs t = np.arange(N) k = np.arange(N) T = N/Fs frq = k/T
frq1 = frq[range(int(N/2))] lt.figure(figsize=(10, 8)) for i in range(K):
plt.subplot(K + 1, 1, 1) data_f = abs(np.fft.fft(data)) / N data_f1 =
data_f[range(int(N / 2))] plt.plot(frq1, data_f1) plt.title("outer")
plt.subplot(K+1, 1, i + 2) data_f2 = abs(np.fft.fft(u[i, :])) / N data_f3 =
data_f2[range(int(N / 2))] plt.plot(frq1, data_f3, 'red')
plt.xlabel('pinlv(hz)') plt.ylabel('u{}'.format(i + 1)) plt.tight_layout()
plt.show()
由上述结果可知,分解出来的信号基本上不在同一个频率段,分解效果很好。