声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 914|回复: 0

[综合讨论] 请教共振解调中带通滤波的问题

[复制链接]
发表于 2014-12-24 16:08 | 显示全部楼层 |阅读模式

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

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

x
想处理一个数据,先用一个简单的例子进行试验:对一个序列(正弦信号)加噪声和脉冲信号后,进行预处理和带通滤波,包络后得到的频率是想得到频率的两倍,请问是怎么回事?(谢谢大家)
%模拟信号
fs=1000;
n=1001;
N=1000;  
t=0:1/fs:1;
d = 0 : 1/100: 1;
x1=sin(100*t);
figure(1)
subplot(2,2,1);
plot(t,x1);
title('初始信号时域图');
xlabel('时间/s');
ylabel('振幅/m')
grid on;
%加噪
a=0;b=1;  %均值为a,方差为b^2
y2=a+b*rand(1,n);
Y=x1+y2;
subplot(2,2,2);
plot(t,Y);
title('加噪时域图');
xlabel('时间/s');
ylabel('振幅/m')
grid on;
%加冲击
x2= pulstran(t,d,'tripuls',0.01,-1);
y1=Y+x2;
subplot(2,2,3);
plot(t,y1);
title('加噪声和冲击的时域波形');
xlabel('时间/s');
ylabel('振幅/m')
grid on;
%初始信号的fft变换
fs=1000;
f =(0:N-1)*fs/N;
S1=abs(fft(y1,N));
subplot(2,2,4);
plot(f(1:N/2),S1(1:N/2)*2/N);
title('频域波形');
ylabel('振幅/m/s^2');
xlabel('频率/Hz');
grid on;
%对信号的预处理
%去除趋势项
m=1;
a=polyfit(t,y1,m);
y3=y1-polyval(a,t);
figure(2)
plot(t,y3,'r');
hold on
plot(t,y1);
title('预处理:去除趋势项');
xlabel('时间/s');
ylabel('振幅/m')
grid on;
%预处理:小波降噪
[c,l]=wavedec(y3,4,'db10');
[thr,sorh,keepapp]=ddencmp('den','wv',y3);
y4=wdencmp('gbl',c,l,'db10',4,thr,sorh,keepapp);
figure(3)
subplot(1,2,1);
plot(t,y4);
title('预处理:小波降噪');
xlabel('时间/s');
ylabel('振幅/m')
grid on;
%降噪后的fft变换
S2=abs(fft(y4));
subplot(1,2,2);
plot(f(1:N/2),S2(1:N/2)*2/N);
title('频域波形');
ylabel('振幅/m/s^2');
xlabel('频率/Hz');
grid on;
%预处理:带通滤波
Wn=[95,105]*2/fs;
[b,a]= butter(4,Wn);
y5= filter(b,a,y4);
figure(4);
plot(t,y5);
title('预处理:带通滤波');
grid on;
%包络时域图
y6=hilbert(y5);
y7=abs(y6+j*y5);
figure(5);
subplot(1,2,1);
plot(t,y7);
title('Hilbert变换信号');
grid on
%包络频域图
S4=abs(fft(y7));
subplot(1,2,2);
plot(f(1:N/2),S4(1:N/2)*2/N);
title('包络频率图');
ylabel('振幅/m/s^2');
xlabel('频率/Hz');
grid on;

                               
登录/注册后可看大图



                               
登录/注册后可看大图



                               
登录/注册后可看大图



                               
登录/注册后可看大图


回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-3 03:57 , Processed in 0.333969 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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