这个MATLAB程序运行出来以后没有图像,是什么原因呢?fs=200;deltaf=1;T=1/fs;L=1/deltaf;N=floor(fs/deltaf)+1;t=0:0.005:1;freq=0:deltaf:fs;f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t);f_t_rectwin=f_t*rectwin(201);f_t_hann=f_t*hann(201);f_t_ha

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/28 01:51:32
这个MATLAB程序运行出来以后没有图像,是什么原因呢?fs=200;deltaf=1;T=1/fs;L=1/deltaf;N=floor(fs/deltaf)+1;t=0:0.005:1;freq=0:deltaf:fs;f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t);f_t_rectwin=f_t*rectwin(201);f_t_hann=f_t*hann(201);f_t_ha

这个MATLAB程序运行出来以后没有图像,是什么原因呢?fs=200;deltaf=1;T=1/fs;L=1/deltaf;N=floor(fs/deltaf)+1;t=0:0.005:1;freq=0:deltaf:fs;f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t);f_t_rectwin=f_t*rectwin(201);f_t_hann=f_t*hann(201);f_t_ha
这个MATLAB程序运行出来以后没有图像,是什么原因呢?
fs=200;
deltaf=1;
T=1/fs;
L=1/deltaf;
N=floor(fs/deltaf)+1;
t=0:0.005:1;
freq=0:deltaf:fs;
f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t);
f_t_rectwin=f_t*rectwin(201);
f_t_hann=f_t*hann(201);
f_t_hamming=f_t*hamming(201);
F_w_rectwin=T*fft(f_t_rectwin,N)+eps;
F_w_hann=T*fft(f_t_hann,N)+eps;
F_w_hamming=T*fft(f_t_hamming)+eps;
subplot(3,1,1);semilogy(freq,abs(F_w_rectwin));
title('rectwin windowing spectrum');
axis([0,200,1e-4,1]);grid on;
subplot(3,1,2);semilogy(freq,abs(F_w_hann));
title('hann windowing spectrum');
axis([0,200,1e-4,1]);grid on;
subplot(3,1,3);semilogy(freq,abs(F_w_hamming));
title('hamming windowing spectrum');
axis([0,200,1e-4,1]);grid on;
为什么下面这个运行出来以后都是直线呢?
fs=200;
deltaf=1;
T=1/fs;
L=1/deltaf;
N=floor(fs/deltaf)+1;
t=0:0.005:1;
freq=0:deltaf:fs;
f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t);
f_t_rectwin=f_t*rectwin(201);
f_t_hann=f_t*hann(201);
f_t_hamming=f_t*hamming(201);
F_w_rectwin=T*fft(f_t_rectwin,N)+eps;
F_w_hann=T*fft(f_t_hann,N)+eps;
F_w_hamming=T*fft(f_t_hamming)+eps;
>> subplot(3,1,1);semilogy(freq,abs(F_w_rectwin));
title('rectwin windowing spectrum');
axis([0,200,1e-18,1e-14]);grid on;
subplot(3,1,2);semilogy(freq,abs(F_w_hann));
title('hann windowing spectrum');
axis([0,200,1e-16,1e-12]);grid on;
subplot(3,1,3);semilogy(freq,abs(F_w_hamming));
title('hamming windowing spectrum');
axis([0,200,1e-16,1e-12]);grid on;

这个MATLAB程序运行出来以后没有图像,是什么原因呢?fs=200;deltaf=1;T=1/fs;L=1/deltaf;N=floor(fs/deltaf)+1;t=0:0.005:1;freq=0:deltaf:fs;f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t);f_t_rectwin=f_t*rectwin(201);f_t_hann=f_t*hann(201);f_t_ha
这个程序才是真正解决了,哈哈!
fs=200;
deltaf=1;
T=1/fs
L=1/deltaf
N=floor(fs/deltaf)+1;
t=0:0.005:1;
freq=0:deltaf:fs
f_t=sin(2*pi*500*t)+0.6*sin(2*pi*800*t)
f_t_rectwin=f_t.*rectwin(201)'
f_t_hann=f_t.*hann(201)';
f_t_hamming=f_t.*hamming(201)';
F_w_rectwin=T*fft(f_t_rectwin,N)
F_w_hann=T*fft(f_t_hann,N)
F_w_hamming=T*fft(f_t_hamming);
subplot(3,1,1);semilogy(freq,1e14*abs(F_w_rectwin));
title('rectwin windowing spectrum');
%axis([0,200,1e-14,1]);grid on;
subplot(3,1,2);semilogy(freq,abs(F_w_hann));
title('hann windowing spectrum');
%axis([0,200,1e-4,1]);grid on;
subplot(3,1,3);semilogy(freq,abs(F_w_hamming));
title('hamming windowing spectrum');
%axis([0,200,1e-4,1]);grid on;