How to match the origins of two different length vectors and pad zeros to match their length?

1 回表示 (過去 30 日間)
Hello,
I am tasked to create a function that adds two different signals for digital signal processing. I am aware that the signals should have the same length in order to get the right sum between them. My problem is how would I go about aligning their origins and adding the zeros necessary in order to ensure correct addition between the 2 signals.
Any help would be greatly appreciated.

回答 (1 件)

KSSV
KSSV 2021 年 9 月 14 日
You must be having (t1,x1) and (t2,x2) ; these are two singlas.
You can pick the superset time out of (t1,t2). For the other findout where the time matches with other, get index and fill zeros.
Also you can pick the suprset, use interp1 for the other signals with extrapolation off.

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by