Help with discrete convolution

118 ビュー (過去 30 日間)
iz
iz 2019 年 8 月 5 日
コメント済み: ANIKET RAJAPURE 2022 年 8 月 6 日
Hi,
I need help with compute convolution between z1 and z2. I don't know how to define the functions(start from 0).
z1=U[n]-U[n-5] (z1= 1 for n=0,1,2,3,4)
z2=delta[n-5]
thank you.
  2 件のコメント
Guillaume
Guillaume 2019 年 8 月 5 日
" I don't know how to define the functions(start from 0)."
What function?
What is U and what is delta?
Walter Roberson
Walter Roberson 2019 年 8 月 6 日
U[] typically denotes the unit step function.

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

採用された回答

Jon
Jon 2019 年 8 月 6 日
This is a good reference that explains discrete convolution specifically using MATLABhttps://www.ling.upenn.edu/courses/cogs501/ImpulseResponse.html
I am not very clear from your description exactly what you are trying to do, however I think your concern is with what terms such as delta(n-2) that would give non-positive indices for n<=2. In this case, you just take advantage of the shift invariance of linear systems. Specifically shift everything by an amount necessary to keep your indices positive, and then when you are done shift the sequences backward.
  2 件のコメント
iz
iz 2019 年 8 月 7 日
Thank you.
That's was my problem. now i know there isn't negative indexes
ANIKET RAJAPURE
ANIKET RAJAPURE 2022 年 8 月 6 日
Thanks a lot

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

その他の回答 (1 件)

Jon
Jon 2019 年 8 月 5 日
編集済み: Jon 2019 年 8 月 5 日
You need to first form two vectors, z1 and z2 where z1 hold the values of your first series, and z2 holds the values of your second series. You can then use the conv function, so for example:
z1 = [1 8 7 2 3 4 5 9 2.3 11] % just made up data for example
z2 = [2 9 22 1.3 9 4 2.8 7 9] % just made up data for example
y = conv(z1,z2)
In my made up example, I just assigned the vectors to some numerical values. You may have a function, or some experimental data that you will use to obtain values that are then assigned to the vectors z1 and z2
  1 件のコメント
iz
iz 2019 年 8 月 6 日
But how can i use negative x axis values?
I mean if i have the next sequences and i want to do convolution:
‏‏conv.PNG
If i write z1=[1] for example it will get 1 in n=1.
how can i get z=1 at n=-1?

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

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by