Two signals with different x-values. Mean(..)

15 ビュー (過去 30 日間)
Christoph Thale
Christoph Thale 2016 年 9 月 12 日
回答済み: dpb 2016 年 9 月 12 日
Hi,
I got two different signals with a lot of x- and y-values. I am able to plot them both but i have no clue to get the mean of the signals.
The signals are build like that:
x1 ......... y1 ---------------------- x2 .......y2
0,12 ....... 2,1 ------------------- 0,133 .... 2,1
0,15 ........2,62 ------------------ 0,143 .... 2,45
.
.
.
so I cant take y1(1) and y2(1) and cut them in two. Also, i am not able to use polyfit or something like that, because there is no polynom which can discribe the course.
Does anyone have an idea?
  2 件のコメント
John D'Errico
John D'Errico 2016 年 9 月 12 日
Hopelessly confusing question. Please explain what you need. CLEARLY. Give an example if possible.
Christoph Thale
Christoph Thale 2016 年 9 月 12 日
i got two signals and i want to have the mean-signal of both.

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

回答 (1 件)

dpb
dpb 2016 年 9 月 12 日
If you can plot them, then I presume you have them as variables. Since the x-values appear to be nonconformant in magnitude, about all you can do is to interpolate each to a common set of points and then average the resulting y values at those values. Perhaps the simplest is to use one of the two as the interpolating value...
y1Interp=interp1(x1,y1,x2,'linear','extrap'); % get interpolated y1 at points in x2
y=mean([y1Interp y2]); % and average the two
hold all % to add to the previous plot of each separately
plot(x2,y) % plot the averaged value at the point it was interpolated to match

カテゴリ

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