声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2547|回复: 6

[滤波] 振动信号时域同步平均

[复制链接]
发表于 2015-6-2 20:48 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
求振动信号时域同步平均matlab程序,谢谢!
回复
分享到:

使用道具 举报

发表于 2017-5-14 10:37 | 显示全部楼层
阿呦,同求呀!仿真的也行呀
发表于 2017-5-15 10:15 | 显示全部楼层
  1. N=2621440;
  2. n=1:N;
  3. fs=131072;
  4. t=1/fs:1/fs:N/fs;
  5. x3=data3(n);
  6. nfft=2^nextpow2(length(x3));
  7. y3=fft(x3,nfft);
  8. magy3=abs(y3(1:N/2));
  9. figure(1);
  10. subplot(211);plot(t,x3);title('data3 time domain before the TSA')
  11. subplot(212);plot(magy3(1:N/2));title('data3 frequency domain before the TSA')
  12. fs1=135168; % 数据长度
  13. xx3=zeros(1,fs1); % 用于存储时域平均后的数据
  14. m1=1;
  15. m2=fs1;
  16. nnnn=fix(N/fs1); % 确定分段数
  17. % 将数据分成 nnnn 段,并求和,将和存储于 xx 中
  18. for nnn=1:nnnn
  19. xxx3=x3(1:fs1);
  20. xx3=xx3+xxx3;
  21. m1=m1+fs1;
  22. m2=m2+fs1;
  23. end
  24. nfft1=2^nextpow2(length(fs1));
  25. yy3=fft(xx3,fs1);
  26. magyy3=abs(yy3);
  27. t1=1/fs:1/fs:N/fs*fs1/N;
  28. xx3=xx3/nnnn; % 对数据进行平均
  29. % 绘制时域平均后的波形
  30. figure(2)
  31. subplot(211)
  32. title('data3 time domain after the TSA')
  33. plot(t1,xx3)
  34. subplot(212)
  35. plot(magyy3(1:fs1/2));
  36. title('frequency domain after the TSA')
  37. figure(3)
  38. plot(magyy3(1:900));
复制代码


发表于 2017-5-15 23:51 | 显示全部楼层

点评

什么?  详情 回复 发表于 2017-5-16 16:52
发表于 2017-5-16 16:52 | 显示全部楼层
发表于 2017-7-29 21:50 | 显示全部楼层
clc
clear all
close all
N=200;
f0=10;
fs=100;
ts=1/fs;
tscale=[0:N-1]*ts;
sig1=sin(2*pi*f0*tscale);
xmax=max(sig1);
subplot(3,2,1)
plot(tscale,sig1,'b')   
title('这是一个正弦函数');
xlabel('时间 /s');
ylabel('幅值 /mm');   
ylim([-2*xmax 2*xmax]);
sum=0;
for k=2:1:5;
    sig0=0.3*randn(N,1);
    sigk=sig1+sig0';
    sum=sum+sigk;
    subplot(3,2,k)
plot(tscale,sigk,'k')
end
sig0=sum/4;
subplot(3,2,6)
plot(tscale,sig0,'r')
发表于 2017-7-29 21:51 | 显示全部楼层
802355uu 发表于 2017-7-29 21:50
clc
clear all
close all

这是个仿真,可以仿着调试
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-4-26 15:58 , Processed in 0.094648 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表