How to match the origins of two different length vectors and pad zeros to match their length?
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
KSSV
on 14 Sep 2021
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.
See Also
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!