How to substract/add 2 signals which have different phase?

6 ビュー (過去 30 日間)
Nguyen Trung Kien
Nguyen Trung Kien 2019 年 1 月 8 日
コメント済み: Nguyen Trung Kien 2019 年 1 月 10 日
Currently, I want to finding the different of 2 signals in Timedomain. The data is time and amplitude.
I have tried xcorr function with fft, but I cannot find how to do the phase shift with xcorr to make 2 signals in phase and then I can substract them.
It is hard to represent the signal by cosine function, so I really want to find the solution directly by data.
The attachment is my 2 data sets.
Here is how I do as suggestion from other thread:
[c,lags]=xcorr(Y1,Y2);
[~,iLag]=max(c(find(lags==0):end));
s3=circshift(Y2,[0 iLag]);
  2 件のコメント
nanren888
nanren888 2019 年 1 月 10 日
編集済み: nanren888 2019 年 1 月 10 日
What do you mean by subtract/add?
z = x+y;
Can you explain what you actually want?
Your use of xcorr is as if you want to align them in some way.
is Y1 X1?
Is Y2 X2?
Nguyen Trung Kien
Nguyen Trung Kien 2019 年 1 月 10 日
Yes, I mean I want to find the signal which is difference between 2 signals:
z = y - x;
But I have only echo data as in attachment in time domain, I cannot represent signal by cosine function.

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

回答 (0 件)

カテゴリ

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

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by