⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example4_2.m

📁 西交大刘树棠写的《数字信号处理》那本书的所有源代码
💻 M
字号:
conv_time=zeros(1,150);
fft_time=zeros(1,150);
for L=1:150
    tc=0;tf=0;
    N1=2*L-1;
    nu=ceil(log10(N1)/log10(2));
    N=2^nu;
    for I=1:200
        h=randn(1,L);
        x=rand(1,L);
        t0=clock;y1=conv(h,x);t1=etime(clock,t0);
        tc=tc+t1;
        t0=clock;y2=ifft(fft(h,N).*fft(x,N));t2=etime(clock,t0);
        tf=tf+t2;
    end
    conv_time(L)=tc/200;
    fft_time(L)=tf/200;
end
n=1:150;subplot(1,1,1);
plot(n(25:150),conv_time(25:150),n(25:150),fft_time(25:150))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -