Easy convolution of multiple vectors
7 ビュー (過去 30 日間)
古いコメントを表示
For the convolution of three vectors I'm doing:
A = [1 2];
B = [3 4];
C = [5 6];
res_aux = conv(A,B);
res = conv(res_aux,C);
Is there an easier way? Something like: res = multiconv({A,B,C})
An alternative would be using cellfun but it's slower.
0 件のコメント
採用された回答
Matt J
2014 年 9 月 23 日
編集済み: Matt J
2014 年 9 月 23 日
Here's an fft-based approach
data=[1 2;3 4;5 6].';
n=(size(data,1)-1)*size(data,2)+1;
result = ifft(prod(fft(data,n),2),'symmetric')
2 件のコメント
Matt J
2014 年 9 月 23 日
OK. I'm not sure it's faster/more efficient than a plain for-loop, though. It involves complex-valued arithmetic and probably about 4 times more memory consumption.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!