How can i create a convolution using toeplitz matrix?

Hello ,
i want to create a convolution between two signals but i need to make this happen using the teoplitz command that creates a toeplitz matrix .The problem here is that my first signal (h) is 1x5 matrix and the other signal (a) is 1x21 matrix .The process should be y=toeplitz(h or a) .* transpose(h or a) .How can i create the convolution using the toeplitz command in matlab?
thank you.

 採用された回答

Matt J
Matt J 2019 年 11 月 5 日
編集済み: Matt J 2019 年 11 月 5 日

0 投票

Consider
>> x=1:5, y=rand(1,5),
x =
1 2 3 4 5
y =
0.2899 0.4714 0.8782 0.6555 0.3184
and notice,
>> v1=(tril(toeplitz(x))*y(:)).'
v1 =
0.0306 0.6362 2.2098 4.2551 6.6630
>> v2=conv(x,y); v2=v2(1:numel(v1))
v2 =
0.0306 0.6362 2.2098 4.2551 6.6630

3 件のコメント

Gn Gnk
Gn Gnk 2019 年 11 月 6 日
Thank you a lot fo your answer . But the main problem still remains because i have a matrix 1x5 and another one 1x21 .In your helpful example you use two 1x5 matrixes .what shoud i do when the one is bigger than the other one ?
Matt J
Matt J 2019 年 11 月 6 日
Zero-pad.
Gn Gnk
Gn Gnk 2019 年 11 月 6 日
Thank you a lot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear Algebra についてさらに検索

質問済み:

2019 年 11 月 5 日

コメント済み:

2019 年 11 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by