How to create an envelop from three graphs

How can i create an envelop for three different Signals. the edges around the three signals that are top most, so there is an envelop around all three but forming 1 plot around all three. All three signals are plotted on the same graph

댓글 수: 1

Jan
Jan 2012년 9월 3일
It would be helpful, if you post any details. Do you have the "graphs" on paper, as picture file, as FIG file, as data of a text file, as MAT file or available as arrays? Do the grpahs share the same X-values or do you have to interpolate at first?

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2012년 9월 3일

0 개 추천

For the most trivial case, when the three lines share the same X-values and are provides as vectors:
x = 1:100;
y1 = rand(1, 100);
y2 = rand(1, 100);
y3 = rand(1, 100);
joined = cat(1, y1, y2, y3);
env_max = max(joined, [], 1);
env_min = min(joined, [], 1);
plot(x, joined);
hold('on');
plot(x, env_max, 'k');
plot(x, env_min, 'k');

댓글 수: 6

Lisa Justin
Lisa Justin 2012년 9월 3일
편집: Lisa Justin 2012년 9월 3일
Thanks but i like to create an envelop along the edges of all three plots forming another plot
y1 = rand(1, 100);
y2 = rand(1, 100);
y3 = rand(1, 100);
x=fft(y1);
y=fft(y2);
z=fft(y3);
joined = cat(1, y1, y2, y3);
f = 1:100;
plot(f,joined)
hold on
plot(f, envelop) Not sure how to get this
?????
I need an envelop (max only) along all three plots so i can get a new plot showing the relevent parts, i am using an accelerometer with three directions x,y,z. With LMS test Lab an envelop could by created but i need to do the same with Matlab, but i do not know how to.
Jan
Jan 2012년 9월 3일
편집: Jan 2012년 9월 3일
What's wrong with:
env_max = max(joined, [], 1);
plot(x, env_max, 'k');
?? Please define mathematically, what you call "envelope".
Lisa Justin
Lisa Justin 2012년 9월 4일
편집: Lisa Justin 2012년 9월 4일
The new curve (envelope) should be tangent on all three curves.
Jan
Jan 2012년 9월 4일
If a curve is a tangent to three other lines, these lines must be identical in each point, because they have the same slope and the same position. Please choose any more appropriate explanation of the result you are trying to achieve. Please, Lisa, do not let us guess the details, because this wastes your and our time. Thanks.
Lisa Justin
Lisa Justin 2012년 9월 5일
I will try to post a plot so it is easy to understand what i mean
Dr. Seis
Dr. Seis 2012년 9월 5일
편집: Dr. Seis 2012년 9월 5일
I generally use hilbert to give me the analytic signal, which I then take the abs to give me my envelope of a single signal. If this is what you are after, then maybe this will work (expanding on Jan's answer):
>> hilb = max(abs(hilbert(joined)),[],1);
>> plot(f,joined,f,hilb)
Does that look about right?
Or maybe you need to perform the Hilbert transform on the distance your individual data-point is from the origin (0,0,0) i.e.,
sqrt(y1.^2+y2.^2+y3.^2)
So...
>> hilb2 = max(abs(hilbert(sqrt(y1.^2+y2.^2+y3.^2))),[],1)
>> plot(f,joined,f,hilb2)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2012년 9월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by