使用 fftw matlab mex,matlab fftw( ,)参数解释

Examples

Comparison of Speed for Different Planner Methods

The following example illustrates the run times for different settings of planner. The example first creates some data and appliesfft to it using the default method, estimate.

t=0:.001:5;

x = sin(2*pi*50*t)+sin(2*pi*120*t);

y = x + 2*randn(size(t));

tic; Y = fft(y,1458); toc

Elapsed time is 0.000521 seconds.

If you execute the commands

tic; Y = fft(y,1458); toc

Elapsed time is 0.000151 seconds.

a second time, MATLAB software reports the elapsed time as essentially 0. To measure the elapsed time more accurately, you can execute the command Y = fft(y,1458) 1000 times in a loop.

tic; for k=1:1000

Y = fft(y,1458);

end; toc

Elapsed time is 0.056532 seconds.

This tells you that it takes on order of 1/10000 of a second to execute fft(y, 1458) a single time.

For comparison, set planner to patient. Since this planner explores possible algorithms more thoroughly than hybrid, the first time you run fft, it takes longer to compute the results.

fftw('planner','patient')

tic;Y = fft(y,1458);toc

Elapsed time is 0.100637 seconds.

However, the next time you call fft, it runs at approximately the same speed as before you ran the method patient.

tic;for k=1:1000

Y=fft(y,1458);

end;toc

Elapsed time is 0.057209 seconds.

Reusing Optimal FFT Algorithms

In order to use the optimized FFT algorithm in a future MATLAB session, first save the "wisdom" using the command

str = fftw('wisdom')

You can save str for a future session using the command

save str

The next time you open a MATLAB session, load str using the command

load str

and then reload the "wisdom" into the FFTW database using the command

fftw('wisdom', str)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值