Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

phase shift calculation

Status
Not open for further replies.

MRSSPOCK

Mechanical
Aug 29, 2010
303
0
0
GB
I have a sine wave plotted, i.e. y = sin(x)

I have a second wave plotted, where y = sin(2x)+1

phase_shift_required_hgvetu.jpg


I now wish to introduce a phase shift, such that the latter wave becomes tangential with the former.

Whether the shift is in the X+ or X- direction is irrelevant to me.

Can anyone please explain how to calculate this phase shift, and illustrate it with an Excel graph, to show that the results of the calculation actually do provide the correct phase shift to create the condition where the waves are actually tangential at certain periodic instants.

Thanks
 
Replies continue below

Recommended for you

"...equal slope and equal magnitude."

The method that I described will, I think, reveal the points in time where slopes are equal. I'd expect perhaps two per repeating cycle.

The original waveforms are equal in amplitude where they trivially intersect, obviously two points per repeating cycle.

Clearly the 'equal phase' two points in time are not the same as the 'equal amplitude' two points in time.

Given two different signals, in order for the amplitudes to be equal, the waveforms must cross over. Obviously the slopes must be different at that same point !! :)







 
"...amplitude = slope..."

Amplitude of the derivative waveform (cos, or shifted sin) represents the slope of the original (sin).

If one wishes to leave the +1 offset in Equation 2, that's fine. That +1 offset will still disappear when the derivative is taken anyway.

 
Darn Post Edit function isn't working.

Typo.

Clearly the 'equal slope' two points in time are not the same as the 'equal amplitude' two points in time.
 
OK, now that I understand what you're trying to do, the solution presented by VE1BLL from Wolfram Alpha in your other thread was almost the correct answer. This is one reason why you should try to keep variants of a topic together, since it turns out that your only issue with the other thread was that the second equation did not reflect the derivative correctly, and had you presented the actual problem, instead of your attempted solution, this thread would have been completely unnecessary, as the error would have been immediately revealed.

sin(x) = sin(2x+s)+1
This is the equation for having the two curves intersect, where s is the phase required to get the intersection and matching slope

cos(x) = 2cos(2x+s) instead of cos(x) = cos(2x+s)
This is the equation for having the same slope at the point of the intersection

The corrected Wolfram Alpha link is below. Unfortunately, those nice neat solutions from last time didn't appear this time; they're substantially more complex.

TTFN (ta ta for now)
I can do absolutely anything. I'm an expert! faq731-376 forum1529
 
Given two different signals, in order for the amplitudes to be equal, the waveforms must cross over. Obviously the slopes must be different at that same point !!
I'm not sure about the 2nd statement.

But more important I think the first statement is incorrect, and examining this behavior helps us graphically envisioning the solution to op's problem.

As a simple example look at two curves: cos(pi*t) and cos(2*pi*t)
Examine behavior at t=0.
They are not crossing over.
Both they have the same value (1) and the same slope (0).

It is similar situation for the op's problem. It is not a point of crossing but a point of contact/tangency between the two curves.

In the way it is plotted in original post the upper lobe of the lower curve intersets with the lower lobe of the upper graph at two points (roughly x=0.9 and x=2.8). If we slide the upper curve to the right gradually these twp points of intersection will move. If we slide far enough to the lower lobe will not contact the upper lobe at all and we have zero points of intersection.

Obviously somewhere between the two points of intersection and zero points of intersection, we have to pass through a place where there is only one point of intersection of the two curves. And if they do not cross but have one point of intersection, then we conclude that will be a point of tangency. I think you can apply similar logic in any region of two "smooth" curves where one is concave up and the other concave down.

Attached graph illustrates. Blue and red curves are the op's curves. Shift the Red curve to the right and it turns into the red curve and those two points of contact merge into one local point of contact (if you shifted any further they would turn into zero local points of contact).


=====================================
(2B)+(2B)' ?
 
 http://files.engineering.com/getfile.aspx?folder=de5f4de6-d6f9-4a5d-b028-f3bbfa4ee81c&file=Presentation1.pdf
