Algorithm for Matlab conv function

I would like to know which algorithm (or at least which big-O) is used in the built-in conv function. Thanks, Federico Labriola

回答 (1 件)

John D'Errico
John D'Errico 2015 年 7 月 5 日

0 投票

Why not test it yourself? These things are always SOOOO much more easily checked by yourself, rather than waiting for a response.
n = 10000;
a = rand(n,1);b = rand(n,1);
t(1) = timeit(@() conv(a,b));
a = rand(2*n,1);b = rand(2*n,1);
t(2) = timeit(@() conv(a,b));
a = rand(4*n,1);b = rand(4*n,1);
t(3) = timeit(@() conv(a,b));
a = rand(8*n,1);b = rand(8*n,1);
t(4) = timeit(@() conv(a,b));
t
t =
0.011539 0.056427 0.2248 0.88019
exp(diff(log(t)))
ans =
4.8901 3.984 3.9154
Looks like factors of 4 for each step to me.

カテゴリ

ヘルプ センター および File ExchangePerformance and Memory についてさらに検索

タグ

質問済み:

2015 年 7 月 5 日

回答済み:

2015 年 7 月 5 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by