滚动轴承振动信号的Stockwell变换(Python)

B站影视 2025-01-31 07:38 2

摘要:pip install stockwellimport numpy as npimport stockwell.smt as smtimport stockwellimport osimport matplotlib.pyplot as pltimport g

pip install stockwellimport numpy as npimport stockwell.smt as smtimport stockwellimport osimport matplotlib.pyplot as pltimport globimport scipy.ioos.chdir('Case Western Reserve UniversityData/12k Drive End Bearing Fault Data/12KHz DE/Ball/') #your directoryos.getcwd#os.chdir('/def load_mat(f):''' Load the processed mat file and return the horizontal and vertical vibration signal data in it '''bearing_vibration_signal = scipy.io.loadmat(f)h = bearing_vibration_signal['H']return hfolder = 'Case Western Reserve University Data/12k Drive End Bearing Fault Data/12KHz DE/Ball/'bearing_files = sorted(glob.glob('%s*.mat' % (folder)))bearing_filesx = bearing_files[4]yyy = load_mat(x)yyy.shape # determine the shapey1 = yyy[:,0] # only the one dimensional signal takeny = y1[1:12000] # windowing the signal as per requirementFs = 12000 # frequencyP = 1.0/Fs # time stepsT = 1.0 # max timet = np.arange(0,T,P) # generate a time sequenceL = len(t)#twopi = 2*np.pi# create a list of different sin waves at different frequencies#ss = [np.sin(twopi*f*t) for f in [5,10,20,30,50]]#y = np.zeros(L,dtype='float64')#for s in ss:# y += s# get the stockwell transformsy = smt.st(y)rsy = abs(sy)f = plt.figuredef plotspec(psx, fs, lofreq=None, hifreq=None, t1=None, t2=None):extent = [0,psx.shape[1], 0.0, fs/2.0]if t1 != None and t2 != None:extent[0] = t1extent[1] = t2if lofreq != None:extent[2] = lofreqif hifreq != None:extent[3] = hifreqreturn plt.imshow(psx, extent=extent, aspect='auto', cmap="jet")plotspec(rsy, fs=Fs, t1=0, t2=T)plt.show

知乎学术咨询:

https://www.zhihu.com/consult/people/792359672131756032?isMe=1

担任《Mechanical System and Signal Processing》《中国电机工程学报》等期刊审稿专家,擅长领域:信号滤波/降噪,机器学习/深度学习,时间序列预分析/预测,设备故障诊断/缺陷检测/异常检测。

分割线分割线

非平稳信号的同步压缩Stockwell变换(MATLAB)

程序测试了调频信号,二次线性调频信号,蝙蝠回声信号,地震信号,轴承模拟故障冲击信号。

完整代码可通过知乎学术咨询获得:

https://www.zhihu.com/consult/people/792359672131756032?isMe=1

非平稳信号的一种基于乘积功率谱分割的经验小波变换方法(MATLAB R2018A)

完整代码可通过知乎学术咨询获得:

https://www.zhihu.com/consult/people/792359672131756032?isMe=1

非平稳信号的一种多元投影经验小波分解方法(MATLAB R2018A)

完整代码可通过知乎学术咨询获得:

https://www.zhihu.com/consult/people/792359672131756032?isMe=1

来源:公务员小课堂鉴

相关推荐