cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

two signals max/min coincide

payman
13-Aquamarine

two signals max/min coincide

Hello All,

I have two oscillating signals. I want to find the position where

1) The signals maxima coincide with each other (the best match),

2) The signals minima coincide with each other (the best match),

3) One signal's max coincides with another signal's min.

Such points are indicated on the attached graph. Would you please help me with programming this step?

Thank you very much in advance.

Payman

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:payman)

PAYMAN RAJAI wrote:

Hello Werner,

Thank you for the hint.

I guess they are more clear in the attached picture. (the indication numbers were in black color, not easy to see)

I had not looked at the attached picture, just the worksheet.

About the sum of two signals, is it correct to say:

The max of the sum corresponds to the coincidence of the signals maxima

The min of the sum corresponds to the coincidence of the signals minima

Yes, but only if we assume the the maxima or minima will coincide at one position.

How about the coincidence of one max and one min? in that case the sum would be close to zero but it may also happen when two signals zeros coincide with each other.

In this case the sum is useless anyway. Think of two signals with different amplitude - the sum would not be zero at all!

But here min and max of the difference signal do the job.

But you have to be aware that this is a discrete approach which works with the data points only. No interpolation or fitting is done. If there is no data point at the max or min, we miss it.

So Freds approach of finding amplitude, frequency and phase for both signals first might be more appropriate.

See attachment.

1.png

View solution in original post

8 REPLIES 8
Werner_E
24-Ruby V
(To:payman)

Such points are indicated on the attached graph.step?

?? I only see a marker at k0 and this position does not correspond to either of your description. See screenshot of magnified position below.

How about looking at the max and min values of the sum of the two signals to get the positions you are looking for?

1.png

payman
13-Aquamarine
(To:Werner_E)

Hello Werner,

Thank you for the hint.

I guess they are more clear in the attached picture. (the indication numbers were in black color, not easy to see)

About the sum of two signals, is it correct to say:

The max of the sum corresponds to the coincidence of the signals maxima

The min of the sum corresponds to the coincidence of the signals minima

How about the coincidence of one max and one min? in that case the sum would be close to zero but it may also happen when two signals zeros coincide with each other.

Werner_E
24-Ruby V
(To:payman)

PAYMAN RAJAI wrote:

Hello Werner,

Thank you for the hint.

I guess they are more clear in the attached picture. (the indication numbers were in black color, not easy to see)

I had not looked at the attached picture, just the worksheet.

About the sum of two signals, is it correct to say:

The max of the sum corresponds to the coincidence of the signals maxima

The min of the sum corresponds to the coincidence of the signals minima

Yes, but only if we assume the the maxima or minima will coincide at one position.

How about the coincidence of one max and one min? in that case the sum would be close to zero but it may also happen when two signals zeros coincide with each other.

In this case the sum is useless anyway. Think of two signals with different amplitude - the sum would not be zero at all!

But here min and max of the difference signal do the job.

But you have to be aware that this is a discrete approach which works with the data points only. No interpolation or fitting is done. If there is no data point at the max or min, we miss it.

So Freds approach of finding amplitude, frequency and phase for both signals first might be more appropriate.

See attachment.

1.png

payman
13-Aquamarine
(To:Werner_E)

Thank you Werner, everything is correct. I have one more question:

Suppose there is no perfect match between two signals, does "lookup" function serach for the nearest match?

Werner_E
24-Ruby V
(To:payman)

PAYMAN RAJAI wrote:

Thank you Werner, everything is correct. I have one more question:

Suppose there is no perfect match between two signals, does "lookup" function serach for the nearest match?

In the sheet here I first search for the maximum or minimum in SUM or DIFF and then I use lookup to look for that very value in SUM and get the corresponding value in the third DATA column. So the value I am looking for definitely has to be found, it sure is present in SUM/DIFF, so there should never be any problem with lookup not finding the value.

"lookup" (like "match") will only search for a corrsponding value within the accuracy given by the system varable TOL. Thats the reason I changed TOL from the default value 10^-3 to something smaller.

If TOL is set to 10^-3 lookup will accasionally find more than one value.

There is a routine "Lookup" (note the capital L) in Mathcad 15 from the Data Analysis extension pack where you can use an optional third parameter to control the way lookup works, like "gt" to get all values greater than the given value, etc.

Fred_Kohlhepp
23-Emerald I
(To:payman)

You won't get a clean answer, but Fourier analysis can get you started:

payman
13-Aquamarine
(To:Fred_Kohlhepp)

Thank you very much Fred,

I have a few questions to understand your approach thoroughly.

1- why S1 and S2 are multiplied by factor "2" to obtain the amplitudes?

2- How do you find the proper phase values from the argument of S1 and S2?

3- How can I extract my desired positions at the end of the program?

Sorry if my questions are unintelligent.

Thank you

Payman

Fred_Kohlhepp
23-Emerald I
(To:payman)

PAYMAN RAJAI wrote:

1- why S1 and S2 are multiplied by factor "2" to obtain the amplitudes?

That's jus the way thwe CFFT function works, read help topics.

2- How do you find the proper phase values from the argument of S1 and S2?

I didn't, as the phase graph shows. The values of phase were developed by inspection.

3- How can I extract my desired positions at the end of the program?

Good question. A derivative would give you the inflection points. How you sorted out maxima and minima would require thought.

Sorry if my questions are unintelligent.

Thank you

Payman

Top Tags