Peak of multiple sine waves/functions

Jcouls29
Messages
20
Reaction score
0
I'm trying to get a method to determine the time, t, when two sine waves added together peak, an exact solution. For instance,

F(t) = sin(w1*t) + sin(w2*t)

Obviously this is not really mathematically straightforward because there are infinitely many solution based on the nature of the sine function. But if w1 < w2, where w1 = 2*pi*f1 and w2 = 2*pi*f2, there is always at least one peak when 0 < t < (1/f1).

I'm not a mathematician but I have a fairly strong grasp of calculus. Of course the derivative gives you:

F'(t) = w1*cos(w1*t) + w2*cos(w2*t)

which doesn't help me a whole lot. So if anyone has a direction I can go, please give me a shout. Just to mention, I've tried using the Taylor series but it's not exact enough at low orders which is practical for solving. Thanks if you can help
 
Physics news on Phys.org
Here's an idea: You know that positive and negative peaks will occur whenever the derivative is zero and you've already determined the derivative. Each possible solution of that equation won't necessarily be the maximum (or minimum) but that should very much limit the range of possible solutions to your problem.

Next, you would like to be able to easily see the value of t that provides each solution to the null derivative. So you want the equation in this form:

cos(at + b) = cos(w1*t) + (w2/w1)cos(w2*t) = 0

where b represents a phase offset

I'd imagine there is a trigonometric identity that will give you that transformation

then at + b = arccos(0)
 
Thanks,

I looked into doing something very similar to this. Of course, cos(wt+b) != cos(w1t) + cos(w2t) but I wanted to get a frequency of peaks (which is w2 if larger than w1) but the real issue arose with the trigonometric function to get rid of the addition of cosines.

Anyways, I'll look back into it and see if I can come up with a solution. It is a good approach.
 
>F(t) = sin(w1*t) + sin(w2*t)

There's in general no way to find the absolute peak.

The ideal peak would occur when the individual peaks line up:
w1*t/pi = 1/2 mod 1
AND
w2*t/pi = 1/2 mod 1
(ignoring the fact that some of these are actually troughs)

I'm not sure how to word it exactly, but if w1/w2 is not commensurate with 1, meaning this ratio is an irrational number, then both of these conditions won't ever be true. The overall function won't at all be periodic, or rather it will be an acoustical beat with an infinitely long period. You will, however, find cases that are closer and closer to the ideal case of sine + sine = 2 as t becomes enormous in magnitude.

But if the ratio w1/w2 is rational, say p/q, which is quite a special case, then just use a time of t=Nq pi / w1 and I think you will have found one of an infinite number of identical peaks in your overall periodic function.
 
Last edited:
I understand what you're saying. I'm at the point where a general solution isn't available (actually I kind of knew that when I posted this). But I'm not quite sure what you mean with t = Nq pi / w1. Actually more times than not, w1/w2 will be rational since pi generally cancels out then you have f1/f2 and if you work in hertz it will always be rational.

But that's not the issue. It's understanding how "far" the nth-peak of w2 (the peak closest to the first peak of w1) is from the peak of w1. This is easily calculated.

But because of the way the sine/cosine waves work around a circle, it's not going to be inbetween the 2 peaks in any apparent normal fashion.

In fact I uploaded a graph of the peak times versus harmonics of f1 (when f1 = 1 Hz). In this graph there is something peculiar though...whenever f2 = 4*n*f1 the time is always the same where n = 1,2,3,... In this case 0.25 secs.

Although it may seem like harmonics isn't the way to go, it's exactly what'll I'll be using this little project for, harmonic waveforms...regardless, that's where I'm at.

I'm thinking that this graph may be smoother if I consider more than just the "first peak", maybe the second and so on...It's to be determined...the research must GO ON!

Ha Thanks for some more insight
 

Attachments

  • Harmonic Peaks.jpg
    Harmonic Peaks.jpg
    13.5 KB · Views: 608
Why not transform the original equation

F(t) = sin(w1*t) + sin(w2*t)

using the identity

sin(A) + sin(B) = 2sin( \frac {A + B}{2} ) cos( \frac {A - B}{2})

Then take the derivative of that and set it equal to zero
 
Thanks for the response Phil, I did try this but the derivative still has 2 terms based on the chain rule which unfortunately, doesn't help unless I can constrict the function. I'm trying to use the taylor series dynamically to try and obtain an answer. If I set more restrictions on the f2, such as f2 = f1 + m where m is in Hz, I may be able to move a little further but I'm not sure yet. Thanks though
 
As PhilDSP suggested you have a maximum when (A+B)/2 = (4K+1)*pi/2 and (A-B)/2 = 2k*pi. Having this system of equations you can get t and k.
 
Cool, I'll check it out. Thanks I didn't realize what you were saying before Phil.
 
  • #10
I think I may have come to the conclusion that a closed form solution isn't analytically possible based on the definition of a sine wave. I appreciate the suggestions. I may have to determine a solution through trial error and determine from there what to do. If anyone in the future can help with a closed-form general solution to the problem above, by all means let me know !

Thanks
 
Back
Top