First, the way to obtain the code

Get the code 1: by subscribing to the paid column of purple Pole Shenguang blog, you can get this code with payment voucher, private letter bloggers.

Access code 2: Open CSDN membership through the homepage of CSDN blog, and the code can be obtained by payment voucher and private letter bloggers.

[fault diagnosis analysis] based on MATLAB FFT bearing fault diagnosis [matlab source code 1397 issue]

Note: For CSDN membership, only one code can be obtained free of charge (valid within three days from the date of opening); Subscribe to the paid column of purple Pole Shenguang blog, you can get 2 copies of the code for free (valid for three days from the subscription date);

Two, some source code

%% data preprocessing (training set validation set test set division) CLC; clear; Close all %% Loads raw data % load0HP/48k_Drive_End_B007_0_122;    a1=X122_DE_time'; %1
% load 0HP/48k_Drive_End_B014_0_189;    a2=X189_DE_time'; %2
% load 0HP/48k_Drive_End_B021_0_226;    a3=X226_DE_time'; %3
% load 0HP/48k_Drive_End_IR007_0_109;   a4=X109_DE_time'; %4
% load 0HP/48k_Drive_End_IR014_0_174 ;  a5=X173_DE_time'; %5
% load 0HP/48k_Drive_End_IR021_0_213 ;  a6=X213_DE_time'; %6
% load 0HP/48k_Drive_End_OR007@6_0_135 ;a7=X135_DE_time'; %7
% load 0HP/48k_Drive_End_OR014@6_0_201 ;a8=X201_DE_time'; %8
% load 0HP/48k_Drive_End_OR021@6_0_238 ;a9=X238_DE_time'; %9
% load 0HP/normal_0_97 ; a10=X097_DE_time'; %10% save original_data A1 A2 A3 A4 A5 a6 a7 A8 a9 a10% % Clear load original_data %%for i=1:10
    if i==1; ori_data=a1; endif i==2; ori_data=a2; endif i==3; ori_data=a3; endif i==4; ori_data=a4; endif i==5; ori_data=a5; endif i==6; ori_data=a6; endif i==7; ori_data=a7; endif i==8; ori_data=a8; endif i==9; ori_data=a9; endif i==10; ori_data=a10; endfor j=1:N start_point=randi(length(ori_data)-L); % Select a random starting point end_point=start_point+L+1; data=[data ;ori_data(start_point:end_point)]; label=[label;i]; Onehot output=zeros(10*N,10);
for i = 1:10*N
    output(i,label(i))=1; End %% divides training set validation set and test set7:2:1Proportion valid_X = data (n (m1 +1:m2),:);
valid_Y=output(n(m1+1:m2),:);

test_X=data(n(m2+1:end),:);
test_Y=output(n(m2+1:end),:);

save data_process train_X train_Y valid_X valid_Y test_X test_Y









Copy the code

3. Operation results

Matlab version and references

1 matlab version 2014A

2 Reference [1] Shen Zaiyang. Proficient in MATLAB Signal Processing [M]. Tsinghua University Press, 2015. [2] GAO Baojian, PENG Jinye, WANG Lin, PAN Jianshou. Signal and System — Analysis and Implementation using MATLAB [M]. Tsinghua University Press, 2020. [3] WANG Wenguang, WEI Shaoming, REN Xin. MATLAB Implementation of Signal Processing and System Analysis [M]. Publishing House of Electronics Industry, 2018.