> 数学 >
clear all;
t=0:0.1:50;
yp=sin(2*pi*2*t);
yq=sin(2*pi*2.0125*t);
y=yp+yq;
Y1=fft(y,512);
Y2=fft(y,4096);
Y1=fftshift(Y1);
Y2=fftshift(Y2);
c1=[0:255]/51.2;
c2=[0:2047]/409;
subplot(2,1,1);plot(c1,abs(Y1(257:512)));
axis([1.2,2.2,-30,300]);
title('512点FFT的频谱');
grid on;
subplot(2,1,2);plot(c2,abs(Y2(2049:4096)));
axis([1.2,2.2,-30,300]);
title('4096点FFT的频谱');
grid on;
人气:247 ℃ 时间:2020-10-01 04:34:29
解答
只是个MATLAB的程序吧.t=0:0.1:50;t取值 0-50 间隔是0.1yp=sin(2*pi*2*t); 三角函数 SIN(2π2t)yq=sin(2*pi*2.0125*t);同上y=yp+yq; 相加 也就是在yp的图形上加上yq的图形合成Y1=fft(y,512);用FFT函数进行频谱分析...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版