《DSP using MATLAB》示例Example5.22

代码:

Nmax = 2048; fft_time = zeros(1, Nmax);
for n = 1:1:Nmax
	x=rand(1,n);
	t=clock; fft(x); fft_time(n)=etime(clock, t);
end

n=[1:1:Nmax]; 

figure('NumberTitle', 'off', 'Name', 'Exameple5.22 ')
set(gcf,'Color','white'); 
plot(n, fft_time,'.');
xlabel('N'); ylabel('Time in Sec.'); title('FFT execution times');

  该脚本运行与机器软硬件有关,书中例子结果:

我的机子运行结果为:

都是显示常数,15ms左右。

 

posted @ 2016-12-20 07:47  跑啊跑  阅读(430)  评论(0编辑  收藏  举报