add time shift to signal vector

10 ビュー (過去 30 日間)
Marius Tøndel Eliassen
Marius Tøndel Eliassen 2020 年 2 月 24 日
With this :
m_test = y1 + 10^(M.VAR/20)*y2;
adds a variable level of signal vector y2 to y1. Now I want to time shift y2 by a small amount (milliseconds) in relation to y1. How do I go about it? I tried delayseq() but that didn't work.

回答 (1 件)

Jon
Jon 2020 年 2 月 24 日
編集済み: Jon 2020 年 2 月 24 日
If you want to shift your data by an integer number of samples you can do something like this (here I'm just shifting y2, and plotting it but you can do something similar with your m_test calculation):
plot(t,y1,t1(1:end-9),y2(10:end))
If you can not just shift by an integer number of samples, you can first interpolate the data so that the shift you want will be an integer number of samples. The MATLAB function interp1 should be helpful for this.
  1 件のコメント
Marius Tøndel Eliassen
Marius Tøndel Eliassen 2020 年 2 月 24 日
Thanks, I thin this may work

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

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by