Matlab 实现包络谱分析(共振解调)


% 本数据参数:Recording-10  1500r/min,外圈,径向加载1kN,轴向加载2kN  所有通道可用
% 经过计算 外圈故障特征频率:理论值(5.6Fr=5.6*1500/60=140)
clc
clear all;

load Recording_10.mat

ch1=Channel_1_Data;
ch2=Channel_2_Data;

Fs = 65536;            % Sampling frequency 
T = 1/Fs;             % Sampling period       
L = length(ch1)           % Length of signal
t = (0:L-1)*T;        % Time vector
x = (0:L-1);        

figure(1)
%subplot(2,1,1)
%plot(t,ch1)   % t轴单位是s  
plot(x,ch1)
xlabel('Time/s','fontsize',10.5)
ylabel('Amp','fontsize',10.5)

%axis([0 0.1 -30 30])
axis([0 4000 -50 50])
%subplot(2,1,2)
%plot(ch2)

axis([0 4000 -50 50])

%================FFT===================
                  


Y = fft(ch1);   %此时的Y为复数 a+bi 
%计算双侧频谱 P2。然后基于 P2 和偶数信号长度 L 计算单侧频谱 P1。


P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
%定义频域 f 并绘制单侧幅值频谱 P1。一般情况下,较长的信号会产生更好的频率近似值。

f = Fs*(0:(L/2))/L;
figure(2)
plot(f,P1) 

title('x-axis vibration spectrogram','fontsize',10.5)

xlabel('Freq','fontsize',10.5)
ylabel('Amp','fontsize',10.5)

% set(gca, 'LineWidth',1)  
% set(gca,'FontSize',10.5);
% set(gcf,'Position',[100 100 1300 280]);

% axis([0 200 0 2])


%================Envelope===================
%  'analytic' 效果不佳
%  40,'rms   效果不错 (推荐)
%  peak 运算较慢   50,'peak 效果较好 特征峰值较高
[up,lo]=envelope(ch1,50,'rms');  
 
figure(3)
subplot(2,1,1)
plot(t,ch1)
axis([0 0.1 -30 30])

hold on;
plot(t,up,'linewidth',1.5)
subplot(2,1,2)
plot(t,up)
axis([0 0.1 -30 30])

%================envelope FFT===================

Y = fft(up);   %此时的Y为复数 a+bi 
%计算双侧频谱 P2。然后基于 P2 和偶数信号长度 L 计算单侧频谱 P1。


P2 = abs(Y/L);
P1 = P2(1:L/2+1);
P1(2:end-1) = 2*P1(2:end-1);
%定义频域 f 并绘制单侧幅值频谱 P1。一般情况下,较长的信号会产生更好的频率近似值。

f = Fs*(0:(L/2))/L;
figure(4)
plot(f,P1,'r') 

title('x-axis vibration spectrogram','fontsize',10.5)

xlabel('Freq','fontsize',10.5)
ylabel('Amp','fontsize',10.5)

% set(gca, 'LineWidth',1)  
% set(gca,'FontSize',10.5);
% set(gcf,'Position',[100 100 1300 280]);

axis([0 200 0 6])




题主本硕机械专业,自学转互联网 算法岗成功,获得阿里、字节、美团、华为等 15+ offer
后续会在公众号 「苏学算法」分享各类学习笔记、面试经验,感兴趣的可以关注一波 😊 😊 😊~

在这里插入图片描述

  • 9
    点赞
  • 88
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值