一维信号转对称点模式图像(Python)

B站影视 2025-02-05 14:15 2

摘要:import scipy.ioimport pandas as pdimport numpy as npimport matplotlib.pyplot as plt!wget http://csegroups.case.edu/sites/default/f

import scipy.ioimport pandas as pdimport numpy as npimport matplotlib.pyplot as plt!wget http://csegroups.case.edu/sites/default/files/bearingdatacenter/files/Datafiles/98.mat?raw=truemat = scipy.io.loadmat('data.mat')print(mat){'__header__': b'MATLAB 5.0 MAT-file, Platform: PCWIN, Created on: Mon Jan 31 15:28:20 2000', '__version__': '1.0', '__globals__': , 'X097_DE_time': array([[ 0.05319692],[ 0.08866154],[ 0.09971815],...,[-0.03463015],[ 0.01668923],[ 0.04693846]]), 'X097_FE_time': array([[0.14566727],[0.09779636],[0.05485636],...,[0.14053091],[0.09553636],[0.09019455]]), 'X097RPM': array([[1796]], dtype=uint16)}# visualization of data 97.matc1 =np.array( mat["X097_DE_time"])c2 = np.array(mat["X097_FE_time"])c1 = c1[:1600]c1max = np.max(c1)c1min = np.min(c1)c1mean = np.mean(c1)# c1 = (c1 - c1mean)/max(abs(c1 - c1mean))import matplotlib.pyplot as pltplt.plot(range(0,1600),c1[:1600])# print(c1)# visualization of data SDP 97.matz =35t =2for i in range(0,7):r = ((c1 - c1min)/(c1max - c1min))r = r[:len(c1)-t]theta = (60*i + (((c1-c1min)/(c1max-c1min))*z))phi = (60*i - (((c1-c1min)/(c1max-c1min))*z))theta = theta[t:]phi = phi[t:]plt.polar(theta*(np.pi/180),r ,'.', c='blue')plt.polar(phi*(np.pi/180),r ,'.', c='red')import numpy as npimport matplotlib.pyplot as plttime = np.arange(0,10,1/2400)amp = np.sin(2*np.pi*time*50)fig = plt.figurefig.set_size_inches(12,6)plt.subplots_adjust(hspace=1)plt.subplot(311)# plt.plot(x, sampled_f1)plt.plot(time,amp)plt.xlim(0, 1)# SDP OF SIN WAVEfor i in range(1,7):rs = (amp - np.min(amp))/(np.max(amp)- np.min(amp))th = (60*i + ((amp - np.min(amp))/(np.max(amp)- np.min(amp))*35))ph = (60*i - ((amp - np.min(amp))/(np.max(amp)- np.min(amp))*35))th = th[2:]ph = ph[2:]rs = rs[:len(rs)-2]plt.polar(th*(np.pi/180),rs,'.', c='blue')plt.polar(ph*(np.pi/180),rs,'.', c='red')

知乎学术咨询:

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

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

分割线分割线

自适应滤波及在信号降噪中的应用(MATLAB)

完整代码:

维纳滤波器及在信号降噪中的应用(MATLAB)

% 1. Wiener filterclear all;clc;% Data Constructionload('idealECG.mat');yi = idealECG; % ideal ECG signalM = length(yi); % Length of the signalFs = 500; % sampling frequency(Hz)t = (0:M-1)/Fs; % Time vector for the signalSNR = 10;rng(0);n_wg = awgn(yi, SNR, 'measured') - yi; % white Gaussian noisen_50 = 0.2 * sin(2 * pi * 50 * t); % 50Hz noisen = n_wg + n_50; % Total noisex = yi + n; % Primary input signal% Plot the constructed signalsfigure(1);subplot(4,1,1);plot(t(1:500), yi(1:500));title('Ideal ECG Signal yi(n)');xlabel('Time (s)');ylabel('Amplitude');

完整代码:

基于稀疏学习的旋转机械故障诊断方法(MATLAB)

完整数据和代码通过知乎学术付费咨询获得

基于改进贝叶斯学习的旋转机械故障诊断(MATLAB)

基于群稀疏学习的旋转机械故障诊断方法(MATLAB)

完整数据和代码通过知乎学术付费咨询获得

基于稀疏贝叶斯学习的基线校正方法(MATLAB)

来源:晓晨论科技

相关推荐