## 2 部分代码

clcclear allclose allfs = 20e3;                  % 采样频率fn = 3e3;                   % 固有频率y0 = 5;                      % 位移常数g = 0.1;                     % 阻尼系数T = 0.01;                   % 重复周期N = 4096;                  % 采样点数NT = round(fs*T);      % 单周期采样点数t = 0:1/fs:(N-1)/fs;      % 采样时刻t0 = 0:1/fs:(NT-1)/fs;  % 单周期采样时刻K = ceil(N/NT)+1;       % 重复次数y = [];for i = 1:K    y = [y,y0*exp(-g*2*pi*fn*t0).*sin(2*pi*fn*sqrt(1-g^2)*t0)];endy = y(1:N);Yf = fft(y);                % 频谱figure(1);subplot(231);plot(t,y);axis([0,inf,-4,5])title('轴承故障仿真信号时域波形图')xlabel('Time(s)')ylabel('Amplitude')y5 = awgn(y,5,'measured'); % Add white Gaussian noisey10 = awgn(y,10,'measured'); % Add white Gaussian noisey15 = awgn(y,15,'measured'); % Add white Gaussian noisesubplot(232);f = 0:fs/N:fs-fs/N;plot(f/1e3,abs(Yf));xlabel('Frequency(KHz)');ylabel('\itY\rm(\itf\rm)')title('轴承故障仿真信号幅度谱图');subplot(233);plot(t,y5);axis([0,inf,-4,5]);title('轴承故障仿真信号+5db噪声时域波形图');xlabel('Time(s)');ylabel('Amplitude');subplot(234);plot(t,y10);axis([0,inf,-4,5]);title('轴承故障仿真信号+10db噪声时域波形图');xlabel('Time(s)');ylabel('Amplitude');subplot(235);plot(t,y15);axis([0,inf,-4,5]);title('轴承故障仿真信号+15db噪声时域波形图');xlabel('Time(s)');ylabel('Amplitude');figure(2);

## 4 参考文献

[1]刘毅华, 赵光宙. 故障分析中的小波软阈值改进除噪方法[J]. 继电器, 2004, 32(24):5.