【求助】怎么用MATLAB得到 频谱图 ???谢谢各位帮忙!!!
本帖最后由 wdhd 于 2016-9-18 14:10 编辑有两个程序,不知道怎么得到频谱图,求各位高手解答!谢谢!
第一个:
t=0:pi/999:pi;
y0= zeros(1,1000);
t1 = 1:5;
t2 = 1:10;
y0(1,50:54)=3*exp((-t1)/2);
y0(1,200:204)=5*(exp(-1.3*t1/2)-exp(-2.2*t1/2));
y0(1,300:304)=2*exp(-t1/3);
y0(1,500:509)=3*exp(-t2/6).*sin(3000*t2);
y0(1,600:609)=2*exp(-t2/5).*sin(5000*t2/2);
y0(1,800:809)=5*(exp(-2.2*t2/6)-exp(-1.3*t2/6)).*sin(3000*t2);
第二个:
t=0:pi/999:pi;
y0= zeros(1,1000);%y0为局部放电原始信号%
t1 = 1:5;
t2 = 1:10;
y0(1,50:54)=3*exp((-t1)/2);
y0(1,200:204)=5*(exp(-1.3*t1/2)-exp(-2.2*t1/2));
y0(1,300:304)=2*exp(-t1/3);
y0(1,500:509)=3*exp(-t2/6).*sin(3000*t2);
y0(1,600:609)=2*exp(-t2/5).*sin(5000*t2/2);
y0(1,800:809)=5*(exp(-2.2*t2/6)-exp(-1.3*t2/6)).*sin(3000*t2);
y1=0.3*cos(50000*t);
y2=0.2*cos(650000*t);
y3=0.3*cos(750000*t);
y=y0+y1+y2+y3;
回复 楼主 wwwzzz 的帖子
help fft逛逛"信号处理方法", 看看
http://forum.vibunion.com/forum/vi ... mp;page=1#pid426435 第一个
t=0:pi/999:pi;
y0= zeros(1,1000);
t1 = 1:5;
t2 = 1:10;
y0(1,50:54)=3*exp((-t1)/2);
y0(1,200:204)=5*(exp((-1.3)*t1/2))-exp((-2.2)*t1/2);
y0(1,300:304)=2*exp((-t1)/3);
y0(1,500:509)=3*exp((-t2)/6).*sin(3000*t2);
y0(1,600:609)=2*exp((-t2)/5).*sin(5000*t2/2);
y0(1,800:809)=5*(exp((-2.2)*t2/6)-exp((-1.3)*t2/6)).*sin(3000*t2);
y0_fft=fft(y0);
plot(abs(y0_fft)); 第二个同理,非常简单的哦,楼主只要稍稍翻翻论坛的帖子就能做的,我也是刚接触信号处理,从论坛中获益颇多,现在能回答一些这样的简单些问题了,算是对论坛的一种回报吧。
页:
[1]