I think you can apply similar logic in any region of two "smooth" curves where one is concave up and the other concave down.
If I could edit, I'd get rid of that because it doesn't encompass my simple example of the two curves: cos(pi*t) and cos(2*pi*t).

=====================================
(2B)+(2B)' ?
 
electricpete correction said:
Attached graph illustrates. Blue and red curves are the op's curves. Shift the Red curve to the right and it turns into the red grey curve and those two points of contact merge into one local point of contact (if you shifted any further they would turn into zero local points of contact).

=====================================
(2B)+(2B)' ?
 
Yep. Your correction is appreciated.

The observation was specifically in response to Bill's "...The OP is....looking for....equal slope and equal magnitude...", and in the context of the OP's two waveforms.

Sorry for the confusion. I should have included additional verbiage to put limits on the wording.

Carry on. :)

 
This isn't the optimum solution, but I'm happy to settle for this.

It is just a case of finding the minimum value of the equation shown, then the shift required is read directly from the y axis.

minimum_graph_akida9.jpg


Just for reference, I did also notice that I made a mistake in the very first post of the original thread where this theme began.

I incorrectly calculated the derivative of sin(2x+s)+1 as cos(2x+s), when it ought to have been 2cos(2x+s)

Thanks for your input.
 
I guess that the phase shift is in radians. If so, is it really plausible to add arcsine (range +-Pi) and sine (range +/-1)? To me, it is a screaming unit incompatibility. Did you test this? With meaningful results?

I guess that I will be hooking up a dual channel AWG and a scope with math capability to verify all the different proposed solutions. Nothing beats reality.

But, even if I really wanted to do that, time is lacking. Hope to do it in a week or two.

Gunnar Englund
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
 
Attached xlsx file graphically shows a solution in the neighborhood (x = 3.0, theta = -1.85)
It is similar to my previous-posted pdf, except there is a correction in the curve labeling and some format changes.

Op's solution suggests theta = 1.3. If I plug in theta = 1.3 it doesn't suggest a solution, but if I plug in -1.3 into my spreadsheet (cell B2), then I see another solution around x=0.2. Maybe that is consistent with op's solution posted above if we have defined theta with opposite polarities of each other. Although I didn't follow the logic of how the op came up with his graph.

I'm not so sure about my previous analytical solution leading to z = 1/3 +/- |sqrt(4/3)| = 2*sin(2x+theta). Doesn't seem to match my graphical solutions.


=====================================
(2B)+(2B)' ?
 
 http://files.engineering.com/getfile.aspx?folder=e47dc5ff-a369-4571-b3bc-41bb69ef873c&file=Solution.xlsx
Here is a slightly better spreadsheet... it has the x axis adjusted to show a full range 0..2*Pi (for any value of theta that gives a solution, a solution should appear in this range).

I think the solutions are in the neighborhood
theta = -1.85, x=3+n*2*pi
theta = -1.3, x=0.2+n*2*pi


=====================================
(2B)+(2B)' ?
 
 http://files.engineering.com/getfile.aspx?folder=5de2edba-f6a0-4675-a86a-3fd3d8f2236b&file=Solution2.xlsx
Here are the solutions for the case I am interested in.

There are other solutions, but this is the one I want.

Ignore the fact that the value of the shift is positive, it just refers to the shift of the other wave.

I know this works.

I've graphed it and it is perfect, as it is also in the AWG

x_and_shift_answers_n3pq74.jpg
 
MRSSPOCK- can you explain how you came up with your solution?
(it looks correct but I'm curious how you got there)

=====================================
(2B)+(2B)' ?
 
MRSSPOCK, The sin(x) and sin(2x) waveforms you show remind me of the relationship between input voltage into a resistive load vs the power which the load sees (which is double the frequency of the fundamental) or, the voltage out of an inverter vs. the power delivered by that inverter (power is delivered at 2x the fundamental frequency). In either case, there is a phase shift when typical filters and other lagging or leading elements are involved. In either of these cases, the phase shift would be measured from the TOP (i.e. 90 degrees) of the fundamental, not the zero-crossing. Looking at it this way may make your trig equations easier.

Darrell Hambley P.E.
SENTEK Engineering, LLC
 
Status
Not open for further replies.
Back
Top